Extend unittests to test stable sort.

Authored by adridg on May 31 2017, 11:15 AM.

Description

Extend unittests to test stable sort.

Summary:

  • Helper function constructs a permutation of the list of menu-items that need to be sorted, then sorts and tests.
  • Test ten permutations of the list of items (not all of them, since it's a stable sort some permutations must produce a different sorted output, so no std::next_permutation here).

Fix stable sorting of menu items.

In the case i1 installed, but in section Main, and i2 uninstalled, this
lambda returned False, meaning that i1 was not less than i2. Change
comparison to always sort installed before uninstalled.

Test Plan:
Revert the change to src/kmoretools/kmoretools_p.h to see the
sorting test fail; restore the change for the fix.

Reviewers: whiting, Frameworks, leinir

Reviewed By: leinir

Subscribers: leinir, Frameworks

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D6049

Details

Committed
adridgJun 17 2017, 6:46 PM
Reviewer
leinir
Differential Revision
D6049: Extend unittests to test stable sort.
Parents
R304:2f8580b9e604: Expose and use Engine's page size variable
Branches
Unknown
Tags
Unknown