| 1411 | } |
| 1412 | |
| 1413 | bool 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 | |
| 1458 | bool PhysXSampleApplication::getNextSample() |
| 1459 | { |
nothing calls this directly
no test coverage detected