mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Improve sorting stability test
This commit is contained in:
@@ -179,14 +179,11 @@ TEST_P(PluginSorterTest,
|
||||
PluginSorter ps;
|
||||
std::vector<std::string> expectedSortedOrder = getLoadOrder();
|
||||
|
||||
std::vector<std::string> sorted = ps.Sort(game_);
|
||||
EXPECT_TRUE(
|
||||
std::equal(begin(sorted), end(sorted), begin(expectedSortedOrder)));
|
||||
|
||||
// Check stability.
|
||||
sorted = ps.Sort(game_);
|
||||
EXPECT_TRUE(
|
||||
std::equal(begin(sorted), end(sorted), begin(expectedSortedOrder)));
|
||||
// Check stability by running the sort 100 times.
|
||||
for (int i = 0; i < 100; i++) {
|
||||
std::vector<std::string> sorted = ps.Sort(game_);
|
||||
ASSERT_EQ(expectedSortedOrder, sorted) << " for sort " << i;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(PluginSorterTest, sortingShouldResolveGroupsAsTransitiveLoadAfterSets) {
|
||||
|
||||
Reference in New Issue
Block a user