Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KGpg
Commits
f430f573
Unverified
Commit
f430f573
authored
Dec 03, 2021
by
Rolf Eike Beer
Browse files
tests: unify and prolong test timeouts
This should hopefully make the CI happy.
parent
66b885d9
Pipeline
#104808
failed
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/common.h
View file @
f430f573
...
...
@@ -3,6 +3,9 @@
#include
<QString>
static
const
unsigned
int
encryptionTestTimeout
=
10000
;
static
const
unsigned
int
decryptionTestTimeout
=
25000
;
class
KGpgTransaction
;
class
QTemporaryDir
;
...
...
tests/kgpgdecrypt.cpp
View file @
f430f573
...
...
@@ -23,7 +23,7 @@ void KGpgDecryptTest::testDecrypt(){
QSignalSpy
spy
(
transaction
,
&
KGpgDecrypt
::
done
);
addPasswordArguments
(
transaction
,
passphrase
);
transaction
->
start
();
QVERIFY
(
spy
.
wait
(
10000
));
QVERIFY
(
spy
.
wait
(
decryptionTestTimeout
));
QVERIFY
(
text
.
compare
(
transaction
->
decryptedText
().
join
(
QLatin1Char
(
'\n'
))));
}
...
...
tests/kgpgencrypt.cpp
View file @
f430f573
...
...
@@ -47,7 +47,7 @@ void KGpgEncryptTest::testAsciiArmoredEncryption()
[](
int
result
)
{
QCOMPARE
(
result
,
static_cast
<
int
>
(
KGpgTransaction
::
TS_OK
));
});
QSignalSpy
spy
(
encryption
,
&
KGpgEncrypt
::
done
);
encryption
->
start
();
QVERIFY
(
spy
.
wait
(
10000
));
QVERIFY
(
spy
.
wait
(
encryptionTestTimeout
));
checkEncryptedText
(
encryption
);
if
(
QTest
::
currentTestFailed
())
...
...
@@ -61,7 +61,7 @@ void KGpgEncryptTest::testAsciiArmoredEncryption()
QSignalSpy
spy2
(
decryption
,
&
KGpgDecrypt
::
done
);
addPasswordArguments
(
decryption
,
passphrase
);
decryption
->
start
();
QVERIFY
(
spy2
.
wait
());
QVERIFY
(
spy2
.
wait
(
decryptionTestTimeout
));
//Check if decrypted text is equal to original text
QVERIFY
(
text
.
compare
(
decryption
->
decryptedText
().
join
(
QLatin1Char
(
'\n'
))));
...
...
@@ -85,7 +85,7 @@ void KGpgEncryptTest::testHideKeyIdEncryption()
[](
int
result
)
{
QCOMPARE
(
result
,
static_cast
<
int
>
(
KGpgTransaction
::
TS_OK
));
});
QSignalSpy
spy
(
encryption
,
&
KGpgEncrypt
::
done
);
encryption
->
start
();
QVERIFY
(
spy
.
wait
(
10000
));
QVERIFY
(
spy
.
wait
(
encryptionTestTimeout
));
checkEncryptedText
(
encryption
);
if
(
QTest
::
currentTestFailed
())
...
...
@@ -103,7 +103,7 @@ void KGpgEncryptTest::testHideKeyIdEncryption()
QSignalSpy
spy2
(
decryption
,
&
KGpgDecrypt
::
done
);
addPasswordArguments
(
decryption
,
passphrase
);
decryption
->
start
();
QVERIFY
(
spy2
.
wait
());
QVERIFY
(
spy2
.
wait
(
decryptionTestTimeout
));
//Check if decrypted text is equal to original text
QVERIFY
(
text
.
compare
(
decryption
->
decryptedText
().
join
(
QLatin1Char
(
'\n'
))));
...
...
@@ -124,7 +124,7 @@ void KGpgEncryptTest::testSymmetricEncryption()
QSignalSpy
spy
(
encryption
,
&
KGpgEncrypt
::
done
);
addPasswordArguments
(
encryption
,
passphrase
);
encryption
->
start
();
QVERIFY
(
spy
.
wait
(
10000
));
QVERIFY
(
spy
.
wait
(
encryptionTestTimeout
));
checkEncryptedText
(
encryption
);
if
(
QTest
::
currentTestFailed
())
...
...
@@ -138,7 +138,7 @@ void KGpgEncryptTest::testSymmetricEncryption()
QSignalSpy
spy2
(
decryption
,
&
KGpgDecrypt
::
done
);
addPasswordArguments
(
decryption
,
passphrase
);
decryption
->
start
();
QVERIFY
(
spy2
.
wait
());
QVERIFY
(
spy2
.
wait
(
decryptionTestTimeout
));
//Check if decrypted text is equal to original text
QVERIFY
(
text
.
compare
(
decryption
->
decryptedText
().
join
(
QLatin1Char
(
'\n'
))));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment