MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / addSample

Method addSample

physx/samples/samplebase/PhysXSampleApplication.cpp:1413–1456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1411}
1412
1413bool PhysXSampleApplication::addSample(Test::TestGroup &root, SampleCreator creator, const char *fullPath)
1414{
1415 PX_ASSERT(fullPath);
1416
1417 do
1418 {
1419 if ('\0' == fullPath[0] || '/' == fullPath[0])
1420 {
1421 shdfnd::printFormatted("invalid name: %s\n", fullPath);
1422 break;
1423 }
1424
1425 const char* p = fullPath;
1426 while ('\0' != *p && '/' != *p)
1427 ++p;
1428
1429 if ('\0' == *p) // test name
1430 {
1431 if (root.getChildByName(fullPath)) // duplicated name
1432 {
1433 shdfnd::printFormatted("test \"%s\" exists.\n", fullPath);
1434 break;
1435 }
1436 root.addTest(creator, fullPath);
1437 }
1438 else // group name
1439 {
1440 Test::TestGroup* group = root.getChildByName(fullPath, p - fullPath);
1441 if (group)
1442 return addSample(*group, creator, p + 1);
1443
1444 group = new Test::TestGroup(fullPath, p - fullPath);
1445 if (!addSample(*group, creator, p + 1))
1446 {
1447 delete group;
1448 break;
1449 }
1450 root.addGroup(group);
1451 }
1452
1453 return true;
1454 } while (false);
1455 return false;
1456}
1457
1458bool PhysXSampleApplication::getNextSample()
1459{

Callers

nothing calls this directly

Calls 4

printFormattedFunction · 0.85
getChildByNameMethod · 0.80
addTestMethod · 0.80
addGroupMethod · 0.80

Tested by

no test coverage detected