Skip to content

Commit 0f0017e

Browse files
authored
test(utils): add missing str tests (#216)
1 parent 2b07c52 commit 0f0017e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

test/utils/str.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,23 @@ TEST(utils_str, string_to_bytes) {
3737

3838
ASSERT_EQ(passphraseBytes.size(), PassphraseLength);
3939
}
40+
41+
////////////////////////////////////////////////////////////////////////////////
42+
TEST(utils_str, uint_to_string) {
43+
const uint64_t amount = 100000000ULL;
44+
const auto target = "100000000";
45+
46+
const auto result = UintToString(amount);
47+
48+
ASSERT_STREQ(result.c_str(), target);
49+
}
50+
51+
////////////////////////////////////////////////////////////////////////////////
52+
TEST(utils_str, uint_to_string_zero) {
53+
const uint64_t amount = 0ULL;
54+
const auto target = "0";
55+
56+
const auto result = UintToString(amount);
57+
58+
ASSERT_STREQ(result.c_str(), target);
59+
}

0 commit comments

Comments
 (0)