21 using namespace basis;
31 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
33 static chaos a_randomizer;
44 virtual int execute();
53 for (
int i = 0; i < length; i++)
58 int test_file_info::execute()
70 testing._time = absurdity_time;
71 testing._checksum = 1283412;
72 ASSERT_EQUAL((
int)testing._file_size, (
int)7298238,
"constructor file size");
73 ASSERT_EQUAL(testing._time, absurdity_time,
"constructor file time");
74 ASSERT_EQUAL(testing._checksum, 1283412,
"constructor checksum");
76 "constructor filename");
91 "constructor filename");
94 astring seconame =
"glorabahotep";
95 testing.secondary(seconame );
97 testing.attachment(randobytes);
100 testing.
pack(packed);
104 ASSERT_EQUAL(seconame, unstuffy.secondary(),
"secondary name incorrect");
105 ASSERT_EQUAL(randobytes, unstuffy.attachment(),
"secondary attachment inaccurate");
107 return final_report();
The application_shell is a base object for console programs.
void reset(int number=0, const contents *initial_contents=NULL_POINTER)
Resizes this array and sets the contents from an array of contents.
int length() const
Returns the current reported length of the allocated C array.
Provides a dynamically resizable ASCII character string.
A very common template for a dynamic array of bytes.
Encapsulates some measures and calculations based on a file's contents.
double _file_size
the size of the file.
int _checksum
the checksum for the file.
file_time _time
the file's access time.
virtual bool unpack(basis::byte_array &packed_form)
Restores the packable from the "packed_form".
Provides operations commonly needed on file names.
virtual bool unpack(basis::byte_array &packed_form)
Restores the packable from the "packed_form".
virtual void pack(basis::byte_array &packed_form) const
Creates a packed form of the packable object in "packed_form".
virtual int packed_size() const
Estimates the space needed for the packed structure.
a platform-independent way to acquire random numbers in a specific range.
#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.
unsigned char abyte
A fairly important unit which is seldom defined...
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.
byte_array random_bytes(int length)
#define ASSERT_EQUAL(a, b, test_name)
#define ASSERT_TRUE(a, test_name)