13 #define DEBUG_EARTH_TIME
32 using namespace basis;
42 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
44 #define BASE_LOG(s) STAMPED_EMERGENCY_LOG(program_wide_logger::get(), s)
46 const int TIME_FORMAT = clock_time::MERIDIAN | clock_time::SECONDS
47 | clock_time::MILLISECONDS;
58 virtual int execute();
67 void test_earth_time::run_test_01()
73 clock_time::normalize(checker_1);
77 ASSERT_EQUAL(checker_1, compare_1,
"normalize should not fail test 1");
80 clock_time::normalize(checker_2);
82 ASSERT_EQUAL(checker_2, compare_2,
"normalize should not fail test 2");
85 clock_time::normalize(checker_3);
87 ASSERT_EQUAL(checker_3, compare_3,
"normalize should not fail test 3");
90 clock_time::normalize(checker_4);
92 ASSERT_EQUAL(checker_4, compare_4,
"normalize should not fail test 4");
95 clock_time::normalize(checker_5);
97 ASSERT_EQUAL(checker_5, compare_5,
"normalize should not fail test 5");
100 void test_earth_time::run_test_02()
106 time_locus::normalize(checker_1);
110 ASSERT_EQUAL(checker_1, compare_1,
"normalize should not fail test 1");
113 time_locus::normalize(checker_2);
115 ASSERT_EQUAL(checker_2, compare_2,
"normalize should not fail test 2");
124 void test_earth_time::run_test_03()
132 LOG(
astring(
"now() returned locus: ") + curr_now.
text_form_long(clock_time::MILITARY, day_in_year::LONG_MONTH | day_in_year::INCLUDE_DAY, time_locus::LONG_YEAR));
135 LOG(
astring(
"greenwich_now() returned locus: ") + curr_green.
text_form_long(clock_time::MILITARY, day_in_year::LONG_MONTH | day_in_year::INCLUDE_DAY, time_locus::LONG_YEAR));
140 int test_earth_time::execute()
148 return final_report();
The application_shell is a base object for console programs.
Provides a dynamically resizable ASCII character string.
A specific point in time as represented by a 24 hour clock.
An object that represents a particular day in a year.
An object that represents a particular point in time.
basis::astring text_form_long(int t=clock_time::MERIDIAN, int d=day_in_year::SHORT_MONTH, int y=LONG_YEAR) const
#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.
An extension to floating point primitives providing approximate equality.
A dynamic container class that holds any kind of object via pointers.
time_locus greenwich_now()
returns Greenwich Mean Time (their now).
time_locus now()
returns our current locus in the time continuum.
Useful support functions for unit testing, especially within hoople.
#define ASSERT_EQUAL(a, b, test_name)