Skip to content

Commit 45152a3

Browse files
committed
Format code
1 parent 74c2eeb commit 45152a3

File tree

1 file changed

+83
-22
lines changed

1 file changed

+83
-22
lines changed

libcxx/test/support/test_container_comparisons.h

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "test_comparisons.h"
1818

1919
// Implementation detail of `test_sequence_container_spaceship`
20-
template <template <typename...> typename Container, typename Elem, typename Allocator, typename Order>
20+
template <template <typename...> typename Container, typename Elem, typename Allocator, typename Order>
2121
constexpr void test_sequence_container_spaceship_with_type() {
2222
// Empty containers
2323
{
@@ -71,12 +71,21 @@ constexpr bool test_sequence_container_spaceship() {
7171

7272
// Test different comparison categories
7373
test_sequence_container_spaceship_with_type<Container, int, std::allocator<int>, std::strong_ordering>();
74-
test_sequence_container_spaceship_with_type<Container, StrongOrder, test_allocator<StrongOrder>, std::strong_ordering>();
74+
test_sequence_container_spaceship_with_type<Container,
75+
StrongOrder,
76+
test_allocator<StrongOrder>,
77+
std::strong_ordering>();
7578
test_sequence_container_spaceship_with_type<Container, WeakOrder, std::allocator<WeakOrder>, std::weak_ordering>();
76-
test_sequence_container_spaceship_with_type<Container, PartialOrder, test_allocator<PartialOrder>, std::partial_ordering>();
79+
test_sequence_container_spaceship_with_type<Container,
80+
PartialOrder,
81+
test_allocator<PartialOrder>,
82+
std::partial_ordering>();
7783

7884
// `LessAndEqComp` does not have `operator<=>`. Ordering is synthesized based on `operator<`
79-
test_sequence_container_spaceship_with_type<Container, LessAndEqComp, std::allocator<LessAndEqComp>, std::weak_ordering>();
85+
test_sequence_container_spaceship_with_type<Container,
86+
LessAndEqComp,
87+
std::allocator<LessAndEqComp>,
88+
std::weak_ordering>();
8089

8190
// Thanks to SFINAE, the following is not a compiler error but returns `false`
8291
struct NonComparable {};
@@ -176,7 +185,12 @@ constexpr bool test_sequence_container_adaptor_spaceship() {
176185
}
177186

178187
// Implementation detail of `test_ordered_map_container_spaceship`
179-
template <template <typename...> typename Container, typename Key, typename Val, typename Allocator, typename Order, typename Compare>
188+
template <template <typename...> typename Container,
189+
typename Key,
190+
typename Val,
191+
typename Allocator,
192+
typename Order,
193+
typename Compare>
180194
constexpr void test_ordered_map_container_spaceship_with_type(Compare comp) {
181195
// Empty containers
182196
{
@@ -294,23 +308,63 @@ constexpr bool test_ordered_map_container_spaceship() {
294308
static_assert(std::three_way_comparable<Container<int, int>>);
295309

296310
// Test different comparison categories
297-
test_ordered_map_container_spaceship_with_type<Container, int, int, std::allocator<std::pair<const int, int>>, std::strong_ordering>(std::less{});
298-
test_ordered_map_container_spaceship_with_type<Container, int, int, test_allocator<std::pair<const int, int>>, std::strong_ordering>(std::greater{});
299-
test_ordered_map_container_spaceship_with_type<Container, int, StrongOrder, std::allocator<std::pair<const int, StrongOrder>>, std::strong_ordering>(std::less{});
300-
test_ordered_map_container_spaceship_with_type<Container, int, StrongOrder, test_allocator<std::pair<const int, StrongOrder>>, std::strong_ordering>(std::greater{});
301-
test_ordered_map_container_spaceship_with_type<Container, int, WeakOrder, std::allocator<std::pair<const int, WeakOrder>>, std::weak_ordering>(std::less{});
302-
test_ordered_map_container_spaceship_with_type<Container, int, WeakOrder, test_allocator<std::pair<const int, WeakOrder>>, std::weak_ordering>(std::greater{});
303-
test_ordered_map_container_spaceship_with_type<Container, int, PartialOrder, std::allocator<std::pair<const int, PartialOrder>>, std::partial_ordering>(std ::less{});
304-
test_ordered_map_container_spaceship_with_type<Container, int, PartialOrder, test_allocator<std::pair<const int, PartialOrder>>, std::partial_ordering>(std ::greater{});
311+
test_ordered_map_container_spaceship_with_type<Container,
312+
int,
313+
int,
314+
std::allocator<std::pair<const int, int>>,
315+
std::strong_ordering>(std::less{});
316+
test_ordered_map_container_spaceship_with_type<Container,
317+
int,
318+
int,
319+
test_allocator<std::pair<const int, int>>,
320+
std::strong_ordering>(std::greater{});
321+
test_ordered_map_container_spaceship_with_type<Container,
322+
int,
323+
StrongOrder,
324+
std::allocator<std::pair<const int, StrongOrder>>,
325+
std::strong_ordering>(std::less{});
326+
test_ordered_map_container_spaceship_with_type<Container,
327+
int,
328+
StrongOrder,
329+
test_allocator<std::pair<const int, StrongOrder>>,
330+
std::strong_ordering>(std::greater{});
331+
test_ordered_map_container_spaceship_with_type<Container,
332+
int,
333+
WeakOrder,
334+
std::allocator<std::pair<const int, WeakOrder>>,
335+
std::weak_ordering>(std::less{});
336+
test_ordered_map_container_spaceship_with_type<Container,
337+
int,
338+
WeakOrder,
339+
test_allocator<std::pair<const int, WeakOrder>>,
340+
std::weak_ordering>(std::greater{});
341+
test_ordered_map_container_spaceship_with_type<Container,
342+
int,
343+
PartialOrder,
344+
std::allocator<std::pair<const int, PartialOrder>>,
345+
std::partial_ordering>(std ::less{});
346+
test_ordered_map_container_spaceship_with_type<Container,
347+
int,
348+
PartialOrder,
349+
test_allocator<std::pair<const int, PartialOrder>>,
350+
std::partial_ordering>(std ::greater{});
305351

306352
// `LessAndEqComp` does not have `operator<=>`. Ordering is synthesized based on `operator<`
307-
test_ordered_map_container_spaceship_with_type<Container, int, LessAndEqComp, std::allocator<std::pair<const int, LessAndEqComp>>, std::weak_ordering>(std::less{});
353+
test_ordered_map_container_spaceship_with_type<Container,
354+
int,
355+
LessAndEqComp,
356+
std::allocator<std::pair<const int, LessAndEqComp>>,
357+
std::weak_ordering>(std::less{});
308358

309359
return true;
310360
}
311361

312362
// Implementation detail of `test_ordered_set_container_spaceship`
313-
template <template <typename...> typename Container, typename Elem, typename Allocator, typename Order, typename Compare>
363+
template <template <typename...> typename Container,
364+
typename Elem,
365+
typename Allocator,
366+
typename Order,
367+
typename Compare>
314368
constexpr void test_ordered_set_spaceship_with_type(Compare comp) {
315369
// Empty containers
316370
{
@@ -399,15 +453,22 @@ constexpr bool test_ordered_set_container_spaceship() {
399453
// Test different comparison categories
400454
test_ordered_set_spaceship_with_type<Container, int, std::allocator<int>, std::strong_ordering>(std::less{});
401455
test_ordered_set_spaceship_with_type<Container, int, test_allocator<int>, std::strong_ordering>(std::greater{});
402-
test_ordered_set_spaceship_with_type<Container, StrongOrder, std::allocator<StrongOrder>, std::strong_ordering>(std::less{});
403-
test_ordered_set_spaceship_with_type<Container, StrongOrder, test_allocator<StrongOrder>, std::strong_ordering>(std::greater{});
404-
test_ordered_set_spaceship_with_type<Container, WeakOrder, std::allocator<WeakOrder>, std::weak_ordering>(std::less{});
405-
test_ordered_set_spaceship_with_type<Container, WeakOrder, test_allocator<WeakOrder>, std::weak_ordering>(std::greater{});
406-
test_ordered_set_spaceship_with_type<Container, PartialOrder, std::allocator<PartialOrder>, std::partial_ordering>(std::less{});
407-
test_ordered_set_spaceship_with_type<Container, PartialOrder, test_allocator<PartialOrder>, std::partial_ordering>(std::greater{});
456+
test_ordered_set_spaceship_with_type<Container, StrongOrder, std::allocator<StrongOrder>, std::strong_ordering>(
457+
std::less{});
458+
test_ordered_set_spaceship_with_type<Container, StrongOrder, test_allocator<StrongOrder>, std::strong_ordering>(
459+
std::greater{});
460+
test_ordered_set_spaceship_with_type<Container, WeakOrder, std::allocator<WeakOrder>, std::weak_ordering>(
461+
std::less{});
462+
test_ordered_set_spaceship_with_type<Container, WeakOrder, test_allocator<WeakOrder>, std::weak_ordering>(
463+
std::greater{});
464+
test_ordered_set_spaceship_with_type<Container, PartialOrder, std::allocator<PartialOrder>, std::partial_ordering>(
465+
std::less{});
466+
test_ordered_set_spaceship_with_type<Container, PartialOrder, test_allocator<PartialOrder>, std::partial_ordering>(
467+
std::greater{});
408468

409469
// `LessAndEqComp` does not have `operator<=>`. Ordering is synthesized based on `operator<`
410-
test_ordered_set_spaceship_with_type<Container, LessAndEqComp, std::allocator<LessAndEqComp>, std::weak_ordering>(std::less{});
470+
test_ordered_set_spaceship_with_type<Container, LessAndEqComp, std::allocator<LessAndEqComp>, std::weak_ordering>(
471+
std::less{});
411472

412473
return true;
413474
}

0 commit comments

Comments
 (0)