Skip to content

Commit

Permalink
Added test. Tidied check.
Browse files Browse the repository at this point in the history
  • Loading branch information
nolan-veed committed May 11, 2024
1 parent ecc031c commit 7530f68
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tests/roc_core/test_uuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,22 @@ TEST(uuid, generate) {
char a_uuid[UuidLen + 1] = {};

CHECK(uuid_generare(a_uuid, sizeof(a_uuid)) == true);
CHECK(a_uuid[8] == '-');
CHECK(a_uuid[13] == '-');
CHECK(a_uuid[18] == '-');
CHECK(a_uuid[23] == '-');
CHECK(a_uuid[UuidLen] == '\0');
}

TEST(uuid, generated_with_bigger_buffer) {
char a_uuid[UuidLen + 1 + 4] = {};

CHECK(uuid_generare(a_uuid, sizeof(a_uuid)) == true);
CHECK(a_uuid[8] == '-');
CHECK(a_uuid[13] == '-');
CHECK(a_uuid[18] == '-');
CHECK(a_uuid[23] == '-');
CHECK(a_uuid[UuidLen] == '\0');
}

} // namespace core
Expand Down

0 comments on commit 7530f68

Please sign in to comment.