Page MenuHomePhabricator

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

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


Group Reviewers
Restricted Project

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.

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