MCPcopy Create free account
hub / github.com/crownengine/crown / test_string_view

Function test_string_view

src/core/unit_tests.cpp:1270–1300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1268}
1269
1270static void test_string_view()
1271{
1272 memory_globals::init();
1273 {
1274 const char *str = "foo";
1275 StringView sv(str);
1276 ENSURE(sv._length == 3);
1277 ENSURE(sv._data == &str[0]);
1278 }
1279 {
1280 StringView sv1("foo");
1281 StringView sv2("foo");
1282 ENSURE(sv1 == sv2);
1283 }
1284 {
1285 StringView sv1("foo");
1286 StringView sv2("bar");
1287 ENSURE(sv1 != sv2);
1288 }
1289 {
1290 StringView sv1("bar");
1291 StringView sv2("foo");
1292 ENSURE(sv1 < sv2);
1293 }
1294 {
1295 StringView sv1("foo");
1296 StringView sv2("fooo");
1297 ENSURE(sv1 < sv2);
1298 }
1299 memory_globals::shutdown();
1300}
1301
1302static void test_guid()
1303{

Callers

nothing calls this directly

Calls 2

initFunction · 0.70
shutdownFunction · 0.70

Tested by

no test coverage detected