You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: code/logic/fossil/test/assume.h
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2177,53 +2177,83 @@ extern "C" {
2177
2177
* @param actual The actual byte string.
2178
2178
* @param expected The expected byte string.
2179
2179
*/
2180
+
#ifdef__cplusplus
2181
+
#defineASSUME_ITS_EQUAL_BSTR(actual, expected) \
2182
+
FOSSIL_TEST_ASSUME(strcmp((const char*)(actual.c_str()), (const char*)(expected.c_str())) == 0, "Expected byte string " #actual " to be equal to " #expected)
2183
+
#else
2180
2184
#defineASSUME_ITS_EQUAL_BSTR(actual, expected) \
2181
2185
FOSSIL_TEST_ASSUME(strcmp((const char*)(actual), (const char*)(expected)) == 0, "Expected byte string " #actual " to be equal to " #expected)
2186
+
#endif
2182
2187
2183
2188
/**
2184
2189
* @brief Assumes that the given byte strings are not equal.
2185
2190
*
2186
2191
* @param actual The actual byte string.
2187
2192
* @param expected The expected byte string.
2188
2193
*/
2194
+
#ifdef__cplusplus
2195
+
#defineASSUME_NOT_EQUAL_BSTR(actual, expected) \
2196
+
FOSSIL_TEST_ASSUME(strcmp((const char*)(actual.c_str()), (const char*)(expected.c_str())) != 0, "Expected byte string " #actual " to not be equal to " #expected)
2197
+
#else
2189
2198
#defineASSUME_NOT_EQUAL_BSTR(actual, expected) \
2190
2199
FOSSIL_TEST_ASSUME(strcmp((const char*)(actual), (const char*)(expected)) != 0, "Expected byte string " #actual " to not be equal to " #expected)
2200
+
#endif
2191
2201
2192
2202
/**
2193
2203
* @brief Assumes that the length of the given byte string is equal to the expected length.
2194
2204
*
2195
2205
* @param actual The actual byte string.
2196
2206
* @param expected_len The expected length of the byte string.
FOSSIL_TEST_ASSUME(strlen((const char*)(actual.c_str())) == (expected_len), "Expected length of byte string " #actual " to be equal to " #expected_len)
0 commit comments