diff options
Diffstat (limited to 'tests/TestYkChallengeResponseKey.cpp')
-rw-r--r-- | tests/TestYkChallengeResponseKey.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/tests/TestYkChallengeResponseKey.cpp b/tests/TestYkChallengeResponseKey.cpp index 558920f4a..276ba7325 100644 --- a/tests/TestYkChallengeResponseKey.cpp +++ b/tests/TestYkChallengeResponseKey.cpp @@ -18,36 +18,23 @@ */ #include "TestYkChallengeResponseKey.h" +#include "TestGlobal.h" +#include "crypto/Crypto.h" -#include <QTest> #include <QtConcurrentRun> -#include "crypto/Crypto.h" -#include "keys/YkChallengeResponseKey.h" - QTEST_GUILESS_MAIN(TestYubiKeyChalResp) void TestYubiKeyChalResp::initTestCase() { - m_detected = 0; - m_key = NULL; - // crypto subsystem needs to be initialized for YubiKey testing QVERIFY(Crypto::init()); } -void TestYubiKeyChalResp::cleanupTestCase() -{ - if (m_key) - delete m_key; -} - void TestYubiKeyChalResp::init() { - bool result = YubiKey::instance()->init(); - - if (!result) { - QSKIP("Unable to connect to YubiKey", SkipAll); + if (!YubiKey::instance()->init()) { + QSKIP("Unable to connect to YubiKey"); } } @@ -104,7 +91,7 @@ void TestYubiKeyChalResp::ykDetected(int slot, bool blocking) /* Key used for later testing */ if (!m_key) - m_key = new YkChallengeResponseKey(slot, blocking); + m_key.reset(new YkChallengeResponseKey(slot, blocking)); } void TestYubiKeyChalResp::deinit() |