From 8ae349b49e16064e4d84b6cfd256e3ca7fb0cd60 Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 10 Oct 2011 20:31:41 -0700 Subject: Adding the 'stats' call to Input. Also fixing a bug with the Printer - va_args are vicious. --- tests/test-Handles.cc | 10 +++++++++- tests/test-Sanity.cc | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') 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."); } -- cgit v1.2.3