diff options
| author | tobtoht <tob@featherwallet.org> | 2025-02-13 17:43:24 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2025-02-13 17:43:24 +0000 |
| commit | 5b045d70e0cb336eef9b962e53c827df3dcf469b (patch) | |
| tree | 2b087e184c5fdc6ce1d0f226104e89aa2d1dff25 /tests/unit_tests | |
| parent | 903e4fa3608a7432b47124bda9eb21aba1b2187e (diff) | |
| parent | e44e8b164030cfbddb9ae8b39251c1ccf396e2b6 (diff) | |
| download | monzero-core-5b045d70e0cb336eef9b962e53c827df3dcf469b.tar.gz monzero-core-5b045d70e0cb336eef9b962e53c827df3dcf469b.tar.xz monzero-core-5b045d70e0cb336eef9b962e53c827df3dcf469b.zip | |
Merge pull request #8617
e44e8b164 wallet: background sync with just the view key (j-berman)
Diffstat (limited to 'tests/unit_tests')
| -rw-r--r-- | tests/unit_tests/wipeable_string.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit_tests/wipeable_string.cpp b/tests/unit_tests/wipeable_string.cpp index ef6964f9e..25121a02e 100644 --- a/tests/unit_tests/wipeable_string.cpp +++ b/tests/unit_tests/wipeable_string.cpp @@ -211,3 +211,15 @@ TEST(wipeable_string, to_hex) ASSERT_TRUE(epee::to_hex::wipeable_string(epee::span<const uint8_t>((const uint8_t*)"", 0)) == epee::wipeable_string("")); ASSERT_TRUE(epee::to_hex::wipeable_string(epee::span<const uint8_t>((const uint8_t*)"abc", 3)) == epee::wipeable_string("616263")); } + +TEST(wipeable_string, to_string) +{ + // Converting a wipeable_string to a string defeats the purpose of wipeable_string, + // but nice to know this works + std::string str; + { + epee::wipeable_string wipeable_str("foo"); + str = std::string(wipeable_str.data(), wipeable_str.size()); + } + ASSERT_TRUE(str == std::string("foo")); +} |
