feisty meow concerns codebase 2.140
test_system_values.cpp
Go to the documentation of this file.
1/*****************************************************************************\
2* *
3* Name : test_system_values *
4* Author : Chris Koeritz *
5* *
6*******************************************************************************
7* Copyright (c) 2005-$now By Author. This program is free software; you can *
8* redistribute it and/or modify it under the terms of the GNU General Public *
9* License as published by the Free Software Foundation; either version 2 of *
10* the License or (at your option) any later version. This is online at: *
11* http://www.fsf.org/copyleft/gpl.html *
12* Please send any updates to: fred@gruntose.com *
13\*****************************************************************************/
14
15#include <basis/functions.h>
16#include <basis/guards.h>
17#include <basis/astring.h>
18
24#include <unit_test/unit_base.h>
25
26using namespace application;
27using namespace basis;
28using namespace configuration;
29using namespace loggers;
30using namespace textual;
31using namespace unit_test;
32
33#define LOG(s) EMERGENCY_LOG(program_wide_logger::get(), astring(s))
34
35class test_system_values : virtual public unit_base, virtual public application_shell
36{
37public:
38 test_system_values()
43 {}
44
45 DEFINE_CLASS_NAME("test_system_values");
46 virtual int execute();
47
48private:
49 system_values events;
50 system_values filters;
51 system_values outcomes;
52};
53
54int test_system_values::execute()
55{
56 FUNCDEF("execute");
57
58 LOG("Outcome Values");
59 LOG("==============");
60 LOG(outcomes.text_form());
61
62 LOG("Filter Values");
63 LOG("=============");
64 LOG(filters.text_form());
65
66 LOG("Event Values");
67 LOG("============");
68 LOG(events.text_form());
69
70 critical_events::alert_message(astring(class_name()) + ": works for those functions tested.");
71
72 return 0;
73}
74
75HOOPLE_MAIN(test_system_values, )
76
The application_shell is a base object for console programs.
virtual int execute()=0
< retrieves the command line from the /proc hierarchy on linux.
application_shell()
constructs an application_shell to serve as the root of the program.
Provides a dynamically resizable ASCII character string.
Definition astring.h:35
This class provides a way to look up generated values used in the code base.
static const char * EVENT_VALUES()
values that define event objects used in the program.
static const char * FILTER_VALUES()
values that define filters used in logging.
static const char * OUTCOME_VALUES()
values that define the outcomes of operations.
static void alert_message(const char *info, const char *title="Alert Message")
shows the message in "info", with an optional "title" on the message.
#define DEFINE_CLASS_NAME(objname)
Defines the name of a class by providing a couple standard methods.
Definition enhance_cpp.h:42
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
Definition enhance_cpp.h:54
Provides macros that implement the 'main' program of an application.
#define HOOPLE_MAIN(obj_name, obj_args)
options that should work for most unix and linux apps.
Definition hoople_main.h:61
Implements an application lock to ensure only one is running at once.
The guards collection helps in testing preconditions and reporting errors.
Definition array.h:30
A logger that sends to the console screen using the standard output device.
Useful support functions for unit testing, especially within hoople.
Definition unit_base.cpp:35
#define LOG(s)