Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
unittests_stripifier.cc
1 
2 #include <gtest/gtest.h>
3 #include <Unittests/unittests_common.hh>
4 #include <OpenMesh/Tools/Utils/StripifierT.hh>
5 
6 namespace {
7 
8 class OpenMeshStripify : public OpenMeshBase {
9 
10  protected:
11 
12  // This function is called before each test is run
13  virtual void SetUp() {
14 
15  // Do some initial stuff with the member data here...
16  }
17 
18  // This function is called after all tests are through
19  virtual void TearDown() {
20 
21  // Do some final stuff with the member data here...
22  }
23 
24  // Member already defined in OpenMeshBase
25  //Mesh mesh_;
26 };
27 
28 /*
29  * ====================================================================
30  * Define tests below
31  * ====================================================================
32  */
33 
34 /*
35  */
36 TEST_F(OpenMeshStripify, Stripify) {
37 
38  bool ok = OpenMesh::IO::read_mesh(mesh_, "cube1.off");
39 
40  ASSERT_TRUE(ok);
41 
42  OpenMesh::StripifierT<Mesh> stripifier(mesh_);
43 
44  size_t strips = stripifier.stripify();
45 
46  EXPECT_EQ(1269u, strips) << "The number of computed strips is not correct!";
47  EXPECT_TRUE(stripifier.is_valid()) << "Strips not computed!";
48 
49 }
50 }
bool read_mesh(Mesh &_mesh, const std::string &_filename)
Read a mesh from file _filename.
Definition: MeshIO.hh:104