Skip to content

Commit

Permalink
STYLE: Use ITK_TEST_EXPECT_EQUAL to compare class names in QEMesh
Browse files Browse the repository at this point in the history
Prefer using `ITK_TEST_EXPECT_EQUAL` to compare class names in
`QuadEdgeMesh` tests.
  • Loading branch information
jhlegarreta authored and hjmjohnson committed Apr 14, 2024
1 parent a895d7f commit 781cf0d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "itkQuadEdgeMeshEulerOperatorDeleteCenterVertexFunction.h"
#include "itkQuadEdgeMeshEulerOperatorCreateCenterVertexFunction.h"
#include "itkQuadEdgeMeshEulerOperatorsTestHelper.h"
#include "itkTestingMacros.h"

int
itkQuadEdgeMeshEulerOperatorDeleteCenterVertexTest(int argc, char * argv[])
Expand Down Expand Up @@ -82,13 +83,8 @@ itkQuadEdgeMeshEulerOperatorDeleteCenterVertexTest(int argc, char * argv[])
}
std::cout << "OK" << std::endl;

const std::string className = deleteCenterVertex->GetNameOfClass();
const std::string requiredClassName{ "QuadEdgeMeshEulerOperatorDeleteCenterVertexFunction" };
if (className != requiredClassName)
{
std::cout << className << " != " << requiredClassName << std::endl;
return EXIT_FAILURE;
}
ITK_TEST_EXPECT_EQUAL((const std::string) "QuadEdgeMeshEulerOperatorDeleteCenterVertexFunction",
(const std::string)deleteCenterVertex->GetNameOfClass());

deleteCenterVertex->SetInput(mesh);
std::cout << " "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,9 @@ itkQuadEdgeMeshEulerOperatorJoinFacetTest(int, char *[])
std::cout << "OK" << std::endl;
#endif

const std::string className = joinFacet->GetNameOfClass();
const std::string requiredClassName{ "QuadEdgeMeshEulerOperatorJoinFacetFunction" };
if (className != requiredClassName)
{
std::cout << className << " != " << requiredClassName << std::endl;
return EXIT_FAILURE;
}
ITK_TEST_EXPECT_EQUAL((const std::string) "QuadEdgeMeshEulerOperatorJoinFacetFunction",
(const std::string)joinFacet->GetNameOfClass());

joinFacet->SetInput(mesh);

#ifndef NDEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,8 @@ itkQuadEdgeMeshEulerOperatorJoinVertexTest(int argc, char * argv[])
std::cout << "OK" << std::endl;
#endif

const std::string className = joinVertex->GetNameOfClass();
const std::string requiredClassName{ "QuadEdgeMeshEulerOperatorJoinVertexFunction" };
if (className != requiredClassName)
{
std::cout << className << " != " << requiredClassName << std::endl;
return EXIT_FAILURE;
}
ITK_TEST_EXPECT_EQUAL((const std::string) "QuadEdgeMeshEulerOperatorJoinVertexFunction",
(const std::string)joinVertex->GetNameOfClass());

joinVertex->SetInput(mesh);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "itkQuadEdgeMeshEulerOperatorSplitEdgeFunction.h"
#include "itkQuadEdgeMeshEulerOperatorsTestHelper.h"
#include "itkTestingMacros.h"

int
itkQuadEdgeMeshEulerOperatorSplitEdgeTest(int, char *[])
Expand Down Expand Up @@ -48,13 +49,9 @@ itkQuadEdgeMeshEulerOperatorSplitEdgeTest(int, char *[])
}
std::cout << "OK" << std::endl;

const std::string className = splitEdge->GetNameOfClass();
const std::string requiredClassName{ "QuadEdgeMeshEulerOperatorSplitEdgeFunction" };
if (className != requiredClassName)
{
std::cout << className << " != " << requiredClassName << std::endl;
return EXIT_FAILURE;
}
ITK_TEST_EXPECT_EQUAL((const std::string) "QuadEdgeMeshEulerOperatorSplitEdgeFunction",
(const std::string)splitEdge->GetNameOfClass());

splitEdge->SetInput(mesh);
std::cout << " "
<< "Test No QE Input";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "itkQuadEdgeMeshEulerOperatorSplitVertexFunction.h"
#include "itkQuadEdgeMeshEulerOperatorJoinVertexFunction.h"
#include "itkQuadEdgeMeshEulerOperatorsTestHelper.h"
#include "itkTestingMacros.h"

int
itkQuadEdgeMeshEulerOperatorSplitVertexTest(int, char *[])
Expand Down Expand Up @@ -51,13 +52,8 @@ itkQuadEdgeMeshEulerOperatorSplitVertexTest(int, char *[])
}
std::cout << "OK" << std::endl;

const std::string className = splitVertex->GetNameOfClass();
const std::string requiredClassName{ "QuadEdgeMeshEulerOperatorSplitVertexFunction" };
if (className != requiredClassName)
{
std::cout << className << " != " << requiredClassName << std::endl;
return EXIT_FAILURE;
}
ITK_TEST_EXPECT_EQUAL((const std::string) "QuadEdgeMeshEulerOperatorSplitVertexFunction",
(const std::string)splitVertex->GetNameOfClass());

splitVertex->SetInput(mesh);
std::cout << " "
Expand Down

0 comments on commit 781cf0d

Please sign in to comment.