Developer Documentation

unittests_common.hh
1 #ifndef INCLUDE_UNITTESTS_COMMON_HH
2 #define INCLUDE_UNITTESTS_COMMON_HH
3
4 #include <gtest/gtest.h>
5 #include <OpenMesh/Core/IO/MeshIO.hh>
6
7 #include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
8 #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
9
10 #ifdef TEST_CUSTOM_TRAITS
11 #include <Unittests/unittests_common_customtraits.hh>
12 #elif defined(TEST_DOUBLE_TRAITS)
13 struct CustomTraits : public OpenMesh::DefaultTraitsDouble {
14 };
15 #else
16 struct CustomTraits : public OpenMesh::DefaultTraits {
17 };
18 #endif
19
20
21 typedef OpenMesh::TriMesh_ArrayKernelT<CustomTraits> Mesh;
22
23 typedef OpenMesh::PolyMesh_ArrayKernelT<CustomTraits> PolyMesh;
24
25 /*
26 * Simple test setting.
27 */
28
29 class OpenMeshBase : public testing::Test {
30
31 protected:
32
33 // This function is called before each test is run
34 virtual void SetUp() {
35
36 // Do some initial stuff with the member data here...
37 }
38
39 // This function is called after all tests are through
40 virtual void TearDown() {
41
42 // Do some final stuff with the member data here...
43 }
44
45 // This member will be accessible in all tests
46 Mesh mesh_;
47 };
48
49 /*
50 * Simple test setting.
51 */
52
53 class OpenMeshBasePoly : public testing::Test {
54
55 protected:
56
57 // This function is called before each test is run
58 virtual void SetUp() {
59
60 // Do some initial stuff with the member data here...
61 }
62
63 // This function is called after all tests are through
64 virtual void TearDown() {
65
66 // Do some final stuff with the member data here...
67 }
68
69 // This member will be accessible in all tests
70 PolyMesh mesh_;
71 };
72
73
74
75 #endif // INCLUDE GUARD
OpenMesh::TriMesh_ArrayKernelT< CustomTraits >
OpenMesh::PolyMesh_ArrayKernelT
Definition: PolyMesh_ArrayKernelT.hh:94
OpenMeshBasePoly
Definition: unittests_common.hh:53
OpenMeshBase
Definition: unittests_common.hh:29
CustomTraits
Definition: BSP_test.cc:49
OpenMesh::DefaultTraits
Definition: Traits.hh:121
PolyMesh
OpenMesh::PolyMesh PolyMesh
Simple Name for Mesh.
Definition: PolyMeshTypes.hh:73
OpenMesh::DefaultTraitsDouble
Definition: Traits.hh:163