test(tests): updated tests to use fractional checks

tests for eos and approx8 now use relative error to account for large dynamic range
This commit is contained in:
2025-06-17 10:17:46 -04:00
parent 8269c35405
commit 31e0a4bdd4
3 changed files with 7 additions and 5 deletions

View File

@@ -123,6 +123,8 @@ TEST_F(eosTest, eos_using_composition) {
serif::eos::EOSOutput eosOutput;
EXPECT_NO_THROW(eosOutput = EOS.get(eosInput));
eosOutput = EOS.get(eosInput);
constexpr double absErr = 1e-8;
EXPECT_NEAR(eosOutput.pressure.total, 6.9548533046915791E+22, absErr);
const double pressureFraction = eosOutput.pressure.total / 6.9548533046915791E+22;
constexpr double relError = 1e-6;
EXPECT_NEAR(pressureFraction, 1.0, relError);
}