MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / runConverterCode

Function runConverterCode

test/ModelExport.cpp:296–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296inline void runConverterCode(const std::string& inputPath, const std::string& outputPath)
297{
298 auto extension = string::to_upper_copy(os::getExtension(outputPath));
299
300 EXPECT_FALSE(fs::exists(outputPath)) << outputPath << " already exists";
301
302 // Invoke the converter code
303 GlobalCommandSystem().executeCommand("ConvertModel", cmd::ArgumentList{ inputPath, outputPath, extension });
304
305 EXPECT_TRUE(fs::exists(outputPath)) << outputPath << " should have been created";
306
307 auto importer = GlobalModelFormatManager().getImporter(extension);
308 auto exportedModel = importer->loadModelFromPath(outputPath);
309
310 EXPECT_TRUE(exportedModel);
311 EXPECT_EQ(exportedModel->getSurfaceCount(), 3);
312 EXPECT_EQ(exportedModel->getVertexCount(), 180);
313 EXPECT_EQ(exportedModel->getPolyCount(), 258);
314}
315
316TEST_F(ModelExportTest, ConvertLwoToAse)
317{

Callers 1

TEST_FFunction · 0.85

Calls 8

to_upper_copyFunction · 0.85
getExtensionFunction · 0.85
getImporterMethod · 0.80
executeCommandMethod · 0.45
loadModelFromPathMethod · 0.45
getSurfaceCountMethod · 0.45
getVertexCountMethod · 0.45
getPolyCountMethod · 0.45

Tested by

no test coverage detected