From e44d94513afcc4f7dcee9f4a87c9d8cb32d5e9ff Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 17 Sep 2007 23:07:31 +0000 Subject: [PATCH] Use QCOMPARE, add generator test. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=713655 --- .../tests/keduvocdocumentvalidatortest.cpp | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/keduvocdocument/tests/keduvocdocumentvalidatortest.cpp b/keduvocdocument/tests/keduvocdocumentvalidatortest.cpp index 59d3bbc..ac4c5c4 100644 --- a/keduvocdocument/tests/keduvocdocumentvalidatortest.cpp +++ b/keduvocdocument/tests/keduvocdocumentvalidatortest.cpp @@ -43,23 +43,31 @@ void KEduVocDocumentValidatorTest::testDocumentAboutInfo() KUrl fileName = KUrl(temp.fileName()); temp.close(); + const QString generator = QString::fromLatin1( "Validator Unit Tests" ); + const QString author = QString::fromLatin1( "Validator Test" ); + const QString license = QString::fromLatin1( "test license" ); + const QString comment = QString::fromLatin1( "comment" ); + const QString category = QString::fromLatin1( "test document" ); + const QString title = QString::fromLatin1( "Validator Test Title" ); + KEduVocDocument doc; - doc.setAuthor("Validator Test"); - doc.setLicense("test license"); - doc.setDocumentComment("comment"); - doc.setCategory("test document"); - doc.setTitle("Validator Test Title"); + doc.setAuthor( author ); + doc.setLicense( license ); + doc.setDocumentComment( comment ); + doc.setCategory( category ); + doc.setTitle( title ); - doc.saveAs(fileName, KEduVocDocument::Kvtml, "Validator Unit Tests"); + doc.saveAs(fileName, KEduVocDocument::Kvtml, generator); KEduVocDocument docRead; docRead.open(fileName); - QVERIFY( docRead.author() == "Validator Test" ); - QVERIFY( docRead.license() == "test license" ); - QVERIFY( docRead.documentComment() == "comment" ); - QVERIFY( docRead.category() == "test document" ); - QVERIFY( docRead.title() == "Validator Test Title" ); + QCOMPARE( docRead.generator(), generator ); + QCOMPARE( docRead.author(), author ); + QCOMPARE( docRead.license(), license ); + QCOMPARE( docRead.documentComment(), comment ); + QCOMPARE( docRead.category(), category ); + QCOMPARE( docRead.title(), title ); } QTEST_KDEMAIN_CORE( KEduVocDocumentValidatorTest ) -- 2.47.3