1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 22:20:39 +00:00

test: fix file-info test edge case (#2811)

This commit is contained in:
Charles Kerr 2022-03-24 19:03:15 -05:00 committed by GitHub
parent 6e8f9f3ff0
commit bd895b5052
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,7 +243,7 @@ TEST_F(FileTest, getInfo)
EXPECT_EQ(nullptr, err) << *err;
EXPECT_EQ(TR_SYS_PATH_IS_FILE, info.type);
EXPECT_EQ(4, info.size);
EXPECT_GT(info.last_modified_at, t - 1);
EXPECT_GE(info.last_modified_at, t - 1);
EXPECT_LE(info.last_modified_at, time(nullptr) + 1);
// Good file info (by handle)
@ -253,7 +253,7 @@ TEST_F(FileTest, getInfo)
EXPECT_EQ(nullptr, err) << *err;
EXPECT_EQ(TR_SYS_PATH_IS_FILE, info.type);
EXPECT_EQ(4, info.size);
EXPECT_GT(info.last_modified_at, t - 1);
EXPECT_GE(info.last_modified_at, t - 1);
EXPECT_LE(info.last_modified_at, time(nullptr) + 1);
tr_sys_file_close(fd, nullptr);