30 using namespace basis;
40 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
48 virtual int execute();
51 void test_huge_file::run_file_scan()
59 if (!
files.length()) {
62 astring tmpdir = application_configuration::current_directory();
64 for (
int i = 0; i < dir.files().length(); i++) {
66 if (dir.files()[i].ends(
".txt"))
68 astring chewed_string = tmpdir +
"/" + dir.files()[i];
69 files += chewed_string;
75 for (
int i = 0; i <
files.length(); i++) {
80 double len =
test.length();
83 while ( (posn < len) && !
test.eof() ) {
87 outcome ret =
test.read(data_found, readlen, bytes_read);
89 if (ret == huge_file::OKAY) {
95 log(
a_sprintf(
"failed check, want %.0f, got %.0f",
double(len),
double(posn)));
96 ASSERT_EQUAL(posn, len,
"eof check should be at right position: ");
101 int test_huge_file::execute()
105 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.
Provides a dynamically resizable ASCII character string.
A very common template for a dynamic array of bytes.
Outcomes describe the state of completion for an operation.
Implements a scanner that finds all filenames in the directory specified.
Supports reading and writing to very large files, > 4 gigabytes.
a platform-independent way to acquire random numbers in a specific range.
An array of strings with some additional helpful methods.
#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.
const int KILOBYTE
Number of bytes in a kilobyte.
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.
Useful support functions for unit testing, especially within hoople.
#define ASSERT_EQUAL(a, b, test_name)
#define ASSERT_TRUE(a, test_name)