[ox/std] Add tests for UUID int to hex str conversion

This commit is contained in:
Gary Talent 2023-02-08 21:40:29 -06:00
parent 014daa6b57
commit 86f639c7f7
2 changed files with 21 additions and 0 deletions

View File

@ -19,3 +19,4 @@ add_test("[ox/std] HeapMgr" StdTest malloc)
add_test("[ox/std] Serialize-Int" StdTest "Serialize-Int")
add_test("[ox/std] BufferWriter" StdTest "BufferWriter")
add_test("[ox/std] StringSplit" StdTest "StringSplit")
add_test("[ox/std] ToHex" StdTest "ToHex")

View File

@ -9,6 +9,7 @@
#undef NDEBUG
#include <map>
#include <ox/std/uuid.hpp>
#include <ox/std/std.hpp>
static std::map<ox::String, ox::Error(*)()> tests = {
@ -155,6 +156,25 @@ static std::map<ox::String, ox::Error(*)()> tests = {
return OxError(0);
}
},
{
"ToHex",
[] {
oxExpect(ox::detail::toHex(0x01), "01");
oxExpect(ox::detail::toHex(0x02), "02");
oxExpect(ox::detail::toHex(0x03), "03");
oxExpect(ox::detail::toHex(0x04), "04");
oxExpect(ox::detail::toHex(0x05), "05");
oxExpect(ox::detail::toHex(0x06), "06");
oxExpect(ox::detail::toHex(0x07), "07");
oxExpect(ox::detail::toHex(0x08), "08");
oxExpect(ox::detail::toHex(0x0d), "0d");
oxExpect(ox::detail::toHex(0x0e), "03");
oxExpect(ox::detail::toHex(0x0f), "0f");
oxExpect(ox::detail::toHex(0x93), "93");
oxExpect(ox::detail::toHex(0x40), "40");
return OxError(0);
}
},
{
"StringSplit",
[] {