-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c223a68
commit 02fe8ee
Showing
4 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
test/sources/libcxx/multiset/multiset.nonmember/compare.three_way.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Modified for https://github.com/morzhovets/momo project. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// UNSUPPORTED: c++03, c++11, c++14, c++17 | ||
|
||
// <set> | ||
|
||
// class multiset | ||
|
||
// template<class Key, class Compare, class Allocator> | ||
// synth-three-way-result<Key> operator<=>(const multiset<Key, Compare, Allocator>& x, | ||
// const multiset<Key, Compare, Allocator>& y); | ||
|
||
int main(int, char**) { | ||
assert(test_ordered_set_container_spaceship<std::multiset>()); | ||
// `std::multiset` is not constexpr, so no `static_assert` test here. | ||
return 0; | ||
} |
72 changes: 72 additions & 0 deletions
72
test/sources/libcxx/multiset/multiset.nonmember/op_compare.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Modified for https://github.com/morzhovets/momo project. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <set> | ||
|
||
// template<class Key, class Compare, class Alloc> | ||
// bool operator==(const std::multiset<Key, Compare, Alloc>& lhs, | ||
// const std::multiset<Key, Compare, Alloc>& rhs); | ||
// | ||
// template<class Key, class Compare, class Alloc> | ||
// bool operator!=(const std::multiset<Key, Compare, Alloc>& lhs, | ||
// const std::multiset<Key, Compare, Alloc>& rhs); | ||
// | ||
// template<class Key, class Compare, class Alloc> | ||
// bool operator<(const std::multiset<Key, Compare, Alloc>& lhs, | ||
// const std::multiset<Key, Compare, Alloc>& rhs); | ||
// | ||
// template<class Key, class Compare, class Alloc> | ||
// bool operator>(const std::multiset<Key, Compare, Alloc>& lhs, | ||
// const std::multiset<Key, Compare, Alloc>& rhs); | ||
// | ||
// template<class Key, class Compare, class Alloc> | ||
// bool operator<=(const std::multiset<Key, Compare, Alloc>& lhs, | ||
// const std::multiset<Key, Compare, Alloc>& rhs); | ||
// | ||
// template<class Key, class Compare, class Alloc> | ||
// bool operator>=(const std::multiset<Key, Compare, Alloc>& lhs, | ||
// const std::multiset<Key, Compare, Alloc>& rhs); | ||
|
||
int main(int, char**) { | ||
{ | ||
std::multiset<int> s1, s2; | ||
s1.insert(1); | ||
s2.insert(2); | ||
const std::multiset<int>& cs1 = s1, cs2 = s2; | ||
assert(testComparisons(cs1, cs2, false, true)); | ||
} | ||
{ | ||
std::multiset<int> s1, s2; | ||
s1.insert(1); | ||
s2.insert(1); | ||
const std::multiset<int>& cs1 = s1, cs2 = s2; | ||
assert(testComparisons(cs1, cs2, true, false)); | ||
} | ||
{ | ||
std::multiset<int> s1, s2; | ||
s1.insert(1); | ||
s2.insert(1); | ||
s2.insert(2); | ||
const std::multiset<int>& cs1 = s1, cs2 = s2; | ||
assert(testComparisons(cs1, cs2, false, true)); | ||
} | ||
{ | ||
std::multiset<int> s1, s2; | ||
s1.insert(1); | ||
s2.insert(1); | ||
s2.insert(1); | ||
s2.insert(1); | ||
const std::multiset<int>& cs1 = s1, cs2 = s2; | ||
assert(testComparisons(cs1, cs2, false, true)); | ||
} | ||
return 0; | ||
} |
38 changes: 38 additions & 0 deletions
38
test/sources/libcxx/multiset/multiset.observers/comp.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Modified for https://github.com/morzhovets/momo project. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// <set> | ||
|
||
// key_compare key_comp() const; | ||
// value_compare value_comp() const; | ||
|
||
int main(int, char**) { | ||
typedef std::multiset<int> set_type; | ||
|
||
set_type s; | ||
set_type::iterator i1 = s.insert(1); | ||
set_type::iterator i2 = s.insert(2); | ||
|
||
#ifndef LIBCPP_HAS_BAD_NEWS_FOR_MOMO | ||
i1 = s.find(1); | ||
#endif | ||
|
||
const set_type& cs = s; | ||
|
||
assert(cs.key_comp()(*i1, *i2)); | ||
assert(!cs.key_comp()(*i2, *i1)); | ||
|
||
assert(cs.value_comp()(*i1, *i2)); | ||
assert(!cs.value_comp()(*i2, *i1)); | ||
|
||
return 0; | ||
} |