diff options
author | szszszsz <szszszsz@users.noreply.github.com> | 2016-09-10 11:02:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-10 11:02:38 +0200 |
commit | b16e89ad4445fe9bbb66e8e7f8771a6ca6b333cf (patch) | |
tree | d332db36123c80ac84474c75b9be4acdff81bf54 /unittest/test.cc | |
parent | e164c5f3dc74fb2335b1fc573ce446cdd76a07dc (diff) | |
parent | a46491a97da08e495c92bba8046426678b5564f7 (diff) | |
download | libnitrokey-b16e89ad4445fe9bbb66e8e7f8771a6ca6b333cf.tar.gz libnitrokey-b16e89ad4445fe9bbb66e8e7f8771a6ca6b333cf.tar.bz2 |
Merge pull request #36 from Nitrokey/issue_31-secret_as_hex
#31 pass secret to OTP as hex (breaking change - previously any string was accepted)
Diffstat (limited to 'unittest/test.cc')
-rw-r--r-- | unittest/test.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unittest/test.cc b/unittest/test.cc index 6267512..6744b45 100644 --- a/unittest/test.cc +++ b/unittest/test.cc @@ -18,7 +18,7 @@ std::string getSlotName(Stick10 &stick, int slotNo) { auto slot_req = get_payload<ReadSlot>(); slot_req.slot_number = slotNo; auto slot = ReadSlot::CommandTransaction::run(stick, slot_req); - std::string sName(reinterpret_cast<char *>(slot.slot_name)); + std::string sName(reinterpret_cast<char *>(slot.data().slot_name)); return sName; } @@ -47,18 +47,18 @@ TEST_CASE("Slot names are correct", "[slotNames]") { { auto resp = GetPasswordRetryCount::CommandTransaction::run(stick); - REQUIRE(resp.password_retry_count == 3); + REQUIRE(resp.data().password_retry_count == 3); } { auto resp = GetUserPasswordRetryCount::CommandTransaction::run(stick); - REQUIRE(resp.password_retry_count == 3); + REQUIRE(resp.data().password_retry_count == 3); } { auto slot = get_payload<GetPasswordSafeSlotName>(); slot.slot_number = 0; auto resp2 = GetPasswordSafeSlotName::CommandTransaction::run(stick, slot); - std::string sName(reinterpret_cast<char *>(resp2.slot_name)); + std::string sName(reinterpret_cast<char *>(resp2.data().slot_name)); REQUIRE(sName == std::string("web1")); } @@ -67,7 +67,7 @@ TEST_CASE("Slot names are correct", "[slotNames]") { slot.slot_number = 0; auto resp2 = GetPasswordSafeSlotPassword::CommandTransaction::run(stick, slot); - std::string sName(reinterpret_cast<char *>(resp2.slot_password)); + std::string sName(reinterpret_cast<char *>(resp2.data().slot_password)); REQUIRE(sName == std::string("pass1")); } @@ -75,7 +75,7 @@ TEST_CASE("Slot names are correct", "[slotNames]") { auto slot = get_payload<GetPasswordSafeSlotLogin>(); slot.slot_number = 0; auto resp2 = GetPasswordSafeSlotLogin::CommandTransaction::run(stick, slot); - std::string sName(reinterpret_cast<char *>(resp2.slot_login)); + std::string sName(reinterpret_cast<char *>(resp2.data().slot_login)); REQUIRE(sName == std::string("login1")); } |