Skip to content

Commit

Permalink
Fix SumOptFloat test to use epsilon for comparing doubles
Browse files Browse the repository at this point in the history
  • Loading branch information
trokhymchuk committed Jun 27, 2023
1 parent e8cfd91 commit 6403a27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/AppTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <complex>
#include <cstdint>
#include <cstdlib>
#include <limits>

TEST_CASE_METHOD(TApp, "OneFlagShort", "[app]") {
app.add_flag("-c,--count");
Expand Down Expand Up @@ -828,7 +829,7 @@ TEST_CASE_METHOD(TApp, "SumOptFloat", "[app]") {

run();

CHECK(0.6 == val);
CHECK(std::fabs(0.6 - val) <= std::numeric_limits<double>::epsilon());
}

TEST_CASE_METHOD(TApp, "SumOptString", "[app]") {
Expand Down

0 comments on commit 6403a27

Please sign in to comment.