MCPcopy Create free account
hub / github.com/cpputest/cpputest / IGNORE_TEST

Function IGNORE_TEST

tests/CppUTest/TestRegistryTest.cpp:383–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383IGNORE_TEST(TestRegistry, shuffleTestList)
384{
385 UT_PTR_SET(PlatformSpecificRand, getZero);
386 myRegistry->addTest(test3);
387 myRegistry->addTest(test2);
388 myRegistry->addTest(test1);
389
390 UtestShell* first_before = myRegistry->getFirstTest();
391 UtestShell* second_before = first_before->getNext();
392 UtestShell* third_before = second_before->getNext();
393
394 CHECK_TRUE(first_before == test1);
395 CHECK_TRUE(second_before == test2);
396 CHECK_TRUE(third_before == test3);
397 CHECK_TRUE(third_before->getNext() == NULLPTR);
398
399 // shuffle always with element at index 0: [1] 2 [3] --> [3] [2] 1 --> 2 3 1
400 myRegistry->shuffleTests(0);
401
402 UtestShell* first_after = myRegistry->getFirstTest();
403 UtestShell* second_after = first_after->getNext();
404 UtestShell* third_after = second_after->getNext();
405
406 CHECK_TRUE(first_after == test2);
407 CHECK_TRUE(second_after == test3);
408 CHECK_TRUE(third_after == test1);
409 CHECK_TRUE(third_after->getNext() == NULLPTR);
410}
411
412TEST(TestRegistry, reverseTests)
413{

Callers

nothing calls this directly

Calls 4

shuffleTestsMethod · 0.80
addTestMethod · 0.45
getFirstTestMethod · 0.45
getNextMethod · 0.45

Tested by

no test coverage detected