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);
67int test_callstack_tracker::run_filestack_simple()
70 #ifdef ENABLE_CALLSTACK_TRACKING
79int test_callstack_tracker::sub_call_1()
85int test_callstack_tracker::sub_call_2()
91int test_callstack_tracker::sub_call_3()
97int test_callstack_tracker::sub_call_4()
100 #ifdef ENABLE_CALLSTACK_TRACKING
107int test_callstack_tracker::run_filestack_middling()
109 FUNCDEF(
"run_filestack_middling");
111 #ifdef ENABLE_CALLSTACK_TRACKING
113 retval = sub_call_1();
118int 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));
133int test_callstack_tracker::recursive_factorial(
int num)
140 #ifdef ENABLE_CALLSTACK_TRACKING
146 return num * recursive_factorial(num - 1);
152int test_callstack_tracker::execute()
157 int ret = run_filestack_simple();
159 ret = run_filestack_middling();
161 ret = run_filestack_complex();
166 return final_report();
#define GET_AND_TEST_STACK_TRACE(header, failure_return)
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.
a_sprintf is a specialization of astring that provides printf style support.
Provides a dynamically resizable ASCII character string.
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.
#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.