D6049: Extend unittests to test stable sort.

Adriaan de Groot noreply at phabricator.kde.org
Wed May 31 11:17:49 UTC 2017


adridg created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.

REVISION 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.

REPOSITORY
  R304 KNewStuff

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D6049

AFFECTED FILES
  autotests/kmoretools/kmoretoolstest.cpp
  src/kmoretools/kmoretools_p.h

To: adridg
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170531/98606859/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list