Skip to content

Commit

Permalink
ENH: Check GTest test method return value
Browse files Browse the repository at this point in the history
Check GTest test method return value.

GTest ignores return values from test methods, hence, the return values
of the methods that are being called would be similarly ignored if such
methods are intended to provide the return value of a test. This commit
saves the return values of the called methods, and compares them to a
successful test outcome value.
  • Loading branch information
jhlegarreta authored and N-Dekker committed Mar 9, 2022
1 parent 3f783a8 commit bb9d3c3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ TestBasicObjectProperties()

TEST(SumOfSquaresImageFunction, BasicObjectProperties)
{
TestBasicObjectProperties<itk::Image<double, 2>>();
TestBasicObjectProperties<itk::Image<unsigned char, 3>>();
int testStatus = TestBasicObjectProperties<itk::Image<double, 2>>();
EXPECT_EQ(testStatus, EXIT_SUCCESS);

testStatus = TestBasicObjectProperties<itk::Image<unsigned char, 3>>();
EXPECT_EQ(testStatus, EXIT_SUCCESS);
}


Expand Down

0 comments on commit bb9d3c3

Please sign in to comment.