summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-04-09 14:40:23 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-04-09 14:40:23 +0100
commit652929b5905fd3764858615e073b280557e97d07 (patch)
treed28ba239f98bf05772b2517e8ec0aea2bf792766
parentFix warnings from files passed to tests (diff)
downloadnetfs-652929b5905fd3764858615e073b280557e97d07.tar.bz2
netfs-652929b5905fd3764858615e073b280557e97d07.tar.xz
netfs-652929b5905fd3764858615e073b280557e97d07.zip
Add more assertions around times
-rw-r--r--netfs/unittests/testCore.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp
index 2e82b32..5473d0f 100644
--- a/netfs/unittests/testCore.cpp
+++ b/netfs/unittests/testCore.cpp
@@ -339,15 +339,20 @@ BOOST_AUTO_TEST_CASE( utimens )
struct stat st;
memset(&st, 0, sizeof(st));
BOOST_REQUIRE_EQUAL(fuse->getattr("/file", &st), 0);
+ BOOST_REQUIRE_EQUAL(st.st_atime, 1);
BOOST_REQUIRE_EQUAL(st.st_atim.tv_sec, 1);
+ BOOST_REQUIRE_EQUAL(st.st_mtime, 2);
BOOST_REQUIRE_EQUAL(st.st_mtim.tv_sec, 2);
// Protocol discards nsec
BOOST_REQUIRE_EQUAL(st.st_atim.tv_nsec, 0);
BOOST_REQUIRE_EQUAL(st.st_mtim.tv_nsec, 0);
+ BOOST_REQUIRE_EQUAL(st.st_ctim.tv_nsec, 0);
// Real file doesn't
BOOST_REQUIRE_EQUAL(lstat((binDir / testExport / "file").c_str(), &st), 0);
BOOST_REQUIRE_EQUAL(st.st_atim.tv_sec, 1);
+ BOOST_REQUIRE_EQUAL(st.st_atime, 1);
BOOST_REQUIRE_EQUAL(st.st_mtim.tv_sec, 2);
+ BOOST_REQUIRE_EQUAL(st.st_mtime, 2);
BOOST_REQUIRE_EQUAL(st.st_atim.tv_nsec, 100);
BOOST_REQUIRE_EQUAL(st.st_mtim.tv_nsec, 200);
}