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

Function test_guid

src/core/unit_tests.cpp:1302–1325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1300}
1301
1302static void test_guid()
1303{
1304 memory_globals::init();
1305 guid_globals::init();
1306 {
1307 Guid guid = guid::new_guid();
1308 char str[37];
1309 guid::to_string(str, sizeof(str), guid);
1310 Guid parsed = guid::parse(str);
1311 ENSURE(guid == parsed);
1312 }
1313 {
1314 Guid guid;
1315 ENSURE(guid::try_parse(guid, "961f8005-6a7e-4371-9272-8454dd786884"));
1316 ENSURE(!guid::try_parse(guid, "961f80056a7e-4371-9272-8454dd786884"));
1317 }
1318 {
1319 Guid guid1 = guid::parse("8ec79062-c8fd-41b5-b044-cb545afc9976");
1320 Guid guid2 = guid::parse("8f879a4e-e9dd-4981-8b9e-344bb917d7dc");
1321 ENSURE(guid1 < guid2);
1322 }
1323 guid_globals::shutdown();
1324 memory_globals::shutdown();
1325}
1326
1327static void count_parse_error(const char *msg, void *user_data)
1328{

Callers

nothing calls this directly

Calls 6

new_guidFunction · 0.85
try_parseFunction · 0.85
initFunction · 0.70
to_stringFunction · 0.70
parseFunction · 0.70
shutdownFunction · 0.70

Tested by

no test coverage detected