35 using namespace basis;
41 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
51 int run_filestack_simple();
52 int run_filestack_middling();
53 int run_filestack_complex();
62 int recursive_factorial(
int num);
67 int test_callstack_tracker::run_filestack_simple()
70 #ifdef ENABLE_CALLSTACK_TRACKING
79 int test_callstack_tracker::sub_call_1()
85 int test_callstack_tracker::sub_call_2()
91 int test_callstack_tracker::sub_call_3()
97 int test_callstack_tracker::sub_call_4()
100 #ifdef ENABLE_CALLSTACK_TRACKING
107 int test_callstack_tracker::run_filestack_middling()
109 FUNCDEF(
"run_filestack_middling");
111 #ifdef ENABLE_CALLSTACK_TRACKING
113 retval = sub_call_1();
118 int test_callstack_tracker::run_filestack_complex()
120 FUNCDEF(
"run_filestack_complex")
121 int fact_sought = 12;
122 int factotum = recursive_factorial(12);
123 LOG(
a_sprintf("factorial of %d was computed as %d", fact_sought, factotum));
133 int test_callstack_tracker::recursive_factorial(
int num)
140 #ifdef ENABLE_CALLSTACK_TRACKING
146 return num * recursive_factorial(
num - 1);
152 int test_callstack_tracker::execute()
157 int ret = run_filestack_simple();
159 ret = run_filestack_middling();
161 ret = run_filestack_complex();
164 critical_events::alert_message(
astring(class_name()) +
": works for those functions tested.");
166 return final_report();
#define GET_AND_TEST_STACK_TRACE(header, failure_return)
The application_shell is a base object for console programs.
a_sprintf is a specialization of astring that provides printf style support.
Provides a dynamically resizable ASCII character string.
#define DEFINE_CLASS_NAME(objname)
Defines the name of a class by providing a couple standard methods.
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
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.
Implements an application lock to ensure only one is running at once.
The guards collection helps in testing preconditions and reporting errors.
A platform independent way to obtain the timestamp of a file.
A logger that sends to the console screen using the standard output device.
A dynamic container class that holds any kind of object via pointers.
Useful support functions for unit testing, especially within hoople.