From: Frederik Gladhorn Date: Mon, 17 Sep 2007 23:07:31 +0000 (+0000) Subject: Use QCOMPARE, add generator test. X-Git-Tag: v3.94.0~44 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=e44d94513afcc4f7dcee9f4a87c9d8cb32d5e9ff;p=libqmvoc.git Use QCOMPARE, add generator test. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=713655 --- 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 )