Commit 561bcda5 authored by Mike Kremer's avatar Mike Kremer
Browse files

Added unit tests on file reading and writing

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@37 66977474-1d4b-4f09-8fe9-267525286df2
parent b26a0ffb
This diff is collapsed.
......@@ -3,6 +3,7 @@
#include "unittests_common.hh"
#include "unittests_basics.hh"
#include "unittests_iterators.hh"
#include "unittests_files.hh"
int main(int _argc, char** _argv) {
......
#ifndef INCLUDE_UNITTESTS_FILES_HH
#define INCLUDE_UNITTESTS_FILES_HH
#include <gtest/gtest.h>
#include <Unittests/unittests_common.hh>
#include <OpenVolumeMesh/FileManager/FileManager.hh>
TEST_F(PolyhedralMeshBase, LoadFile) {
OpenVolumeMesh::IO::FileManager fileManager;
ASSERT_TRUE(fileManager.readFile("Cylinder.ovm", mesh_));
EXPECT_EQ(399u, mesh_.n_vertices());
EXPECT_EQ(1070u, mesh_.n_edges());
EXPECT_EQ(960u, mesh_.n_faces());
EXPECT_EQ(288u, mesh_.n_cells());
}
TEST_F(HexahedralMeshBase, LoadFile) {
OpenVolumeMesh::IO::FileManager fileManager;
ASSERT_TRUE(fileManager.isHexahedralMesh("Cylinder.ovm"));
ASSERT_TRUE(fileManager.readFile("Cylinder.ovm", mesh_));
EXPECT_EQ(399u, mesh_.n_vertices());
EXPECT_EQ(1070u, mesh_.n_edges());
EXPECT_EQ(960u, mesh_.n_faces());
EXPECT_EQ(288u, mesh_.n_cells());
}
#endif // INCLUDE GUARD
#ifndef INCLUDE_UNITTESTS_DECIMATER_HH
#define INCLUDE_UNITTESTS_DECIMATER_HH
#ifndef INCLUDE_UNITTESTS_ITERATORS_HH
#define INCLUDE_UNITTESTS_ITERATORS_HH
#include <gtest/gtest.h>
#include <Unittests/unittests_common.hh>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment