@@ -2177,83 +2177,53 @@ extern "C" {
21772177 * @param actual The actual byte string.
21782178 * @param expected The expected byte string.
21792179 */
2180- #ifdef __cplusplus
2181- #define ASSUME_ITS_EQUAL_BSTR (actual , expected ) \
2182- FOSSIL_TEST_ASSUME(strcmp((actual.c_str()), (expected.c_str())) == 0, "Expected byte string " #actual " to be equal to " #expected)
2183- #else
21842180#define ASSUME_ITS_EQUAL_BSTR (actual , expected ) \
21852181 FOSSIL_TEST_ASSUME(strcmp((const char*)(actual), (const char*)(expected)) == 0, "Expected byte string " #actual " to be equal to " #expected)
2186- #endif
21872182
21882183/**
21892184 * @brief Assumes that the given byte strings are not equal.
21902185 *
21912186 * @param actual The actual byte string.
21922187 * @param expected The expected byte string.
21932188 */
2194- #ifdef __cplusplus
2195- #define ASSUME_NOT_EQUAL_BSTR (actual , expected ) \
2196- FOSSIL_TEST_ASSUME(strcmp((actual.c_str()), (expected.c_str())) != 0, "Expected byte string " #actual " to not be equal to " #expected)
2197- #else
21982189#define ASSUME_NOT_EQUAL_BSTR (actual , expected ) \
21992190 FOSSIL_TEST_ASSUME(strcmp((const char*)(actual), (const char*)(expected)) != 0, "Expected byte string " #actual " to not be equal to " #expected)
2200- #endif
22012191
22022192/**
22032193 * @brief Assumes that the length of the given byte string is equal to the expected length.
22042194 *
22052195 * @param actual The actual byte string.
22062196 * @param expected_len The expected length of the byte string.
22072197 */
2208- #ifdef __cplusplus
2209- #define ASSUME_ITS_LENGTH_EQUAL_BSTR (actual , expected_len ) \
2210- FOSSIL_TEST_ASSUME(strlen((actual.c_str())) == (expected_len), "Expected length of byte string " #actual " to be equal to " #expected_len)
2211- #else
22122198#define ASSUME_ITS_LENGTH_EQUAL_BSTR (actual , expected_len ) \
22132199 FOSSIL_TEST_ASSUME(strlen((const char*)(actual)) == (expected_len), "Expected length of byte string " #actual " to be equal to " #expected_len)
2214- #endif
22152200
22162201/**
22172202 * @brief Assumes that the given C strings are equal.
22182203 *
22192204 * @param actual The actual C string.
22202205 * @param expected The expected C string.
22212206 */
2222- #ifdef __cplusplus
2223- #define ASSUME_ITS_EQUAL_CSTR (actual , expected ) \
2224- FOSSIL_TEST_ASSUME(strcmp((actual.c_str()), (expected.c_str())) == 0, "Expected C string " #actual " to be equal to " #expected)
2225- #else
22262207#define ASSUME_ITS_EQUAL_CSTR (actual , expected ) \
22272208 FOSSIL_TEST_ASSUME(strcmp((actual), (expected)) == 0, "Expected C string " #actual " to be equal to " #expected)
2228- #endif
22292209
22302210/**
22312211 * @brief Assumes that the given C strings are not equal.
22322212 *
22332213 * @param actual The actual C string.
22342214 * @param expected The expected C string.
22352215 */
2236- #ifdef __cplusplus
2237- #define ASSUME_NOT_EQUAL_CSTR (actual , expected ) \
2238- FOSSIL_TEST_ASSUME(strcmp((actual.c_str()), (expected.c_str())) != 0, "Expected C string " #actual " to not be equal to " #expected)
2239- #else
22402216#define ASSUME_NOT_EQUAL_CSTR (actual , expected ) \
22412217 FOSSIL_TEST_ASSUME(strcmp((actual), (expected)) != 0, "Expected C string " #actual " to not be equal to " #expected)
2242- #endif
22432218
22442219/**
22452220 * @brief Assumes that the length of the given C string is equal to the expected length.
22462221 *
22472222 * @param actual The actual C string.
22482223 * @param expected_len The expected length of the C string.
22492224 */
2250- #ifdef __cplusplus
2251- #define ASSUME_ITS_LENGTH_EQUAL_CSTR (actual , expected_len ) \
2252- FOSSIL_TEST_ASSUME(strlen((actual.c_str())) == (expected_len), "Expected length of C string " #actual " to be equal to " #expected_len)
2253- #else
22542225#define ASSUME_ITS_LENGTH_EQUAL_CSTR (actual , expected_len ) \
22552226 FOSSIL_TEST_ASSUME(strlen((actual)) == (expected_len), "Expected length of C string " #actual " to be equal to " #expected_len)
2256- #endif
22572227
22582228#ifdef __cplusplus
22592229}
0 commit comments