MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / assert_str

Function assert_str

tests/runtime/strings/test-symmetric.cpp:9–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include <stdio.h>
8
9void assert_str(std::string_view const& str, const char* expected) {
10 size_t expected_len = strlen(expected);
11 assert(str.size() == expected_len);
12 assert(memcmp(str.data(), expected, expected_len) == 0);
13}
14
15// new API: Identical for guest import and export
16void exports::test::strings::to_test::TakeBasic(std::string_view str) {

Callers 1

TakeBasicMethod · 0.70

Calls 3

assertFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected