summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2024-03-22 18:03:13 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2024-03-27 04:24:11 +0100
commit8414a0aa2c22e2656bccc97600a59c7163d040c2 (patch)
tree27727e85cb327f074c031bccb4eb8f844d436777 /tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
parentcccda0e62d3d70f09654bbd6681a3e79c9814c8d (diff)
Tests: check the output of QFile::open
Wrap the call in QVERIFY. tst_QTextStream::read0d0d0a was also faulty as it *never* opened the file because of a broken path. Fix it with QFINDTESTDATA. Change-Id: I61a8f83beddf098d37fda13cb3bfb4aaa4913fc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp')
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index 7da56cc8e9..79bae3c270 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -580,7 +580,7 @@ void tst_QSslKey::passphraseChecks()
QVERIFY(keyFile.exists());
{
if (!keyFile.isOpen())
- keyFile.open(QIODevice::ReadOnly);
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
else
keyFile.reset();
QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey);
@@ -588,7 +588,7 @@ void tst_QSslKey::passphraseChecks()
}
{
if (!keyFile.isOpen())
- keyFile.open(QIODevice::ReadOnly);
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
else
keyFile.reset();
QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "");
@@ -596,7 +596,7 @@ void tst_QSslKey::passphraseChecks()
}
{
if (!keyFile.isOpen())
- keyFile.open(QIODevice::ReadOnly);
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
else
keyFile.reset();
QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "WRONG!");
@@ -604,7 +604,7 @@ void tst_QSslKey::passphraseChecks()
}
{
if (!keyFile.isOpen())
- keyFile.open(QIODevice::ReadOnly);
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
else
keyFile.reset();
QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, passphrase);
@@ -622,7 +622,7 @@ void tst_QSslKey::noPassphraseChecks()
QFile keyFile(fileName);
{
if (!keyFile.isOpen())
- keyFile.open(QIODevice::ReadOnly);
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
else
keyFile.reset();
QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey);
@@ -630,7 +630,7 @@ void tst_QSslKey::noPassphraseChecks()
}
{
if (!keyFile.isOpen())
- keyFile.open(QIODevice::ReadOnly);
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
else
keyFile.reset();
QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "");
@@ -638,7 +638,7 @@ void tst_QSslKey::noPassphraseChecks()
}
{
if (!keyFile.isOpen())
- keyFile.open(QIODevice::ReadOnly);
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
else
keyFile.reset();
QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "xxx");