From 498c9da8604b393bd2d163935769fa8db46b870d Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Mon, 10 Sep 2018 13:11:00 -0700 Subject: [PATCH] Fix CI for osx --- src/cpp-utils/system/env.cpp | 1 + src/cpp-utils/system/filetime_nonwindows.cpp | 1 + test/cpp-utils/system/FiletimeTest.cpp | 6 +++++- test/cryfs/config/CryConfigLoaderTest.cpp | 5 +++-- test/fspp/fuse/lstat/FuseLstatReturnAtimeTest.cpp | 1 + test/fspp/fuse/lstat/FuseLstatReturnCtimeTest.cpp | 1 + test/fspp/fuse/lstat/FuseLstatReturnMtimeTest.cpp | 1 + test/fspp/fuse/statfs/FuseStatfsReturnBavailTest.cpp | 4 ++-- test/fspp/fuse/statfs/FuseStatfsReturnBfreeTest.cpp | 4 ++-- test/fspp/fuse/statfs/FuseStatfsReturnBlocksTest.cpp | 4 ++-- test/fspp/fuse/statfs/FuseStatfsReturnFfreeTest.cpp | 4 ++-- test/fspp/fuse/statfs/FuseStatfsReturnFilesTest.cpp | 4 ++-- 12 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/cpp-utils/system/env.cpp b/src/cpp-utils/system/env.cpp index 4776fff9..c10cf03a 100644 --- a/src/cpp-utils/system/env.cpp +++ b/src/cpp-utils/system/env.cpp @@ -2,6 +2,7 @@ #include #include +#include #if !defined(_MSC_VER) diff --git a/src/cpp-utils/system/filetime_nonwindows.cpp b/src/cpp-utils/system/filetime_nonwindows.cpp index f5b8cb7b..063fbd88 100644 --- a/src/cpp-utils/system/filetime_nonwindows.cpp +++ b/src/cpp-utils/system/filetime_nonwindows.cpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace cpputils { diff --git a/test/cpp-utils/system/FiletimeTest.cpp b/test/cpp-utils/system/FiletimeTest.cpp index 31908330..29d0d843 100644 --- a/test/cpp-utils/system/FiletimeTest.cpp +++ b/test/cpp-utils/system/FiletimeTest.cpp @@ -19,7 +19,11 @@ TEST(FiletimeTest, SetAndGetTime_ReturnsCorrectTime) { EXPECT_EQ(0, retval); EXPECT_EQ(accessTime.tv_sec, readAccessTime.tv_sec); - EXPECT_EQ(accessTime.tv_nsec, readAccessTime.tv_nsec); EXPECT_EQ(modificationTime.tv_sec, readModificationTime.tv_sec); + + // Apple unfortunately doesn't give us nanoseconds at all +#if !defined(__APPLE__) + EXPECT_EQ(accessTime.tv_nsec, readAccessTime.tv_nsec); EXPECT_EQ(modificationTime.tv_nsec, readModificationTime.tv_nsec); +#endif } diff --git a/test/cryfs/config/CryConfigLoaderTest.cpp b/test/cryfs/config/CryConfigLoaderTest.cpp index c66e8595..54657103 100644 --- a/test/cryfs/config/CryConfigLoaderTest.cpp +++ b/test/cryfs/config/CryConfigLoaderTest.cpp @@ -144,8 +144,9 @@ public: } string newerVersion() { - string newerVersion = gitversion::MajorVersion()+"."+std::to_string(std::stol(gitversion::MinorVersion())+1); - assert(gitversion::VersionCompare::isOlderThan(CryConfig::FilesystemFormatVersion, newerVersion)); + string newerVersion = gitversion::MajorVersion()+"."+std::to_string(std::stol(gitversion::MinorVersion())+2); + EXPECT_TRUE(gitversion::VersionCompare::isOlderThan(CryConfig::FilesystemFormatVersion, newerVersion)) + << "Format Version " << CryConfig::FilesystemFormatVersion << " should be older than Git Version " << newerVersion; return newerVersion; } diff --git a/test/fspp/fuse/lstat/FuseLstatReturnAtimeTest.cpp b/test/fspp/fuse/lstat/FuseLstatReturnAtimeTest.cpp index 7a057fab..c4ba5499 100644 --- a/test/fspp/fuse/lstat/FuseLstatReturnAtimeTest.cpp +++ b/test/fspp/fuse/lstat/FuseLstatReturnAtimeTest.cpp @@ -1,4 +1,5 @@ #include "testutils/FuseLstatReturnTest.h" +#include using ::testing::WithParamInterface; using ::testing::Values; diff --git a/test/fspp/fuse/lstat/FuseLstatReturnCtimeTest.cpp b/test/fspp/fuse/lstat/FuseLstatReturnCtimeTest.cpp index 670a1820..eaa4177b 100644 --- a/test/fspp/fuse/lstat/FuseLstatReturnCtimeTest.cpp +++ b/test/fspp/fuse/lstat/FuseLstatReturnCtimeTest.cpp @@ -1,4 +1,5 @@ #include "testutils/FuseLstatReturnTest.h" +#include using ::testing::WithParamInterface; using ::testing::Values; diff --git a/test/fspp/fuse/lstat/FuseLstatReturnMtimeTest.cpp b/test/fspp/fuse/lstat/FuseLstatReturnMtimeTest.cpp index a7a7c97b..a8a86102 100644 --- a/test/fspp/fuse/lstat/FuseLstatReturnMtimeTest.cpp +++ b/test/fspp/fuse/lstat/FuseLstatReturnMtimeTest.cpp @@ -1,4 +1,5 @@ #include "testutils/FuseLstatReturnTest.h" +#include using ::testing::WithParamInterface; using ::testing::Values; diff --git a/test/fspp/fuse/statfs/FuseStatfsReturnBavailTest.cpp b/test/fspp/fuse/statfs/FuseStatfsReturnBavailTest.cpp index 2e95a6a8..76ce39ea 100644 --- a/test/fspp/fuse/statfs/FuseStatfsReturnBavailTest.cpp +++ b/test/fspp/fuse/statfs/FuseStatfsReturnBavailTest.cpp @@ -3,9 +3,9 @@ using ::testing::WithParamInterface; using ::testing::Values; -class FuseStatfsReturnBavailTest: public FuseStatfsReturnTest, public WithParamInterface { +class FuseStatfsReturnBavailTest: public FuseStatfsReturnTest, public WithParamInterface { private: - void set(struct ::statvfs *stat, fsblkcnt64_t value) override { + void set(struct ::statvfs *stat, uint64_t value) override { stat->f_bavail = value; } }; diff --git a/test/fspp/fuse/statfs/FuseStatfsReturnBfreeTest.cpp b/test/fspp/fuse/statfs/FuseStatfsReturnBfreeTest.cpp index bfcdf090..e7473e96 100644 --- a/test/fspp/fuse/statfs/FuseStatfsReturnBfreeTest.cpp +++ b/test/fspp/fuse/statfs/FuseStatfsReturnBfreeTest.cpp @@ -3,9 +3,9 @@ using ::testing::WithParamInterface; using ::testing::Values; -class FuseStatfsReturnBfreeTest: public FuseStatfsReturnTest, public WithParamInterface { +class FuseStatfsReturnBfreeTest: public FuseStatfsReturnTest, public WithParamInterface { private: - void set(struct ::statvfs *stat, fsblkcnt64_t value) override { + void set(struct ::statvfs *stat, uint64_t value) override { stat->f_bfree = value; } }; diff --git a/test/fspp/fuse/statfs/FuseStatfsReturnBlocksTest.cpp b/test/fspp/fuse/statfs/FuseStatfsReturnBlocksTest.cpp index 1246399a..e8dcecca 100644 --- a/test/fspp/fuse/statfs/FuseStatfsReturnBlocksTest.cpp +++ b/test/fspp/fuse/statfs/FuseStatfsReturnBlocksTest.cpp @@ -3,9 +3,9 @@ using ::testing::WithParamInterface; using ::testing::Values; -class FuseStatfsReturnBlocksTest: public FuseStatfsReturnTest, public WithParamInterface { +class FuseStatfsReturnBlocksTest: public FuseStatfsReturnTest, public WithParamInterface { private: - void set(struct ::statvfs *stat, fsblkcnt64_t value) override { + void set(struct ::statvfs *stat, uint64_t value) override { stat->f_blocks = value; } }; diff --git a/test/fspp/fuse/statfs/FuseStatfsReturnFfreeTest.cpp b/test/fspp/fuse/statfs/FuseStatfsReturnFfreeTest.cpp index ecb720f3..3819e241 100644 --- a/test/fspp/fuse/statfs/FuseStatfsReturnFfreeTest.cpp +++ b/test/fspp/fuse/statfs/FuseStatfsReturnFfreeTest.cpp @@ -3,9 +3,9 @@ using ::testing::WithParamInterface; using ::testing::Values; -class FuseStatfsReturnFfreeTest: public FuseStatfsReturnTest, public WithParamInterface { +class FuseStatfsReturnFfreeTest: public FuseStatfsReturnTest, public WithParamInterface { private: - void set(struct ::statvfs *stat, fsfilcnt64_t value) override { + void set(struct ::statvfs *stat, uint64_t value) override { stat->f_ffree = value; } }; diff --git a/test/fspp/fuse/statfs/FuseStatfsReturnFilesTest.cpp b/test/fspp/fuse/statfs/FuseStatfsReturnFilesTest.cpp index b84dcb7a..344f2483 100644 --- a/test/fspp/fuse/statfs/FuseStatfsReturnFilesTest.cpp +++ b/test/fspp/fuse/statfs/FuseStatfsReturnFilesTest.cpp @@ -3,9 +3,9 @@ using ::testing::WithParamInterface; using ::testing::Values; -class FuseStatfsReturnFilesTest: public FuseStatfsReturnTest, public WithParamInterface { +class FuseStatfsReturnFilesTest: public FuseStatfsReturnTest, public WithParamInterface { private: - void set(struct ::statvfs *stat, fsfilcnt64_t value) override { + void set(struct ::statvfs *stat, uint64_t value) override { stat->f_files = value; } };