[libcxx-commits] [PATCH] D146991: [libc++][NFC] Rename helper function for testing spaceship

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 28 06:59:10 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG177cb1030f5d: [libc++][NFC] Rename helper function for testing spaceship (authored by ldionne).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146991/new/

https://reviews.llvm.org/D146991

Files:
  libcxx/test/libcxx/containers/sequences/deque/compare.three_way.pass.cpp
  libcxx/test/libcxx/containers/sequences/forwardlist/compare.three_way.pass.cpp
  libcxx/test/std/containers/sequences/list/compare.three_way.pass.cpp
  libcxx/test/support/test_container_comparisons.h


Index: libcxx/test/support/test_container_comparisons.h
===================================================================
--- libcxx/test/support/test_container_comparisons.h
+++ libcxx/test/support/test_container_comparisons.h
@@ -12,9 +12,9 @@
 
 #include "test_comparisons.h"
 
-// Implementation detail of `test_ordered_container_spaceship`
+// Implementation detail of `test_sequence_container_spaceship`
 template <template <typename...> typename Container, typename Elem, typename Order>
-constexpr void test_ordered_container_spaceship_with_type() {
+constexpr void test_sequence_container_spaceship_with_type() {
   // Empty containers
   {
     Container<Elem> l1;
@@ -59,20 +59,20 @@
   }
 }
 
-// Tests the `operator<=>` on ordered containers
+// Tests the `operator<=>` on sequence containers
 template <template <typename...> typename Container>
-constexpr bool test_ordered_container_spaceship() {
+constexpr bool test_sequence_container_spaceship() {
   // The container should fulfil `std::three_way_comparable`
   static_assert(std::three_way_comparable<Container<int>>);
 
   // Test different comparison categories
-  test_ordered_container_spaceship_with_type<Container, int, std::strong_ordering>();
-  test_ordered_container_spaceship_with_type<Container, StrongOrder, std::strong_ordering>();
-  test_ordered_container_spaceship_with_type<Container, WeakOrder, std::weak_ordering>();
-  test_ordered_container_spaceship_with_type<Container, PartialOrder, std::partial_ordering>();
+  test_sequence_container_spaceship_with_type<Container, int, std::strong_ordering>();
+  test_sequence_container_spaceship_with_type<Container, StrongOrder, std::strong_ordering>();
+  test_sequence_container_spaceship_with_type<Container, WeakOrder, std::weak_ordering>();
+  test_sequence_container_spaceship_with_type<Container, PartialOrder, std::partial_ordering>();
 
   // `LessAndEqComp` does not have `operator<=>`. ordering is sythesized based on `operator<`
-  test_ordered_container_spaceship_with_type<Container, LessAndEqComp, std::weak_ordering>();
+  test_sequence_container_spaceship_with_type<Container, LessAndEqComp, std::weak_ordering>();
 
   // Thanks to SFINAE, the following is not a compiler error but returns `false`
   struct NonComparable {};
Index: libcxx/test/std/containers/sequences/list/compare.three_way.pass.cpp
===================================================================
--- libcxx/test/std/containers/sequences/list/compare.three_way.pass.cpp
+++ libcxx/test/std/containers/sequences/list/compare.three_way.pass.cpp
@@ -19,7 +19,7 @@
 #include "test_container_comparisons.h"
 
 int main(int, char**) {
-  assert(test_ordered_container_spaceship<std::list>());
+  assert(test_sequence_container_spaceship<std::list>());
   // `std::list` is not constexpr, so no `static_assert` test here.
   return 0;
 }
Index: libcxx/test/libcxx/containers/sequences/forwardlist/compare.three_way.pass.cpp
===================================================================
--- libcxx/test/libcxx/containers/sequences/forwardlist/compare.three_way.pass.cpp
+++ libcxx/test/libcxx/containers/sequences/forwardlist/compare.three_way.pass.cpp
@@ -19,7 +19,7 @@
 #include "test_container_comparisons.h"
 
 int main(int, char**) {
-  assert(test_ordered_container_spaceship<std::forward_list>());
+  assert(test_sequence_container_spaceship<std::forward_list>());
   // `std::forward_list` is not constexpr, so no `static_assert` test here.
   return 0;
 }
Index: libcxx/test/libcxx/containers/sequences/deque/compare.three_way.pass.cpp
===================================================================
--- libcxx/test/libcxx/containers/sequences/deque/compare.three_way.pass.cpp
+++ libcxx/test/libcxx/containers/sequences/deque/compare.three_way.pass.cpp
@@ -19,7 +19,7 @@
 #include "test_container_comparisons.h"
 
 int main(int, char**) {
-  assert(test_ordered_container_spaceship<std::deque>());
+  assert(test_sequence_container_spaceship<std::deque>());
   // `std::deque` is not constexpr, so no `static_assert` test here.
   return 0;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146991.508997.patch
Type: text/x-patch
Size: 4084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230328/89488b32/attachment.bin>


More information about the libcxx-commits mailing list