Skip to content

Commit

Permalink
Fix operator precedence warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Jun 29, 2024
1 parent 9002f4e commit 5ec7832
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions tests/test_coding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ TEST_CASE("encode decode float fields")
bool ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -265,7 +265,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -274,7 +274,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -283,7 +283,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -292,7 +292,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -301,7 +301,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -310,7 +310,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -319,7 +319,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -328,7 +328,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -337,7 +337,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -346,7 +346,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -355,7 +355,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
// Doesn't work for extremely small negative floats.
// CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);
Expand All @@ -365,7 +365,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
// Doesn't work for extremely small negative floats.
// CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);
Expand All @@ -375,7 +375,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);

Expand All @@ -384,7 +384,7 @@ TEST_CASE("encode decode float fields")
ok = jatm2.from_bytes(vec);
CHECK(ok);

REQUIRE(jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR()));
REQUIRE((jatm1.some_floatVAR() == doctest::Approx(jatm2.some_floatVAR())));
CHECK(Float(jatm1.some_floatVAR()).AlmostEquals(Float(jatm2.some_floatVAR())));
CHECK_EQ(jatm1, jatm2);
}
Expand Down

0 comments on commit 5ec7832

Please sign in to comment.