diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-02-06 10:53:08 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-11 15:41:43 +0100 |
commit | c9867bccc816854f3670309f44c6dfbcb73429c5 (patch) | |
tree | 6210bd5b06e9f1615df38ab5d33a33ac4c315f51 /unittest | |
parent | fa02c23ee2f4bef6be8a502e11fc568dc74b4235 (diff) | |
download | libnitrokey-c9867bccc816854f3670309f44c6dfbcb73429c5.tar.gz libnitrokey-c9867bccc816854f3670309f44c6dfbcb73429c5.tar.bz2 |
Use alias for easy device change
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/test3.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/unittest/test3.cc b/unittest/test3.cc index 5302044..9e0ef11 100644 --- a/unittest/test3.cc +++ b/unittest/test3.cc @@ -21,7 +21,8 @@ using namespace nitrokey::proto::stick10_08; using namespace nitrokey::log; using namespace nitrokey::misc; -using Dev10 = std::shared_ptr<Stick10>; +using Dev = Stick10; +using Dev10 = std::shared_ptr<Dev>; void connect_and_setup(Dev10 stick) { bool connected = stick->connect(); @@ -42,7 +43,7 @@ void authorize(Dev10 stick) { } TEST_CASE("write slot", "[pronew]"){ - auto stick = make_shared<Stick10>(); + auto stick = make_shared<Dev>(); connect_and_setup(stick); authorize(stick); @@ -79,7 +80,7 @@ TEST_CASE("write slot", "[pronew]"){ TEST_CASE("erase slot", "[pronew]"){ - auto stick = make_shared<Stick10>(); + auto stick = make_shared<Dev>(); connect_and_setup(stick); authorize(stick); @@ -105,7 +106,7 @@ TEST_CASE("erase slot", "[pronew]"){ } TEST_CASE("write general config", "[pronew]") { - auto stick = make_shared<Stick10>(); + auto stick = make_shared<Dev>(); connect_and_setup(stick); authorize(stick); @@ -119,7 +120,7 @@ TEST_CASE("write general config", "[pronew]") { } TEST_CASE("authorize user HOTP", "[pronew]") { - auto stick = make_shared<Stick10>(); + auto stick = make_shared<Dev>(); connect_and_setup(stick); authorize(stick); @@ -162,7 +163,7 @@ TEST_CASE("authorize user HOTP", "[pronew]") { } TEST_CASE("check firmware version", "[pronew]") { - auto stick = make_shared<Stick10>(); + auto stick = make_shared<Dev>(); connect_and_setup(stick); auto p = GetStatus::CommandTransaction::run(stick); @@ -170,7 +171,7 @@ TEST_CASE("check firmware version", "[pronew]") { } TEST_CASE("authorize user TOTP", "[pronew]") { - auto stick = make_shared<Stick10>(); + auto stick = make_shared<Dev>(); connect_and_setup(stick); authorize(stick); |