From 52e673a9eee38ace5a49ebc0e23d8742388bac82 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 20 Sep 2025 16:39:18 -0500 Subject: [PATCH] refactor tests --- .../src/fuse_drive_utimens_futimens_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repertory/repertory_test/src/fuse_drive_utimens_futimens_test.cpp b/repertory/repertory_test/src/fuse_drive_utimens_futimens_test.cpp index 20c37a9e..063ef0ad 100644 --- a/repertory/repertory_test/src/fuse_drive_utimens_futimens_test.cpp +++ b/repertory/repertory_test/src/fuse_drive_utimens_futimens_test.cpp @@ -23,9 +23,9 @@ #include "fixtures/drive_fixture.hpp" -namespace { using repertory::utils::time::NANOS_PER_SECOND; +namespace { void get_times_ns(const std::string &path, long long &at_ns, long long &mt_ns) { struct stat st_unix{}; ASSERT_EQ(0, ::stat(path.c_str(), &st_unix)); @@ -47,7 +47,7 @@ void get_times_ns(const std::string &path, long long &at_ns, long long &mt_ns) { #endif // defined(__APPLE__) } -[[nodiscard]] auto ts_make(time_t sec, long nsec) -> timespec { +[[nodiscard]] auto ts_make(time_t sec, long long nsec) -> timespec { return timespec{ .tv_sec = sec, .tv_nsec = nsec, @@ -226,7 +226,7 @@ TYPED_TEST(fuse_test, utimens_invalid_nsec_returns_einval) { auto src = this->create_file_and_test(name); auto spec = std::array{ - ts_make(0, 1000000000L), + ts_make(0, static_cast(NANOS_PER_SECOND)), ts_make(0, 0), }; @@ -318,7 +318,7 @@ TYPED_TEST(fuse_test, futimens_invalid_nsec_returns_einval) { auto spec = std::array{ ts_make(0, 0), - ts_make(0, 1000000000L), + ts_make(0, static_cast(NANOS_PER_SECOND)), }; errno = 0;