refactor tests
This commit is contained in:
@@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
#include "fixtures/drive_fixture.hpp"
|
#include "fixtures/drive_fixture.hpp"
|
||||||
|
|
||||||
namespace {
|
|
||||||
using repertory::utils::time::NANOS_PER_SECOND;
|
using repertory::utils::time::NANOS_PER_SECOND;
|
||||||
|
|
||||||
|
namespace {
|
||||||
void get_times_ns(const std::string &path, long long &at_ns, long long &mt_ns) {
|
void get_times_ns(const std::string &path, long long &at_ns, long long &mt_ns) {
|
||||||
struct stat st_unix{};
|
struct stat st_unix{};
|
||||||
ASSERT_EQ(0, ::stat(path.c_str(), &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__)
|
#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{
|
return timespec{
|
||||||
.tv_sec = sec,
|
.tv_sec = sec,
|
||||||
.tv_nsec = nsec,
|
.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 src = this->create_file_and_test(name);
|
||||||
|
|
||||||
auto spec = std::array<timespec, 2U>{
|
auto spec = std::array<timespec, 2U>{
|
||||||
ts_make(0, 1000000000L),
|
ts_make(0, static_cast<long long>(NANOS_PER_SECOND)),
|
||||||
ts_make(0, 0),
|
ts_make(0, 0),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ TYPED_TEST(fuse_test, futimens_invalid_nsec_returns_einval) {
|
|||||||
|
|
||||||
auto spec = std::array<timespec, 2U>{
|
auto spec = std::array<timespec, 2U>{
|
||||||
ts_make(0, 0),
|
ts_make(0, 0),
|
||||||
ts_make(0, 1000000000L),
|
ts_make(0, static_cast<long long>(NANOS_PER_SECOND)),
|
||||||
};
|
};
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
Reference in New Issue
Block a user