Skip to content

Commit 45964eb

Browse files
[libc++] [test] Fix __has_include usage, expand condvarany and spaceship coverage (#94120)
Three unrelated, small improvements: * `test_macros.h` was incorrectly saying `__has_include("<version>")` instead of `__has_include(<version>)`. + This caused `<ciso646>` to always be included (noticed because MSVC's STL emitted a deprecation warning). + I searched all of LLVM and found no other occurrences. * `thread.condition.condvarany/wait_for_pred.pass.cpp` forgot to test anything. + I followed what `wait_for.pass.cpp` is testing. * Uncomment spaceship test coverage.
1 parent c9a86fa commit 45964eb

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,12 @@ static_assert(!std::totally_ordered<std::unordered_map<int, void*> >);
111111
static_assert(!std::totally_ordered<std::unordered_set<int> >);
112112

113113
struct A {};
114-
// FIXME(cjdb): uncomment when operator<=> is implemented for each of these types.
115-
// static_assert(!std::totally_ordered<std::array<A, 10> >);
116-
// static_assert(!std::totally_ordered<std::deque<A> >);
117-
// static_assert(!std::totally_ordered<std::forward_list<A> >);
118-
// static_assert(!std::totally_ordered<std::list<A> >);
119-
// static_assert(!std::totally_ordered<std::set<A> >);
120-
// static_assert(!std::totally_ordered<std::vector<A> >);
114+
static_assert(!std::totally_ordered<std::array<A, 10> >);
115+
static_assert(!std::totally_ordered<std::deque<A> >);
116+
static_assert(!std::totally_ordered<std::forward_list<A> >);
117+
static_assert(!std::totally_ordered<std::list<A> >);
118+
static_assert(!std::totally_ordered<std::set<A> >);
119+
static_assert(!std::totally_ordered<std::vector<A> >);
121120
} // namespace standard_types
122121

123122
namespace types_fit_for_purpose {

libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered_with.pass.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,11 +1034,8 @@ static_assert(
10341034
static_assert(!check_totally_ordered_with<std::vector<int>, int>());
10351035

10361036
struct A {};
1037-
// FIXME(cjdb): uncomment when operator<=> is implemented for each of these types.
1038-
// static_assert(!check_totally_ordered_with<std::optional<std::vector<A> >,
1039-
// std::optional<std::vector<A> > >());
1040-
// static_assert(!check_totally_ordered_with<std::optional<std::vector<A> >,
1041-
// std::vector<A> >());
1037+
static_assert(!check_totally_ordered_with<std::optional<std::vector<A> >, std::optional<std::vector<A> > >());
1038+
static_assert(!check_totally_ordered_with<std::optional<std::vector<A> >, std::vector<A> >());
10421039
struct B {};
10431040
static_assert(!check_totally_ordered_with<std::vector<A>, std::vector<B> >());
10441041
static_assert(

libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_pred.pass.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,10 @@ void test() {
162162
}
163163
}
164164

165-
int main(int, char**) { return 0; }
165+
int main(int, char**) {
166+
test<std::unique_lock<std::mutex>>();
167+
test<std::unique_lock<std::timed_mutex>>();
168+
test<MyLock<std::mutex>>();
169+
test<MyLock<std::timed_mutex>>();
170+
return 0;
171+
}

libcxx/test/support/test_macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define SUPPORT_TEST_MACROS_HPP
1212

1313
#ifdef __has_include
14-
# if __has_include("<version>")
14+
# if __has_include(<version>)
1515
# include <version>
1616
# else
1717
# include <ciso646>

0 commit comments

Comments
 (0)