Skip to content

Commit a49623a

Browse files
Merge pull request #31 from dreamer-coding/pr_remove_bstr_assume
Remove byte string assertions
2 parents f8dc3ea + d0bb3f9 commit a49623a

File tree

3 files changed

+0
-51
lines changed

3 files changed

+0
-51
lines changed

code/logic/fossil/test/assume.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,33 +2171,6 @@ extern "C" {
21712171
#define ASSUME_ITS_LENGTH_EQUAL_WSTR(actual, expected_len) \
21722172
FOSSIL_TEST_ASSUME(wcslen((actual)) == (expected_len), "Expected length of wide string " #actual " to be equal to " #expected_len)
21732173

2174-
/**
2175-
* @brief Assumes that the given byte strings are equal.
2176-
*
2177-
* @param actual The actual byte string.
2178-
* @param expected The expected byte string.
2179-
*/
2180-
#define ASSUME_ITS_EQUAL_BSTR(actual, expected) \
2181-
FOSSIL_TEST_ASSUME(strcmp((const char*)(actual), (const char*)(expected)) == 0, "Expected byte string " #actual " to be equal to " #expected)
2182-
2183-
/**
2184-
* @brief Assumes that the given byte strings are not equal.
2185-
*
2186-
* @param actual The actual byte string.
2187-
* @param expected The expected byte string.
2188-
*/
2189-
#define ASSUME_NOT_EQUAL_BSTR(actual, expected) \
2190-
FOSSIL_TEST_ASSUME(strcmp((const char*)(actual), (const char*)(expected)) != 0, "Expected byte string " #actual " to not be equal to " #expected)
2191-
2192-
/**
2193-
* @brief Assumes that the length of the given byte string is equal to the expected length.
2194-
*
2195-
* @param actual The actual byte string.
2196-
* @param expected_len The expected length of the byte string.
2197-
*/
2198-
#define ASSUME_ITS_LENGTH_EQUAL_BSTR(actual, expected_len) \
2199-
FOSSIL_TEST_ASSUME(strlen((const char*)(actual)) == (expected_len), "Expected length of byte string " #actual " to be equal to " #expected_len)
2200-
22012174
/**
22022175
* @brief Assumes that the given C strings are equal.
22032176
*

code/tests/cases/test_tdd.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -685,17 +685,6 @@ FOSSIL_TEST_CASE(c_assume_run_of_wstr) {
685685
ASSUME_ITS_LENGTH_EQUAL_WSTR(str1, 5);
686686
} // end case
687687

688-
FOSSIL_TEST_CASE(c_assume_run_of_bstr) {
689-
const char *str1 = (const char *)"Hello";
690-
const char *str2 = (const char *)"Hello";
691-
const char *str3 = (const char *)"World";
692-
693-
// Test cases
694-
ASSUME_ITS_EQUAL_BSTR(str1, str2);
695-
ASSUME_NOT_EQUAL_BSTR(str1, str3);
696-
ASSUME_ITS_LENGTH_EQUAL_BSTR(str1, 5);
697-
} // end case
698-
699688
FOSSIL_TEST_CASE(c_assume_run_of_cstr) {
700689
const char *str1 = "Hello";
701690
const char *str2 = "Hello";
@@ -769,7 +758,6 @@ FOSSIL_TEST_GROUP(c_tdd_test_cases) {
769758
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_within_range_cchar);
770759
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_within_range_wchar);
771760
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_wstr);
772-
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_bstr);
773761
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_cstr);
774762

775763
FOSSIL_TEST_REGISTER(c_tdd_suite);

code/tests/cases/test_tdd.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -686,17 +686,6 @@ FOSSIL_TEST_CASE(cpp_assume_run_of_wstr) {
686686
ASSUME_ITS_LENGTH_EQUAL_WSTR(str1, 5);
687687
} // end case
688688

689-
FOSSIL_TEST_CASE(cpp_assume_run_of_bstr) {
690-
std::string str1 = "Hello";
691-
std::string str2 = "Hello";
692-
std::string str3 = "World";
693-
694-
// Test cases
695-
ASSUME_ITS_EQUAL_BSTR(str1.c_str(), str2.c_str());
696-
ASSUME_NOT_EQUAL_BSTR(str1.c_str(), str3.c_str());
697-
ASSUME_ITS_LENGTH_EQUAL_BSTR(str1.c_str(), 5);
698-
} // end case
699-
700689
FOSSIL_TEST_CASE(cpp_assume_run_of_cstr) {
701690
std::string str1 = "Hello";
702691
std::string str2 = "Hello";
@@ -770,7 +759,6 @@ FOSSIL_TEST_GROUP(cpp_tdd_test_cases) {
770759
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_within_range_cchar);
771760
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_within_range_wchar);
772761
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_wstr);
773-
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_bstr);
774762
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_cstr);
775763

776764
FOSSIL_TEST_REGISTER(cpp_tdd_suite);

0 commit comments

Comments
 (0)