From cfd2fdb1601cbbf67d658677b1a12fb34578e068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 15 Jan 2019 16:13:05 +0100 Subject: [PATCH] Added unittest to check mesh type --- src/Unittests/unittests_mesh_type.cc | 67 ++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/Unittests/unittests_mesh_type.cc diff --git a/src/Unittests/unittests_mesh_type.cc b/src/Unittests/unittests_mesh_type.cc new file mode 100644 index 00000000..309567d0 --- /dev/null +++ b/src/Unittests/unittests_mesh_type.cc @@ -0,0 +1,67 @@ +#include + +#include + + +namespace { + + +class OpenMeshTypeTest_Poly : public OpenMeshBasePoly { + + protected: + + // This function is called before each test is run + virtual void SetUp() { + + // Do some initial stuff with the member data here... + } + + // This function is called after all tests are through + virtual void TearDown() { + + // Do some final stuff with the member data here... + } +}; + +class OpenMeshTypeTest_Triangle : public OpenMeshBase { + + protected: + + // This function is called before each test is run + virtual void SetUp() { + + // Do some initial stuff with the member data here... + } + + // This function is called after all tests are through + virtual void TearDown() { + + // Do some final stuff with the member data here... + } + +}; + + +/* + * ==================================================================== + * Define tests below + * ==================================================================== + */ + +TEST_F(OpenMeshTypeTest_Triangle, testTypeFunctions) { + + + EXPECT_TRUE(mesh_.is_trimesh()) << "Type Error!"; + EXPECT_FALSE(mesh_.is_polymesh()) << "Type Error!"; +} + + +TEST_F(OpenMeshTypeTest_Poly, testTypeFunctions) { + + + EXPECT_FALSE(mesh_.is_trimesh()) << "Type Error!"; + EXPECT_TRUE(mesh_.is_polymesh()) << "Type Error!"; +} + + +}