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

Function performModelNodeTest

test/Models.cpp:485–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485inline void performModelNodeTest(const std::string& testProjectPath, const std::string& modelPath, int expectedPolyCount)
486{
487 auto funcStatic = algorithm::createEntityByClassName("func_static");
488 scene::addNodeToContainer(funcStatic, GlobalMapModule().getRoot());
489 EXPECT_FALSE(algorithm::findChildModel(funcStatic)) << "No ModelNode expected after creating the entity";
490
491 EXPECT_TRUE(os::fileOrDirExists(testProjectPath + modelPath));
492
493 funcStatic->getEntity().setKeyValue("model", modelPath);
494
495 auto model = algorithm::findChildModel(funcStatic);
496 EXPECT_TRUE(model) << "No ModelNode after assigning a model path";
497
498 EXPECT_EQ(model->getIModel().getModelPath(), modelPath);
499 EXPECT_EQ(model->getIModel().getPolyCount(), expectedPolyCount);
500}
501
502// Setting the model key to point to an .ASE model should work
503TEST_F(ModelTest, ModelKeyReferencesAseModel)

Callers 1

TEST_FFunction · 0.85

Calls 9

createEntityByClassNameFunction · 0.85
addNodeToContainerFunction · 0.85
findChildModelFunction · 0.85
fileOrDirExistsFunction · 0.85
getRootMethod · 0.45
setKeyValueMethod · 0.45
getEntityMethod · 0.45
getModelPathMethod · 0.45
getPolyCountMethod · 0.45

Tested by

no test coverage detected