Skip to content

Commit 30329d3

Browse files
Now uses CHECK(Approx) instead of REQUIRE throughout the windowing unit test.
1 parent c700751 commit 30329d3

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

UnitTests/SU2_CFD/windowing.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,41 +73,31 @@ struct CWindowingTest {
7373
TEST_CASE("BUMP", "[Windowing]") {
7474
su2double avg = 0;
7575
avg = CWindowingTest::calcAverage(WINDOW_FUNCTION::BUMP, 10, 0);
76-
CHECK(avg == Approx(1.1851));
76+
CHECK(avg == Approx(1.1851).epsilon(0.001));
7777
avg = CWindowingTest::calcAverage(WINDOW_FUNCTION::BUMP, 100, 10);
78-
REQUIRE(avg > 1.1882);
79-
REQUIRE(avg < 1.1884);
78+
CHECK(avg == Approx(1.1883).epsilon(0.001));
8079
}
8180

8281
TEST_CASE("HANN", "[Windowing]") {
8382
su2double avg = 0;
8483
avg = CWindowingTest::calcAverage(WINDOW_FUNCTION::HANN, 10, 0);
85-
REQUIRE(avg > 1.1831);
86-
REQUIRE(avg < 1.1833);
84+
CHECK(avg == Approx(1.1832).epsilon(0.001));
8785
avg = CWindowingTest::calcAverage(WINDOW_FUNCTION::HANN, 100, 10);
88-
REQUIRE(avg > 1.0868);
89-
REQUIRE(avg < 1.0870);
90-
86+
CHECK(avg == Approx(1.0869).epsilon(0.001));
9187
}
9288

9389
TEST_CASE("HANN_SQUARE", "[Windowing]") {
9490
su2double avg = 0;
9591
avg = CWindowingTest::calcAverage(WINDOW_FUNCTION::HANN_SQUARE, 10, 0);
96-
REQUIRE(avg > 1.1846);
97-
REQUIRE(avg < 1.1848);
92+
CHECK(avg == Approx(1.1847).epsilon(0.001));
9893
avg = CWindowingTest::calcAverage(WINDOW_FUNCTION::HANN_SQUARE, 100, 10);
99-
REQUIRE(avg > 1.1855);
100-
REQUIRE(avg < 1.1857);
101-
94+
CHECK(avg == Approx(1.1856).epsilon(0.001));
10295
}
10396

10497
TEST_CASE("SQUARE", "[Windowing]") {
10598
su2double avg = 0;
10699
avg = CWindowingTest::calcAverage(WINDOW_FUNCTION::SQUARE, 10, 0);
107-
REQUIRE(avg > 1.3058);
108-
REQUIRE(avg < 1.3060);
100+
CHECK(avg == Approx(1.3059).epsilon(0.001));
109101
avg = CWindowingTest::calcAverage(WINDOW_FUNCTION::SQUARE, 100, 10);
110-
REQUIRE(avg > 0.9000);
111-
REQUIRE(avg < 0.9002);
112-
102+
CHECK(avg == Approx(0.9001).epsilon(0.001));
113103
}

0 commit comments

Comments
 (0)