This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][test][NFC] Rewrite map count test and add test case for "final" compare
ClosedPublic

Authored by ldionne on Jan 26 2022, 3:11 AM.

Details

Summary

Was part of D118114.
Unify test cases for std::map::count method and add test case for the comparator that marked final

Diff Detail

Event Timeline

kboyarinov requested review of this revision.Jan 26 2022, 3:11 AM
kboyarinov created this revision.
kboyarinov added inline comments.
libcxx/test/std/containers/associative/map/map.ops/count.pass.cpp
89

Comment from D118114:

This test case is intended to improve code coverage of the libc++ implementation of map. The implementation uses helper class __map_value_compare for EBO:

template <class _Key, class _CP, class _Compare,

bool = is_empty_v<_Compare> && !is_final_v<_Compare>>

class __map_value_compare : private _Compare { /*...*/};

template <class _Key, class _CP, class _Compare>
class __map_value_compare<_Key, _CP, _Compare, false>
{

_Compare comp;
/*...*/

};
To test both generic template and the specialization, we need additional test-case for final comparator.
Do you think such testing should be organized in this manner or something should be added or changed?

rarutyun accepted this revision.May 3 2022, 3:24 PM

LGTM. @ldionne, any thoughts on that review?

This revision is now accepted and ready to land.May 3 2022, 3:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2022, 3:24 PM
philnik added 1 blocking reviewer(s): Restricted Project.May 4 2022, 9:06 AM
This revision now requires review to proceed.May 4 2022, 9:06 AM
ldionne commandeered this revision.Sep 11 2023, 2:45 PM
ldionne edited reviewers, added: kboyarinov; removed: ldionne.

[Github PR transition cleanup]

Commandeering to rebase and land.

ldionne updated this revision to Diff 556489.Sep 11 2023, 2:54 PM

Rebase and fix a bug where we wouldn't make use of ArgType in the test.

ldionne accepted this revision.Sep 11 2023, 2:54 PM

Will land once CI is green.

This revision is now accepted and ready to land.Sep 11 2023, 2:54 PM
ldionne updated this revision to Diff 556567.Sep 12 2023, 5:54 AM

Rebase and poke CI

ldionne accepted this revision.Sep 12 2023, 10:52 AM

Shipping since the CI failures are unrelated.

This revision was landed with ongoing or failed builds.Sep 12 2023, 10:53 AM
This revision was automatically updated to reflect the committed changes.