From dc26b6a7dd012bd85fb8e8db874c24ec71bf8038 Mon Sep 17 00:00:00 2001 From: Huamonarch Date: Fri, 15 May 2026 15:40:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=86=20enum=20class=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=9A=84=20CHECK=5FEQ=20=E6=94=B9=E4=B8=BA=20CHECK(?= =?UTF-8?q?=3D=3D)=EF=BC=8C=E9=81=BF=E5=85=8D=20ostream<<=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eqpalg/test/test_algorithms.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eqpalg/test/test_algorithms.cc b/eqpalg/test/test_algorithms.cc index e834a61..b7cd01b 100644 --- a/eqpalg/test/test_algorithms.cc +++ b/eqpalg/test/test_algorithms.cc @@ -268,7 +268,7 @@ TEST(bound_checker_detects_out_of_lower) { TEST(bound_checker_only_right_mode_sentinel) { BoundChecker bc; bc.setLimits(-32768.0, 100.0); // -32768 = no lower bound - CHECK_EQ(bc.detectMode(), DetectMode::OnlyRight); + CHECK(bc.detectMode() == DetectMode::OnlyRight); CHECK_EQ(bc.isOutOfBounds(-999.0), false); // below lower is OK CHECK_EQ(bc.isOutOfBounds(150.0), true); // above upper triggers } @@ -276,7 +276,7 @@ TEST(bound_checker_only_right_mode_sentinel) { TEST(bound_checker_only_left_mode_sentinel) { BoundChecker bc; bc.setLimits(10.0, 32767.0); // 32767 = no upper bound - CHECK_EQ(bc.detectMode(), DetectMode::OnlyLeft); + CHECK(bc.detectMode() == DetectMode::OnlyLeft); CHECK_EQ(bc.isOutOfBounds(5.0), true); // below lower triggers CHECK_EQ(bc.isOutOfBounds(999.0), false); // above upper is OK (sentinel) } @@ -284,7 +284,7 @@ TEST(bound_checker_only_left_mode_sentinel) { TEST(bound_checker_only_left_mode_sentinel_32768) { BoundChecker bc; bc.setLimits(10.0, 32768.0); // 32768 also = no upper bound - CHECK_EQ(bc.detectMode(), DetectMode::OnlyLeft); + CHECK(bc.detectMode() == DetectMode::OnlyLeft); CHECK_EQ(bc.isOutOfBounds(5.0), true); CHECK_EQ(bc.isOutOfBounds(999.0), false); } @@ -292,7 +292,7 @@ TEST(bound_checker_only_left_mode_sentinel_32768) { TEST(bound_checker_default_bilateral) { BoundChecker bc; bc.setLimits(10.0, 20.0); - CHECK_EQ(bc.detectMode(), DetectMode::Default); + CHECK(bc.detectMode() == DetectMode::Default); CHECK_EQ(bc.isOutOfBounds(5.0), true); CHECK_EQ(bc.isOutOfBounds(15.0), false); CHECK_EQ(bc.isOutOfBounds(25.0), true); @@ -301,7 +301,7 @@ TEST(bound_checker_default_bilateral) { TEST(bound_checker_error_mode) { BoundChecker bc; bc.setLimits(-32768.0, -32768.0); // both sentinels - CHECK_EQ(bc.detectMode(), DetectMode::ErrorMode); + CHECK(bc.detectMode() == DetectMode::ErrorMode); CHECK_EQ(bc.isOutOfBounds(50.0), false); // error mode: never alarm } @@ -340,11 +340,11 @@ TEST(bound_checker_isValid) { TEST(bound_checker_setDetectMode_override) { BoundChecker bc; bc.setLimits(-32768.0, 100.0); - CHECK_EQ(bc.detectMode(), DetectMode::OnlyRight); + CHECK(bc.detectMode() == DetectMode::OnlyRight); // manual override to Default bc.setDetectMode(DetectMode::Default); - CHECK_EQ(bc.detectMode(), DetectMode::Default); + CHECK(bc.detectMode() == DetectMode::Default); // now both sides checked with sentinel values → out of lower triggers CHECK_EQ(bc.isOutOfBounds(-999.0), true); }