diff --git a/deps/ox/src/ox/std/test/CMakeLists.txt b/deps/ox/src/ox/std/test/CMakeLists.txt index 140a7c1d..a16dd009 100644 --- a/deps/ox/src/ox/std/test/CMakeLists.txt +++ b/deps/ox/src/ox/std/test/CMakeLists.txt @@ -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") diff --git a/deps/ox/src/ox/std/test/tests.cpp b/deps/ox/src/ox/std/test/tests.cpp index 7f5b7c91..d5916dbf 100644 --- a/deps/ox/src/ox/std/test/tests.cpp +++ b/deps/ox/src/ox/std/test/tests.cpp @@ -9,6 +9,7 @@ #undef NDEBUG #include +#include #include static std::map tests = { @@ -155,6 +156,25 @@ static std::map 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", [] {