From 93f34a4557f5fc8a98322009222e9d16742a4d85 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 7 Jun 2016 12:48:21 -0700 Subject: [PATCH] Run FsppDeviceTest_Timestamps on all kinds of nodes, not just files --- src/fspp/fstest/FsppDeviceTest_Timestamps.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/fspp/fstest/FsppDeviceTest_Timestamps.h b/src/fspp/fstest/FsppDeviceTest_Timestamps.h index 4d6bf744..21329945 100644 --- a/src/fspp/fstest/FsppDeviceTest_Timestamps.h +++ b/src/fspp/fstest/FsppDeviceTest_Timestamps.h @@ -8,26 +8,27 @@ template class FsppDeviceTest_Timestamps: public FsppNodeTest, public TimestampTestUtils { public: void Test_Load_While_Loaded() { - auto file = this->CreateFile("/myfile"); - auto operation = [this, &file] () { - this->device->Load("/myfile"); + auto node = this->CreateNode("/mynode"); + auto operation = [this, &node] () { + this->device->Load("/mynode"); }; - this->EXPECT_OPERATION_DOESNT_UPDATE_TIMESTAMPS(*file, operation); + this->EXPECT_OPERATION_DOESNT_UPDATE_TIMESTAMPS(*node, operation); } void Test_Load_While_Not_Loaded() { struct stat oldStat; { - auto file = this->CreateFile("/myfile"); - oldStat = stat(*file); - this->ensureNodeTimestampsAreOld(*file); + auto node = this->CreateNode("/mynode"); + oldStat = stat(*node); + this->ensureNodeTimestampsAreOld(*node); } this->device->Load("/myfile"); - auto file = this->device->Load("/myfile"); + auto node = this->device->Load("/mynode"); - struct stat newStat = stat(*file.value()); + //Test that timestamps didn't change + struct stat newStat = stat(*node.value()); EXPECT_EQ(oldStat.st_atim, newStat.st_atim); EXPECT_EQ(oldStat.st_mtim, newStat.st_mtim); EXPECT_EQ(oldStat.st_ctim, newStat.st_ctim);