blob: 52732df425c4e88cd5b47be591a7de22865927de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// Copyright (C) 2016 Stephen Kelly <steveire@gmail,com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QCoreApplication>
#include <QtTest/QTest>
class TestClass : public QObject
{
Q_OBJECT
public:
TestClass(QObject* parent = nullptr) {}
private slots:
void doTest();
};
void TestClass::doTest()
{
QFile f(QFINDTESTDATA("testdata.txt"));
QVERIFY(f.open(QFile::ReadOnly));
QCOMPARE(f.readAll().trimmed(), QByteArrayLiteral("This is a test."));
}
QTEST_MAIN(TestClass)
#include "main.moc"
|