mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
unit_tests: add a test for parse_hexstr_to_binbuff
This commit is contained in:
parent
f6187cd811
commit
6671110ca3
1 changed files with 13 additions and 0 deletions
|
@ -456,6 +456,19 @@ TEST(StringTools, PodToHex)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(StringTools, ParseHex)
|
||||||
|
{
|
||||||
|
static const char data[] = "a10b68c2";
|
||||||
|
for (size_t i = 0; i < sizeof(data); i += 2)
|
||||||
|
{
|
||||||
|
std::string res;
|
||||||
|
ASSERT_TRUE(epee::string_tools::parse_hexstr_to_binbuff(std::string(data, i), res));
|
||||||
|
std::string hex = epee::string_tools::buff_to_hex_nodelimer(res);
|
||||||
|
ASSERT_EQ(hex.size(), i);
|
||||||
|
ASSERT_EQ(memcmp(data, hex.data(), i), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TEST(StringTools, GetIpString)
|
TEST(StringTools, GetIpString)
|
||||||
{
|
{
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
|
|
Loading…
Reference in a new issue