Download tests/src/Mod/Mesh/App/Importer.cpp from AbdulElahGwaith/FreeCAD: direct link, hf CLI and curl.
- Browser
- Download file 1.5 kB
-
https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/tests/src/Mod/Mesh/App/Importer.cpp
- Command line
-
hf download hf://AbdulElahGwaith/FreeCAD/tests/src/Mod/Mesh/App/Importer.cpp
-
curl -L -o Importer.cpp https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/tests/src/Mod/Mesh/App/Importer.cpp
1.5 kB
| // SPDX-License-Identifier: LGPL-2.1-or-later | |
| 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<int> 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-*) | |