27 using namespace basis;
37 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
39 static chaos a_randomizer;
50 virtual int execute();
55 int test_file_time::execute()
66 astring toppy(
"c:/Windows/notepad.exe");
71 FILE *topdir = fopen(toppy.s(),
"r");
78 int filenum =
fileno(topdir);
80 int stat_okay =
fstat(filenum, &sbuffer);
86 ASSERT_EQUAL(absurdity_time, nutty_time,
"filename vs. FILE ctor");
87 ASSERT_EQUAL(absurdity_time, goofy_time,
"filename vs. time_t ctor");
88 ASSERT_EQUAL(absurdity_time, testing,
"filename vs. copy ctor");
89 ASSERT_EQUAL(nutty_time, goofy_time,
"FILE vs. time_t ctor");
92 ASSERT_EQUAL(goofy_time, absurdity_time,
"time_t vs. filename ctor");
96 int size = testing.packed_size();
101 ASSERT_EQUAL((
double)testing.raw(), (
double)unstuffy.
raw(),
"unpacked contents should be equal to prior");
109 ASSERT_EQUAL(unstuffy, goofy_time,
"constructor file size");
111 return final_report();
The application_shell is a base object for console programs.
int length() const
Returns the current reported length of the allocated C array.
Provides a dynamically resizable ASCII character string.
virtual void text_form(base_string &state_fill) const
Provides a text view of all the important info owned by this object.
int length() const
Returns the current length of the string.
A very common template for a dynamic array of bytes.
time_t raw() const
provides the OS version of the file's timestamp.
virtual bool unpack(basis::byte_array &packed_form)
a platform-independent way to acquire random numbers in a specific range.
#define NULL_POINTER
The value representing a pointer to nothing.
#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.
Useful support functions for unit testing, especially within hoople.
#define ASSERT_EQUAL(a, b, test_name)
#define ASSERT_TRUE(a, test_name)
#define ASSERT_FALSE(a, test_name)
#define ASSERT_INEQUAL(a, b, test_name)