Skip to content

Commit

Permalink
Use QVERIFY where apprpriate
Browse files Browse the repository at this point in the history
  • Loading branch information
chris2511 committed Nov 3, 2023
1 parent 5c3f1b3 commit f718a8a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/digest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* All rights reserved.
*/

#include "func.h"
#include "func_base.h"
#include "digest.h"
#include "lib/base.h"
#include <QList>
Expand Down
8 changes: 4 additions & 4 deletions lib/test_asn1int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ void test_asn1int::ops()
a1int s(f);
QCOMPARE(s, f++);
QCOMPARE(++s, f);
QCOMPARE(++s != f, true);
QVERIFY(++s != f);
QCOMPARE(s.getLong(), 392);
QCOMPARE(f.getLong(), 391);
QCOMPARE(f < s, true);
QCOMPARE(s > f, true);
QVERIFY(f < s);
QVERIFY(s > f);
QCOMPARE(QString(a1int(0x18929)), "018929");
}

void test_asn1int::get()
{
a1int f(42);
ASN1_INTEGER *g = f.get();
QCOMPARE(g != f.get0(), true);
QVERIFY(g != f.get0());
QCOMPARE(f.get0(), f.get0());
ASN1_INTEGER_free(g);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/test_asn1time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ private slots:
void test_asn1time::construct_op()
{
a1time b, a("20191125153015Z");
QCOMPARE(a.isValid(), true);
QCOMPARE(a.isUndefined(), false);
QCOMPARE(b == a, false);
QCOMPARE(b > a, true);
QVERIFY(a.isValid());
QVERIFY(!a.isUndefined());
QVERIFY(b != a);
QVERIFY(b > a);
b = a;
QCOMPARE(b , a);
a1time c(a.get());
Expand Down
8 changes: 4 additions & 4 deletions lib/test_entropy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ void test_entropy::initTestCase()
void test_entropy::cleanupTestCase()
{
delete e;
QCOMPARE(QFileInfo::exists(rnd), true);
QVERIFY(QFileInfo::exists(rnd));
QFile::remove(rnd);
qInstallMessageHandler(0);
}

void test_entropy::start()
{
e->add(17);
QCOMPARE((e->strength() > 0), true);
QVERIFY(e->strength() > 0);
e->add_buf((unsigned char*)"SomeText", 8);
}

Expand All @@ -62,9 +62,9 @@ void test_entropy::muchSalt()
QString s1, s2;
for (int i=0; i<100; i++) {
s1 = e->makeSalt();
QCOMPARE(s1.contains(rx), true);
QVERIFY(s1.contains(rx));
QCOMPARE(s1.size(), 17);
QCOMPARE(s1 != s2, true);
QVERIFY(s1 != s2);
s2 = s1;
}
}
Expand Down
9 changes: 1 addition & 8 deletions lib/test_x509name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
*/

#include <QTest>
#if 0
#include <QDebug>
#include <QFile>
#include <QByteArray>
#include <QString>
#include <QRegularExpression>
#endif
#include "x509name.h"

class test_x509name: public QObject
Expand Down Expand Up @@ -40,7 +33,7 @@ void test_x509name::construct()
x509name y;
QCOMPARE(x.entryCount(), 2);
QCOMPARE(y.entryCount(), 0);
QCOMPARE(x != y, true);
QVERIFY(x != y);
}

void test_x509name::d2i2d()
Expand Down

0 comments on commit f718a8a

Please sign in to comment.