Merge pull request #7825

ccfed60 cmake: test is a reserved keyword (selsta)
f0fa959 cmake: fix ccache detection (anon)
8dbe2e5 Daemon: Update average block size table (rbrunner7)
94bad34 wallet2: Don't auto lock device on process parsed blocks (tobtoht)
3c23aca ledger: don't lock for software device (tobtoht)
49beb8d ledger: use software device if we have view key (tobtoht)
d188b5f wallet_api: getPassword (tobtoht)
a395f36 depends, docker: fix bintray links (selsta)
0fecd7e blocks: fix cmake syntax (selsta)
76824bf Stop adding more outputs than bulletproof allows (Alex Opie)
67ba733 unit_tests: fix wipeable_string parse_hexstr test with latest gtest (xiphon)
402ba04 cmake: use CMAKE_CURRENT_LIST_DIR in FindLibUSB (selsta)
1565bcb epee: include public openssl header in cmake (selsta)
2e9af2a cmake: treat warnings as error in compiler flag tests (selsta)
db564ef wallet_api: fix typo in exportKeyImages (selsta)
8507917 depends: add getmonero package mirror (selsta)
8716d2a cmake: fix non portable code (selsta)
This commit is contained in:
luigi1111 2021-08-26 21:10:56 -04:00
commit d98787eb1b
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
22 changed files with 133 additions and 59 deletions

View file

@ -189,20 +189,20 @@ TEST(wipeable_string, parse_hexstr)
{
boost::optional<epee::wipeable_string> s;
ASSERT_EQ(boost::none, epee::wipeable_string("x").parse_hexstr());
ASSERT_EQ(boost::none, epee::wipeable_string("x0000000000000000").parse_hexstr());
ASSERT_EQ(boost::none, epee::wipeable_string("0000000000000000x").parse_hexstr());
ASSERT_EQ(boost::none, epee::wipeable_string("0").parse_hexstr());
ASSERT_EQ(boost::none, epee::wipeable_string("000").parse_hexstr());
ASSERT_TRUE(boost::none == epee::wipeable_string("x").parse_hexstr());
ASSERT_TRUE(boost::none == epee::wipeable_string("x0000000000000000").parse_hexstr());
ASSERT_TRUE(boost::none == epee::wipeable_string("0000000000000000x").parse_hexstr());
ASSERT_TRUE(boost::none == epee::wipeable_string("0").parse_hexstr());
ASSERT_TRUE(boost::none == epee::wipeable_string("000").parse_hexstr());
ASSERT_TRUE((s = epee::wipeable_string("").parse_hexstr()) != boost::none);
ASSERT_EQ(*s, "");
ASSERT_TRUE(*s == "");
ASSERT_TRUE((s = epee::wipeable_string("00").parse_hexstr()) != boost::none);
ASSERT_EQ(*s, epee::wipeable_string("", 1));
ASSERT_TRUE(*s == epee::wipeable_string("", 1));
ASSERT_TRUE((s = epee::wipeable_string("41").parse_hexstr()) != boost::none);
ASSERT_EQ(*s, epee::wipeable_string("A"));
ASSERT_TRUE(*s == epee::wipeable_string("A"));
ASSERT_TRUE((s = epee::wipeable_string("414243").parse_hexstr()) != boost::none);
ASSERT_EQ(*s, epee::wipeable_string("ABC"));
ASSERT_TRUE(*s == epee::wipeable_string("ABC"));
}
TEST(wipeable_string, to_hex)