diff options
| author | Martin Hořeňovský | 2024-04-08 13:15:31 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2024-04-08 13:15:35 +0200 |
| commit | 05fb437cbbf60de794a7101c5e6ef8f650755ce4 (patch) | |
| tree | 96f04eff6f27debfec3eedfaa995214ea10e6454 /tests/SelfTest/helpers | |
| parent | 71b11c4e3328090d2ec72268299e3fb9e0ac3f8e (diff) | |
| download | catch3-05fb437cbbf60de794a7101c5e6ef8f650755ce4.tar.gz | |
Fix & extend tests for comparing const instances of zero lit types
Diffstat (limited to 'tests/SelfTest/helpers')
| -rw-r--r-- | tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp b/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp index 88d2f2a7..a8e517c0 100644 --- a/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp +++ b/tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp @@ -26,14 +26,20 @@ struct ZeroLiteralAsPointer { struct TypeWithLit0Comparisons { -#define DEFINE_COMP_OP( op ) \ - constexpr friend bool operator op( TypeWithLit0Comparisons, \ - ZeroLiteralAsPointer ) { \ - return true; \ - } \ - constexpr friend bool operator op( ZeroLiteralAsPointer, \ - TypeWithLit0Comparisons ) { \ - return false; \ +#define DEFINE_COMP_OP( op ) \ + constexpr friend bool operator op( TypeWithLit0Comparisons, \ + ZeroLiteralAsPointer ) { \ + return true; \ + } \ + constexpr friend bool operator op( ZeroLiteralAsPointer, \ + TypeWithLit0Comparisons ) { \ + return false; \ + } \ + /* std::orderings only have these for ==, but we add them for all \ + operators so we can test all overloads for decomposer */ \ + constexpr friend bool operator op( TypeWithLit0Comparisons, \ + TypeWithLit0Comparisons ) { \ + return true; \ } DEFINE_COMP_OP( < ) |