1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/qqtdicttest/tst_qqtdicttesttest.cpp

70 lines
1.2 KiB
C++
Raw Normal View History

2017-11-24 22:43:12 +08:00
#include <QString>
#include <QtTest>
#include <QCoreApplication>
#include "qqtdictionary.h"
class QqtdicttestTest : public QObject
{
Q_OBJECT
public:
QqtdicttestTest();
private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void testCase1_data();
void testCase1();
void testCase2_data();
void testCase2();
private:
2017-11-25 10:58:30 +08:00
QQtDictNode dict;
2017-11-24 22:43:12 +08:00
};
QqtdicttestTest::QqtdicttestTest()
{
}
void QqtdicttestTest::initTestCase()
{
}
void QqtdicttestTest::cleanupTestCase()
{
}
void QqtdicttestTest::testCase1_data()
{
QTest::addColumn<QString> ( "data" );
QTest::addColumn<QString> ( "result" );
QTest::newRow ( "0" ) << "cc" << "dd";
QTest::newRow ( "1" ) << "dd" << "ee";
QTest::newRow ( "2" ) << "gg" << "ff";
}
void QqtdicttestTest::testCase1()
{
QFETCH ( QString, data );
QFETCH ( QString, result );
dict[data] = result;
QVERIFY2 ( dict[data].getValue() == result, "Failure" );
}
void QqtdicttestTest::testCase2_data()
{
}
void QqtdicttestTest::testCase2()
{
QFETCH ( QString, data );
QFETCH ( QString, result );
dict[0] = result;
QVERIFY2 ( dict[0].getValue() == result, "Failure" );
}
QTEST_MAIN ( QqtdicttestTest )
#include "tst_qqtdicttesttest.moc"