Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanek Bevendorff <janek@jbev.net>2018-01-24 15:22:20 +0300
committerJanek Bevendorff <janek@jbev.net>2018-01-24 15:32:37 +0300
commit7a6850d5fe38b4e19f12d0dc658c8b05ad0ea3bb (patch)
tree2a0ba9edb265861c423e439abe05e8f3ce8bb9d8 /tests/TestYkChallengeResponseKey.cpp
parent6e2500385c8e00c3abe0d903625b23334411c5d4 (diff)
Move useful QTest template specializations to global header file
Fix KDBX test linker errors on Windows
Diffstat (limited to 'tests/TestYkChallengeResponseKey.cpp')
-rw-r--r--tests/TestYkChallengeResponseKey.cpp23
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()