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 
21 #include <loggers/console_logger.h>
24 #include <unit_test/unit_base.h>
25 
26 using namespace application;
27 using namespace basis;
28 using namespace configuration;
29 using namespace loggers;
30 using namespace textual;
31 using namespace unit_test;
32 
33 #define LOG(s) EMERGENCY_LOG(program_wide_logger::get(), astring(s))
34 
35 class test_system_values : virtual public unit_base, virtual public application_shell
36 {
37 public:
38  test_system_values()
40  events(system_values::EVENT_VALUES()),
41  filters(system_values::FILTER_VALUES()),
42  outcomes(system_values::OUTCOME_VALUES())
43  {}
44 
45  DEFINE_CLASS_NAME("test_system_values");
46  virtual int execute();
47 
48 private:
49  system_values events;
50  system_values filters;
51  system_values outcomes;
52 };
53 
54 int 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 
75 HOOPLE_MAIN(test_system_values, )
76 
The application_shell is a base object for console programs.
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.
Definition: system_values.h:39
#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)