diff options
author | Pixel <pixel@nobis-crew.org> | 2011-10-10 20:31:41 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-10-10 20:31:41 -0700 |
commit | 8ae349b49e16064e4d84b6cfd256e3ca7fb0cd60 (patch) | |
tree | 8b01b3ab2097d838771d43c79b92920661ffd37c /tests | |
parent | 965148b43b5b859934b7af2e8447ba1026a43a19 (diff) |
Adding the 'stats' call to Input.
Also fixing a bug with the Printer - va_args are vicious.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-Handles.cc | 10 | ||||
-rw-r--r-- | tests/test-Sanity.cc | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/test-Handles.cc b/tests/test-Handles.cc index 38b020b..68d8baa 100644 --- a/tests/test-Handles.cc +++ b/tests/test-Handles.cc @@ -17,6 +17,14 @@ void MainTask::Do() { } Assert(failed); IO i(new Input("Makefile")); - + Printer::log(M_STATUS, "Opened file %s:", i->getName()); + Printer::log(M_STATUS, " - size = %lli", i->getSize()); + char mtimestr[32]; + time_t mtime = i->getMTime(); + ctime_r(&mtime, mtimestr); + char * nl = strrchr(mtimestr, '\n'); + if (nl) + *nl = 0; + Printer::log(M_STATUS, " - mtime = %i (%s)", mtime, mtimestr); Printer::log(M_STATUS, "Test::Handles passed."); } diff --git a/tests/test-Sanity.cc b/tests/test-Sanity.cc index 54fa626..9ed9b4e 100644 --- a/tests/test-Sanity.cc +++ b/tests/test-Sanity.cc @@ -9,6 +9,7 @@ void MainTask::Do() { Assert(sizeof(off_t) == 8); Assert(sizeof(size_t) == 4); + Assert(sizeof(time_t) == 4); Printer::log(M_STATUS, "Test::Sanity passed."); } |