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

Method shuffle

src/CppUTest/Utest.cpp:801–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799}
800
801void UtestShellPointerArray::shuffle(size_t seed)
802{
803 if (count_ == 0) return;
804
805 PlatformSpecificSrand((unsigned int) seed);
806
807 for (size_t i = count_ - 1; i >= 1; --i)
808 {
809 if (count_ == 0) return;
810
811 const size_t j = ((size_t)PlatformSpecificRand()) % (i + 1); // distribution biased by modulo, but good enough for shuffling
812 swap(i, j);
813 }
814 relinkTestsInOrder();
815}
816
817void UtestShellPointerArray::reverse()
818{

Callers 2

shuffleTestsMethod · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected