Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove byte string assertions #31

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions code/logic/fossil/test/assume.h
Original file line number Diff line number Diff line change
Expand Up @@ -2171,33 +2171,6 @@ extern "C" {
#define ASSUME_ITS_LENGTH_EQUAL_WSTR(actual, expected_len) \
FOSSIL_TEST_ASSUME(wcslen((actual)) == (expected_len), "Expected length of wide string " #actual " to be equal to " #expected_len)

/**
* @brief Assumes that the given byte strings are equal.
*
* @param actual The actual byte string.
* @param expected The expected byte string.
*/
#define ASSUME_ITS_EQUAL_BSTR(actual, expected) \
FOSSIL_TEST_ASSUME(strcmp((const char*)(actual), (const char*)(expected)) == 0, "Expected byte string " #actual " to be equal to " #expected)

/**
* @brief Assumes that the given byte strings are not equal.
*
* @param actual The actual byte string.
* @param expected The expected byte string.
*/
#define ASSUME_NOT_EQUAL_BSTR(actual, expected) \
FOSSIL_TEST_ASSUME(strcmp((const char*)(actual), (const char*)(expected)) != 0, "Expected byte string " #actual " to not be equal to " #expected)

/**
* @brief Assumes that the length of the given byte string is equal to the expected length.
*
* @param actual The actual byte string.
* @param expected_len The expected length of the byte string.
*/
#define ASSUME_ITS_LENGTH_EQUAL_BSTR(actual, expected_len) \
FOSSIL_TEST_ASSUME(strlen((const char*)(actual)) == (expected_len), "Expected length of byte string " #actual " to be equal to " #expected_len)

/**
* @brief Assumes that the given C strings are equal.
*
Expand Down
12 changes: 0 additions & 12 deletions code/tests/cases/test_tdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,17 +685,6 @@ FOSSIL_TEST_CASE(c_assume_run_of_wstr) {
ASSUME_ITS_LENGTH_EQUAL_WSTR(str1, 5);
} // end case

FOSSIL_TEST_CASE(c_assume_run_of_bstr) {
const char *str1 = (const char *)"Hello";
const char *str2 = (const char *)"Hello";
const char *str3 = (const char *)"World";

// Test cases
ASSUME_ITS_EQUAL_BSTR(str1, str2);
ASSUME_NOT_EQUAL_BSTR(str1, str3);
ASSUME_ITS_LENGTH_EQUAL_BSTR(str1, 5);
} // end case

FOSSIL_TEST_CASE(c_assume_run_of_cstr) {
const char *str1 = "Hello";
const char *str2 = "Hello";
Expand Down Expand Up @@ -769,7 +758,6 @@ FOSSIL_TEST_GROUP(c_tdd_test_cases) {
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_within_range_cchar);
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_within_range_wchar);
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_wstr);
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_bstr);
FOSSIL_TEST_ADD(c_tdd_suite, c_assume_run_of_cstr);

FOSSIL_TEST_REGISTER(c_tdd_suite);
Expand Down
12 changes: 0 additions & 12 deletions code/tests/cases/test_tdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,17 +686,6 @@ FOSSIL_TEST_CASE(cpp_assume_run_of_wstr) {
ASSUME_ITS_LENGTH_EQUAL_WSTR(str1, 5);
} // end case

FOSSIL_TEST_CASE(cpp_assume_run_of_bstr) {
std::string str1 = "Hello";
std::string str2 = "Hello";
std::string str3 = "World";

// Test cases
ASSUME_ITS_EQUAL_BSTR(str1.c_str(), str2.c_str());
ASSUME_NOT_EQUAL_BSTR(str1.c_str(), str3.c_str());
ASSUME_ITS_LENGTH_EQUAL_BSTR(str1.c_str(), 5);
} // end case

FOSSIL_TEST_CASE(cpp_assume_run_of_cstr) {
std::string str1 = "Hello";
std::string str2 = "Hello";
Expand Down Expand Up @@ -770,7 +759,6 @@ FOSSIL_TEST_GROUP(cpp_tdd_test_cases) {
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_within_range_cchar);
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_within_range_wchar);
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_wstr);
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_bstr);
FOSSIL_TEST_ADD(cpp_tdd_suite, cpp_assume_run_of_cstr);

FOSSIL_TEST_REGISTER(cpp_tdd_suite);
Expand Down