Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenMesh
OpenMesh
Commits
c1ac62b9
Commit
c1ac62b9
authored
Oct 23, 2018
by
Max Lyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for reading different file versions
parent
87a2db3f
Pipeline
#7659
failed with stage
in 74 minutes and 26 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
0 deletions
+95
-0
src/Unittests/TestFiles/cube_poly_version_1_2.om
src/Unittests/TestFiles/cube_poly_version_1_2.om
+0
-0
src/Unittests/TestFiles/cube_poly_version_2_0.om
src/Unittests/TestFiles/cube_poly_version_2_0.om
+0
-0
src/Unittests/TestFiles/cube_tri_version_10_5.om
src/Unittests/TestFiles/cube_tri_version_10_5.om
+0
-0
src/Unittests/TestFiles/cube_tri_version_1_2.om
src/Unittests/TestFiles/cube_tri_version_1_2.om
+0
-0
src/Unittests/TestFiles/cube_tri_version_2_0.om
src/Unittests/TestFiles/cube_tri_version_2_0.om
+0
-0
src/Unittests/unittests_read_write_OM.cc
src/Unittests/unittests_read_write_OM.cc
+95
-0
No files found.
src/Unittests/TestFiles/cube_poly_version_1_2.om
0 → 100644
View file @
c1ac62b9
File added
src/Unittests/TestFiles/cube_poly_version_2_0.om
0 → 100644
View file @
c1ac62b9
File added
src/Unittests/TestFiles/cube_tri_version_10_5.om
0 → 100644
View file @
c1ac62b9
File added
src/Unittests/TestFiles/cube_tri_version_1_2.om
0 → 100644
View file @
c1ac62b9
File added
src/Unittests/TestFiles/cube_tri_version_2_0.om
0 → 100644
View file @
c1ac62b9
File added
src/Unittests/unittests_read_write_OM.cc
View file @
c1ac62b9
...
...
@@ -1326,4 +1326,99 @@ TEST_F(OpenMeshReadWriteOM, WriteReadStatusPropertyFaceOnly) {
}
}
/*
* Just load a triangle mesh from an om file of version 1.2
*/
TEST_F
(
OpenMeshReadWriteOM
,
LoadTriangleMeshVersion_1_2
)
{
mesh_
.
clear
();
std
::
string
file_name
=
"cube_tri_version_1_2.om"
;
bool
ok
=
OpenMesh
::
IO
::
read_mesh
(
mesh_
,
file_name
);
EXPECT_TRUE
(
ok
)
<<
file_name
;
EXPECT_EQ
(
8u
,
mesh_
.
n_vertices
())
<<
"The number of loaded vertices is not correct!"
;
EXPECT_EQ
(
18u
,
mesh_
.
n_edges
())
<<
"The number of loaded edges is not correct!"
;
EXPECT_EQ
(
12u
,
mesh_
.
n_faces
())
<<
"The number of loaded faces is not correct!"
;
EXPECT_EQ
(
36u
,
mesh_
.
n_halfedges
())
<<
"The number of loaded halfedges is not correct!"
;
}
/*
* Just load a polyhedral mesh from an om file of version 1.2
*/
TEST_F
(
OpenMeshReadWriteOM
,
LoadPolyMeshVersion_1_2
)
{
PolyMesh
mesh
;
std
::
string
file_name
=
"cube_poly_version_1_2.om"
;
bool
ok
=
OpenMesh
::
IO
::
read_mesh
(
mesh
,
file_name
);
EXPECT_TRUE
(
ok
)
<<
file_name
;
EXPECT_EQ
(
8u
,
mesh
.
n_vertices
())
<<
"The number of loaded vertices is not correct!"
;
EXPECT_EQ
(
12u
,
mesh
.
n_edges
())
<<
"The number of loaded edges is not correct!"
;
EXPECT_EQ
(
6u
,
mesh
.
n_faces
())
<<
"The number of loaded faces is not correct!"
;
EXPECT_EQ
(
24u
,
mesh
.
n_halfedges
())
<<
"The number of loaded halfedges is not correct!"
;
}
/*
* Just load a triangle mesh from an om file of version 2.0
*/
TEST_F
(
OpenMeshReadWriteOM
,
LoadTriangleMeshVersion_2_0
)
{
mesh_
.
clear
();
std
::
string
file_name
=
"cube_tri_version_2_0.om"
;
bool
ok
=
OpenMesh
::
IO
::
read_mesh
(
mesh_
,
file_name
);
EXPECT_TRUE
(
ok
)
<<
file_name
;
EXPECT_EQ
(
8u
,
mesh_
.
n_vertices
())
<<
"The number of loaded vertices is not correct!"
;
EXPECT_EQ
(
18u
,
mesh_
.
n_edges
())
<<
"The number of loaded edges is not correct!"
;
EXPECT_EQ
(
12u
,
mesh_
.
n_faces
())
<<
"The number of loaded faces is not correct!"
;
EXPECT_EQ
(
36u
,
mesh_
.
n_halfedges
())
<<
"The number of loaded halfedges is not correct!"
;
}
/*
* Just load a polyhedral mesh from an om file of version 2.0
*/
TEST_F
(
OpenMeshReadWriteOM
,
LoadPolyMeshVersion_2_0
)
{
PolyMesh
mesh
;
std
::
string
file_name
=
"cube_poly_version_2_0.om"
;
bool
ok
=
OpenMesh
::
IO
::
read_mesh
(
mesh
,
file_name
);
EXPECT_TRUE
(
ok
)
<<
file_name
;
EXPECT_EQ
(
8u
,
mesh
.
n_vertices
())
<<
"The number of loaded vertices is not correct!"
;
EXPECT_EQ
(
12u
,
mesh
.
n_edges
())
<<
"The number of loaded edges is not correct!"
;
EXPECT_EQ
(
6u
,
mesh
.
n_faces
())
<<
"The number of loaded faces is not correct!"
;
EXPECT_EQ
(
24u
,
mesh
.
n_halfedges
())
<<
"The number of loaded halfedges is not correct!"
;
}
/*
* Just load a triangles mesh from an om file of version 10.5
*/
TEST_F
(
OpenMeshReadWriteOM
,
LoadTriMeshVersion_10_5
)
{
PolyMesh
mesh
;
std
::
string
file_name
=
"cube_tri_version_10_.om"
;
bool
ok
=
OpenMesh
::
IO
::
read_mesh
(
mesh
,
file_name
);
EXPECT_FALSE
(
ok
)
<<
file_name
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment