MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / expect_equality

Function expect_equality

scripts/test_stringzilla.cpp:1241–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1239}
1240
1241inline void expect_equality(char const *a, char const *b, std::size_t size) {
1242 if (std::memcmp(a, b, size) == 0) return;
1243 std::size_t mismatch_position = 0;
1244 for (; mismatch_position < size; ++mismatch_position)
1245 if (a[mismatch_position] != b[mismatch_position]) break;
1246 std::fprintf(stderr, "Mismatch at position %zu: %c != %c\n", mismatch_position, a[mismatch_position],
1247 b[mismatch_position]);
1248 assert(false);
1249}
1250
1251/**
1252 * @brief Validates that `sz::memcpy`, `sz::memset`, and `sz::memmove` work similar to their `std::` counterparts.

Callers 2

test_memory_utilitiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…