Skip to content

Commit

Permalink
Forgot to handle the rev case when I removed it as a param
Browse files Browse the repository at this point in the history
Note: in the regular usage, we do nothing is visible is false, and we pass copies into the CLIPLINE method anyways, so there's no point reversing it back
  • Loading branch information
jmarrec committed Aug 12, 2024
1 parent 251ea56 commit 955463a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tst/EnergyPlus/unit/SolarShading.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6266,6 +6266,7 @@ TEST_F(EnergyPlusFixture, CLIPLINE_Full)

Real64 x1 = t.line_ori.p1.x;
Real64 y1 = t.line_ori.p1.y;
bool is_rev = x0 > x1;

std::string const msg = fmt::format("From ({}, {}) to ({}, {})", t.line_ori.p0.x, t.line_ori.p0.y, t.line_ori.p1.x, t.line_ori.p1.y);

Expand All @@ -6279,6 +6280,10 @@ TEST_F(EnergyPlusFixture, CLIPLINE_Full)
EXPECT_DOUBLE_EQ(t.line_new.p1.y, y1) << msg;
} else {
EXPECT_FALSE(visible) << msg;
if (is_rev) {
std::swap(x0, x1);
std::swap(y0, y1);
}
EXPECT_DOUBLE_EQ(t.line_ori.p0.x, x0) << msg;
EXPECT_DOUBLE_EQ(t.line_ori.p0.y, y0) << msg;
EXPECT_DOUBLE_EQ(t.line_ori.p1.x, x1) << msg;
Expand Down

5 comments on commit 955463a

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10656_CLIPLINE (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3697 of 3697 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10656_CLIPLINE (jmarrec) - x86_64-MacOS-10.18-clang-15.0.0: OK (3656 of 3656 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10656_CLIPLINE (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2072 of 2072 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10656_CLIPLINE (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (795 of 795 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10656_CLIPLINE (jmarrec) - Win64-Windows-10-VisualStudio-16: OK (2864 of 2864 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.