Skip to content

Commit f718a8a

Browse files
committed
Use QVERIFY where apprpriate
1 parent 5c3f1b3 commit f718a8a

File tree

5 files changed

+14
-21
lines changed

5 files changed

+14
-21
lines changed

lib/digest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* All rights reserved.
66
*/
77

8-
#include "func.h"
8+
#include "func_base.h"
99
#include "digest.h"
1010
#include "lib/base.h"
1111
#include <QList>

lib/test_asn1int.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ void test_asn1int::ops()
5757
a1int s(f);
5858
QCOMPARE(s, f++);
5959
QCOMPARE(++s, f);
60-
QCOMPARE(++s != f, true);
60+
QVERIFY(++s != f);
6161
QCOMPARE(s.getLong(), 392);
6262
QCOMPARE(f.getLong(), 391);
63-
QCOMPARE(f < s, true);
64-
QCOMPARE(s > f, true);
63+
QVERIFY(f < s);
64+
QVERIFY(s > f);
6565
QCOMPARE(QString(a1int(0x18929)), "018929");
6666
}
6767

6868
void test_asn1int::get()
6969
{
7070
a1int f(42);
7171
ASN1_INTEGER *g = f.get();
72-
QCOMPARE(g != f.get0(), true);
72+
QVERIFY(g != f.get0());
7373
QCOMPARE(f.get0(), f.get0());
7474
ASN1_INTEGER_free(g);
7575
}

lib/test_asn1time.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ private slots:
2424
void test_asn1time::construct_op()
2525
{
2626
a1time b, a("20191125153015Z");
27-
QCOMPARE(a.isValid(), true);
28-
QCOMPARE(a.isUndefined(), false);
29-
QCOMPARE(b == a, false);
30-
QCOMPARE(b > a, true);
27+
QVERIFY(a.isValid());
28+
QVERIFY(!a.isUndefined());
29+
QVERIFY(b != a);
30+
QVERIFY(b > a);
3131
b = a;
3232
QCOMPARE(b , a);
3333
a1time c(a.get());

lib/test_entropy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ void test_entropy::initTestCase()
4444
void test_entropy::cleanupTestCase()
4545
{
4646
delete e;
47-
QCOMPARE(QFileInfo::exists(rnd), true);
47+
QVERIFY(QFileInfo::exists(rnd));
4848
QFile::remove(rnd);
4949
qInstallMessageHandler(0);
5050
}
5151

5252
void test_entropy::start()
5353
{
5454
e->add(17);
55-
QCOMPARE((e->strength() > 0), true);
55+
QVERIFY(e->strength() > 0);
5656
e->add_buf((unsigned char*)"SomeText", 8);
5757
}
5858

@@ -62,9 +62,9 @@ void test_entropy::muchSalt()
6262
QString s1, s2;
6363
for (int i=0; i<100; i++) {
6464
s1 = e->makeSalt();
65-
QCOMPARE(s1.contains(rx), true);
65+
QVERIFY(s1.contains(rx));
6666
QCOMPARE(s1.size(), 17);
67-
QCOMPARE(s1 != s2, true);
67+
QVERIFY(s1 != s2);
6868
s2 = s1;
6969
}
7070
}

lib/test_x509name.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
*/
77

88
#include <QTest>
9-
#if 0
10-
#include <QDebug>
11-
#include <QFile>
12-
#include <QByteArray>
13-
#include <QString>
14-
#include <QRegularExpression>
15-
#endif
169
#include "x509name.h"
1710

1811
class test_x509name: public QObject
@@ -40,7 +33,7 @@ void test_x509name::construct()
4033
x509name y;
4134
QCOMPARE(x.entryCount(), 2);
4235
QCOMPARE(y.entryCount(), 0);
43-
QCOMPARE(x != y, true);
36+
QVERIFY(x != y);
4437
}
4538

4639
void test_x509name::d2i2d()

0 commit comments

Comments
 (0)