blob: 7938bbb863225c9ea2c08a87fc91443cdcf908b3 (
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
#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"
|