25 using namespace basis;
39 virtual int execute();
42 double angleAverage(
double a1,
double a2) {
46 if (a1 < 180.0) a1 += 360.0;
49 return fmod( (a1 + a2) / 2.0, 360.0);
54 int test_ccri_angle_average::execute()
63 avg = angleAverage(a1, a2);
66 avg = angleAverage(a1, a2);
69 avg = angleAverage(a1, a2);
74 avg = angleAverage(a1, a2);
76 a1 = 89.9; a2 = 270.1;
77 avg = angleAverage(a1, a2);
80 avg = angleAverage(a1, a2);
83 avg = angleAverage(a1, a2);
86 avg = angleAverage(a1, a2);
89 avg = angleAverage(a1, a2);
92 avg = angleAverage(a1, a2);
95 avg = angleAverage(a1, a2);
98 avg = angleAverage(a1, a2);
101 avg = angleAverage(a1, a2);
104 avg = angleAverage(a1, a2);
107 avg = angleAverage(a1, a2);
110 avg = angleAverage(a1, a2);
113 avg = angleAverage(a1, a2);
117 avg = angleAverage(a1, a2);
120 avg = angleAverage(a1, a2);
123 avg = angleAverage(a1, a2);
126 avg = angleAverage(a1, a2);
129 return final_report();
The application_shell is a base object for console programs.
a_sprintf is a specialization of astring that provides printf style support.
Outcomes describe the state of completion for an operation.
#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.
type absolute_value(type a)
Returns a if a is non-negative, and returns -a otherwise.
Contains all of our objects for geometry and avoids name clashes.
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.
Useful support functions for unit testing, especially within hoople.
#define ASSERT_EQUAL(a, b, test_name)