You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
764 B
42 lines
764 B
11 years ago
|
#include "private/xlsxrichstring_p.h"
|
||
|
#include <QtTest>
|
||
|
#include <QDebug>
|
||
|
|
||
|
class RichstringTest : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
RichstringTest();
|
||
|
|
||
|
private Q_SLOTS:
|
||
|
void testEqual();
|
||
|
};
|
||
|
|
||
|
RichstringTest::RichstringTest()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void RichstringTest::testEqual()
|
||
|
{
|
||
|
QXlsx::RichString rs;
|
||
|
rs.addFragment("Hello", 0);
|
||
|
rs.addFragment(" RichText", 0);
|
||
|
|
||
|
QXlsx::RichString rs2;
|
||
|
rs2.addFragment("Hello", 0);
|
||
|
rs2.addFragment(" Qt!", 0);
|
||
|
|
||
|
QXlsx::RichString rs3;
|
||
|
rs3.addFragment("Hello", 0);
|
||
|
rs3.addFragment(" Qt!", 0);
|
||
|
|
||
|
QVERIFY2(rs2 != rs, "Failure");
|
||
|
QVERIFY2(rs2 == rs3, "Failure");
|
||
|
QVERIFY2(rs2 != QStringLiteral("Hello Qt!"), "Failure");
|
||
|
}
|
||
|
|
||
|
QTEST_APPLESS_MAIN(RichstringTest)
|
||
|
|
||
|
#include "tst_richstringtest.moc"
|