eckit icon indicating copy to clipboard operation
eckit copied to clipboard

Nested SECTIONs in tests do not appear to work

Open fmahebert opened this issue 2 years ago • 2 comments

What happened?

The test case test_polygon uses nested SECTION scopes, and it appears that lines of code in inner SECTION scopes are not run. I think test_polygon may be the only eckit test using this nesting.

What are the steps to reproduce the bug?

  1. In file test_polygon.cc below line 240 (inside nested SECTION "Contains edge"), add new line of code EXPECT(false);. Expect test ctest -R eckit_test_geometry_polygon to fail, but it passes.
  2. To show expected behavior, move this new line of code to above line 240 (in outer SECTION "Simple rectangular polygon"). Expect test to fail, and it does.

Version

v1.20.2

Platform (OS and architecture)

macOS 12.6.4; intel i7

Relevant log output

No response

Accompanying data

No response

Organisation

No response

fmahebert avatar May 11 '23 21:05 fmahebert

@pmaciel do you have a fix for this in another branch?

wdeconinck avatar Jun 12 '24 07:06 wdeconinck

@pmaciel do you have a fix for this in another branch?

My fix for it was to flatten the hierarchy, ie remove the nested SECTIONs. The work I have isn't ready to be merged, so I suggest to flatten here as well?

pmaciel avatar Jun 12 '24 07:06 pmaciel

This should now be fixed. Thanks again for reporting.

wdeconinck avatar Mar 18 '25 10:03 wdeconinck