Skip to content

Commit

Permalink
#2256: tests: add sig figs to test
Browse files Browse the repository at this point in the history
  • Loading branch information
nlslatt committed Mar 25, 2024
1 parent 633c31e commit 9b31282
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/unit/timing/test_timing.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,37 +54,37 @@ using TestTiming = TestHarness;
TEST_F(TestTiming, test_time_formatting) {
{
TimeType const t = TimeType{15664645.400691890716};
EXPECT_EQ(fmt::format("{}", t), "15.7e6 s");
EXPECT_EQ(fmt::format("{}", t), "15.665e6 s");
}

{
TimeType const t = TimeType{4.0006918907165527344};
EXPECT_EQ(fmt::format("{}", t), "4.00e0 s");
EXPECT_EQ(fmt::format("{}", t), "4.0007e0 s");
}

{
TimeType const t = TimeType{0.0691890716552734423};
EXPECT_EQ(fmt::format("{}", t), "69.2e-3 s");
EXPECT_EQ(fmt::format("{}", t), "69.189e-3 s");
}

{
TimeType const t = TimeType{-0.0691890716552734423};
EXPECT_EQ(fmt::format("{}", t), "-69.2e-3 s");
EXPECT_EQ(fmt::format("{}", t), "-69.189e-3 s");
}

{
TimeType const t = TimeType{0.0006918907165527344};
EXPECT_EQ(fmt::format("{}", t), "692e-6 s");
EXPECT_EQ(fmt::format("{}", t), "691.89e-6 s");
}

{
TimeType const t = TimeType{0.0000006918907165527};
EXPECT_EQ(fmt::format("{}", t), "692e-9 s");
EXPECT_EQ(fmt::format("{}", t), "691.89e-9 s");
}

{
TimeType const t = TimeType{3.14};
EXPECT_EQ(fmt::format("{}", t), "3.14e0 s");
EXPECT_EQ(fmt::format("{}", t), "3.1400e0 s");
}
}

Expand Down

0 comments on commit 9b31282

Please sign in to comment.