// SPDX-License-Identifier: LGPL-2.1-or-later #include #include #include #include #include #include class ImporterTest: public ::testing::Test { protected: static void SetUpTestSuite() { XERCES_CPP_NAMESPACE::XMLPlatformUtils::Initialize(); } }; // NOLINTBEGIN(cppcoreguidelines-*,readability-*) TEST_F(ImporterTest, Test3MF) { std::string file(DATADIR); file.append("/tests/mesh.3mf"); MeshCore::Reader3MF reader(file); EXPECT_EQ(reader.Load(), true); std::vector ids = reader.GetMeshIds(); std::sort(ids.begin(), ids.end()); EXPECT_EQ(ids.size(), 2); const MeshCore::MeshKernel& mesh1 = reader.GetMesh(ids[0]); EXPECT_EQ(mesh1.CountPoints(), 8); EXPECT_EQ(mesh1.CountEdges(), 18); EXPECT_EQ(mesh1.CountFacets(), 12); const MeshCore::MeshKernel& mesh2 = reader.GetMesh(ids[1]); EXPECT_EQ(mesh2.CountPoints(), 652); EXPECT_EQ(mesh2.CountEdges(), 1950); EXPECT_EQ(mesh2.CountFacets(), 1300); } TEST_F(ImporterTest, TestOBJ) { std::string file(DATADIR); file.append("/tests/mesh.obj"); MeshCore::MeshKernel kernel; MeshCore::ReaderOBJ reader(kernel, nullptr); EXPECT_EQ(reader.Load(file), true); EXPECT_EQ(kernel.CountPoints(), 8); EXPECT_EQ(kernel.CountFacets(), 12); } // NOLINTEND(cppcoreguidelines-*,readability-*)