Extend unittests to test stable sort.
ClosedPublic

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

Details

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.

Diff Detail

Repository
R304 KNewStuff
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
adridg created this revision.May 31 2017, 11:17 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 31 2017, 11:17 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript

(also, this repo has a .reviewboardrc but no .arcconfig)

leinir accepted this revision.Jun 5 2017, 11:01 AM
leinir added a subscriber: leinir.

Sorting correctness (and more thorough testing) is good, yes. LGTM! :)

As to the missing arcconfig... will need someone to produce one of those who actually uses arc to fix that ;) Removing the .reviewboardrc, though, sounds like a good idea in general.

This revision is now accepted and ready to land.Jun 5 2017, 11:01 AM
This revision was automatically updated to reflect the committed changes.