aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/wipeable_string.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-08-27 08:43:56 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-12 09:26:09 +0000
commit07ec748c8245b42de0ec9964b2f0062c0034f2f8 (patch)
tree7e7cd85956f83c779f63afc2b6ecddbefbb30fd1 /tests/unit_tests/wipeable_string.cpp
parentMerge pull request #4223 (diff)
downloadmonero-07ec748c8245b42de0ec9964b2f0062c0034f2f8.tar.xz
wipeable_string: add hex_to_pod function
Diffstat (limited to 'tests/unit_tests/wipeable_string.cpp')
-rw-r--r--tests/unit_tests/wipeable_string.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit_tests/wipeable_string.cpp b/tests/unit_tests/wipeable_string.cpp
index 5ea1c1729..65718fd45 100644
--- a/tests/unit_tests/wipeable_string.cpp
+++ b/tests/unit_tests/wipeable_string.cpp
@@ -32,6 +32,7 @@
#include "misc_log_ex.h"
#include "wipeable_string.h"
+#include "hex.h"
TEST(wipeable_string, ctor)
{
@@ -202,3 +203,9 @@ TEST(wipeable_string, parse_hexstr)
ASSERT_TRUE((s = epee::wipeable_string("414243").parse_hexstr()));
ASSERT_EQ(*s, epee::wipeable_string("ABC"));
}
+
+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"));
+}