Fixed Timestamp tests compilation error on linux

This commit is contained in:
Vladyslav Baranovskyi
2024-10-08 20:46:39 +03:00
parent bd1180d15a
commit 0def449d13

View File

@@ -16,7 +16,7 @@ TEST_CASE("Constructors", "[Timestamp]")
REQUIRE(ts.GetNanos() == 0); REQUIRE(ts.GetNanos() == 0);
REQUIRE(ts.GetSeconds() == 0.0); REQUIRE(ts.GetSeconds() == 0.0);
ts = Timestamp(1'000'000'000ull); // 1 second ts = Timestamp((uint64_t)1'000'000'000ull); // 1 second
REQUIRE(ts.GetNanos() == 1'000'000'000ull); REQUIRE(ts.GetNanos() == 1'000'000'000ull);
REQUIRE(ts.GetSeconds() == 1.0); REQUIRE(ts.GetSeconds() == 1.0);
@@ -27,8 +27,8 @@ TEST_CASE("Constructors", "[Timestamp]")
TEST_CASE("Arithmetic operations", "[Timestamp]") TEST_CASE("Arithmetic operations", "[Timestamp]")
{ {
Timestamp ts1(1'000'000'000ull); // 1 second Timestamp ts1((uint64_t)1'000'000'000ull); // 1 second
Timestamp ts2(2'000'000'000ull); // 2 seconds Timestamp ts2((uint64_t)2'000'000'000ull); // 2 seconds
Timestamp result; Timestamp result;
result = ts1 + ts2; result = ts1 + ts2;
@@ -47,9 +47,9 @@ TEST_CASE("Arithmetic operations", "[Timestamp]")
TEST_CASE("Comparison operators", "[Timestamp]") TEST_CASE("Comparison operators", "[Timestamp]")
{ {
Timestamp ts1(1'000'000'000ull); // 1 second Timestamp ts1((uint64_t)1'000'000'000ull); // 1 second
Timestamp ts2(2'000'000'000ull); // 2 seconds Timestamp ts2((uint64_t)2'000'000'000ull); // 2 seconds
Timestamp ts3(1'000'000'000ull); Timestamp ts3((uint64_t)1'000'000'000ull);
REQUIRE(ts1 == ts3); REQUIRE(ts1 == ts3);
REQUIRE(ts1 != ts2); REQUIRE(ts1 != ts2);
@@ -62,7 +62,7 @@ TEST_CASE("Comparison operators", "[Timestamp]")
TEST_CASE("Assignment operators", "[Timestamp]") TEST_CASE("Assignment operators", "[Timestamp]")
{ {
Timestamp ts; Timestamp ts;
ts = 1'000'000'000ull; ts = (uint64_t)1'000'000'000ull;
REQUIRE(ts.GetNanos() == 1'000'000'000ull); REQUIRE(ts.GetNanos() == 1'000'000'000ull);
ts = 2.0; ts = 2.0;