@@ -982,48 +982,40 @@ ANTITHESIS_NUMERIC_ASSERT_RAW(SOMETIMES_LESS_THAN_OR_EQUAL_TO, antithesis::inter
982
982
983
983
#define ALWAYS_SOME (pairs, message, ...) \
984
984
do { \
985
- bool disjunction = false ; \
986
- std::vector<std::pair<std::string, bool >> vec_pairs = pairs; \
987
- for (std::pair<std::string, bool > pair : vec_pairs) { \
988
- if (pair.second ) { \
989
- disjunction = true ; \
990
- break ; \
991
- } \
992
- } \
993
- ANTITHESIS_ASSERT_RAW (antithesis::internal::assertions::ALWAYS_ASSERTION, disjunction, message, __VA_ARGS__ __VA_OPT__ (,) pairs); \
994
- antithesis::JSON json_pairs = antithesis::JSON (pairs); \
985
+ ANTITHESIS_ASSERT_RAW (antithesis::internal::assertions::ALWAYS_ASSERTION, ( \
986
+ [](std::initializer_list<std::pair<std::string, bool >> ps){ \
987
+ for (auto const & pair : ps) \
988
+ if (pair.second ) return true ; \
989
+ return false ; }(pairs)), \
990
+ message, __VA_ARGS__ __VA_OPT__ (,) pairs); \
995
991
antithesis::internal::BooleanGuidanceCatalogEntry< \
996
- decltype (json_pairs) , \
992
+ antithesis::JSON , \
997
993
antithesis::internal::assertions::GUIDEPOST_NONE, \
998
994
antithesis::internal::fixed_string (message), \
999
995
FIXED_STRING_FROM_C_STR (std::source_location::current ().file_name ()), \
1000
996
FIXED_STRING_FROM_C_STR (std::source_location::current ().function_name ()), \
1001
997
std::source_location::current ().line (), \
1002
998
std::source_location::current ().column () \
1003
- >::guidepost.send_guidance (json_pairs ); \
999
+ >::guidepost.send_guidance (antithesis::JSON (pairs) ); \
1004
1000
} while (0 )
1005
1001
1006
1002
#define SOMETIMES_ALL (pairs, message, ...) \
1007
1003
do { \
1008
- bool conjunction = true ; \
1009
- std::vector<std::pair<std::string, bool >> vec_pairs = pairs; \
1010
- for (std::pair<std::string, bool > pair : vec_pairs) { \
1011
- if (!pair.second ) { \
1012
- conjunction = false ; \
1013
- break ; \
1014
- } \
1015
- } \
1016
- ANTITHESIS_ASSERT_RAW (antithesis::internal::assertions::SOMETIMES_ASSERTION, conjunction, message, __VA_ARGS__ __VA_OPT__ (,) pairs); \
1017
- antithesis::JSON json_pairs = antithesis::JSON (pairs); \
1004
+ ANTITHESIS_ASSERT_RAW (antithesis::internal::assertions::SOMETIMES_ASSERTION, ( \
1005
+ [](std::initializer_list<std::pair<std::string, bool >> ps){ \
1006
+ for (auto const & pair : ps) \
1007
+ if (!pair.second ) return false ; \
1008
+ return true ; }(pairs)), \
1009
+ message, __VA_ARGS__ __VA_OPT__ (,) pairs); \
1018
1010
antithesis::internal::BooleanGuidanceCatalogEntry< \
1019
- decltype (json_pairs) , \
1011
+ antithesis::JSON , \
1020
1012
antithesis::internal::assertions::GUIDEPOST_ALL, \
1021
1013
antithesis::internal::fixed_string (message), \
1022
1014
FIXED_STRING_FROM_C_STR (std::source_location::current ().file_name ()), \
1023
1015
FIXED_STRING_FROM_C_STR (std::source_location::current ().function_name ()), \
1024
1016
std::source_location::current ().line (), \
1025
1017
std::source_location::current ().column () \
1026
- >::guidepost.send_guidance (json_pairs ); \
1018
+ >::guidepost.send_guidance (antithesis::JSON (pairs) ); \
1027
1019
} while (0 )
1028
1020
1029
1021
#endif
0 commit comments