1 --- src/cppunit/TestFactoryRegistry.cpp
2 +++ src/cppunit/TestFactoryRegistry.cpp
5 TestFactoryRegistry::addTestToSuite( TestSuite *suite )
7 + std::multimap<std::string, Test *> sorted;
8 for ( Factories::iterator it = m_factories.begin();
9 it != m_factories.end();
12 TestFactory *factory = *it;
13 - suite->addTest( factory->makeTest() );
14 + Test *test = factory->makeTest();
15 + sorted.insert({test->getName(), test});
17 + // In the unlikely case of multiple Tests with identical names, those will
18 + // still be added in random order:
19 + for (auto const &i: sorted)
21 + suite->addTest( i.second );