40#define WIDER_ACCEPT 0.95
41#define WIDEST_ACCEPT 1.20
43#define LOG(s) EMERGENCY_LOG(program_wide_logger::get(), s)
53int test_stopwatch::execute()
64 LOG(
a_sprintf(
"sleep of %0.3f seconds took %d milliseconds\n",
69 deadly_error(class_name(),
"first",
"unacceptable timer deviation");
77 LOG(
a_sprintf(
"sleep of %0.3f seconds took %d milliseconds\n",
81 deadly_error(class_name(),
"second",
"unacceptable timer deviation");
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.
a platform-independent way to acquire random numbers in a specific range.
int inclusive(int low, int high) const
< Returns a pseudo-random number r, such that "low" <= r <= "high".
A class for measuring event durations in real time.
int milliseconds()
Returns the elapsed number of milliseconds on the stopwatch, overall.
void halt()
Stops the timing.
void reset()
Stops the stopwatch and clears it to zero time elapsed.
void start()
Begins the timing.
static void sleep_ms(basis::un_int msec)
a system independent name for a forced snooze measured in milliseconds.
#define deadly_error(c, f, i)
#define DEFINE_CLASS_NAME(objname)
Defines the name of a class by providing a couple standard methods.
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.
type absolute_value(type a)
Returns a if a is non-negative, and returns -a otherwise.
A logger that sends to the console screen using the standard output device.
An extension to floating point primitives providing approximate equality.
A dynamic container class that holds any kind of object via pointers.