From 9d84244156e8abd93a7c1d4326231bcd1abb909d Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 9 Sep 2016 15:27:42 +0200 Subject: C++ test update (compilation fix) Signed-off-by: Szczepan Zalega --- unittest/test.cc | 12 ++++++------ unittest/test_HOTP.cc | 2 +- 2 files changed, 7 insertions(+), 7 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(); slot_req.slot_number = slotNo; auto slot = ReadSlot::CommandTransaction::run(stick, slot_req); - std::string sName(reinterpret_cast(slot.slot_name)); + std::string sName(reinterpret_cast(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(); slot.slot_number = 0; auto resp2 = GetPasswordSafeSlotName::CommandTransaction::run(stick, slot); - std::string sName(reinterpret_cast(resp2.slot_name)); + std::string sName(reinterpret_cast(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(resp2.slot_password)); + std::string sName(reinterpret_cast(resp2.data().slot_password)); REQUIRE(sName == std::string("pass1")); } @@ -75,7 +75,7 @@ TEST_CASE("Slot names are correct", "[slotNames]") { auto slot = get_payload(); slot.slot_number = 0; auto resp2 = GetPasswordSafeSlotLogin::CommandTransaction::run(stick, slot); - std::string sName(reinterpret_cast(resp2.slot_login)); + std::string sName(reinterpret_cast(resp2.data().slot_login)); REQUIRE(sName == std::string("login1")); } diff --git a/unittest/test_HOTP.cc b/unittest/test_HOTP.cc index f25bad4..d31df55 100644 --- a/unittest/test_HOTP.cc +++ b/unittest/test_HOTP.cc @@ -84,7 +84,7 @@ TEST_CASE("Test HOTP codes according to RFC", "[HOTP]") { auto gh = get_payload(); gh.slot_number = 0x10; auto resp = GetHOTP::CommandTransaction::run(stick, gh); - REQUIRE( resp.code == code); + REQUIRE( resp.data().code == code); } //checking slot programmed before with nitro-app /* -- cgit v1.2.3