]> Git trees. - libqmvoc.git/commitdiff
Use QCOMPARE, add generator test.
authorFrederik Gladhorn <gladhorn@kde.org>
Mon, 17 Sep 2007 23:07:31 +0000 (23:07 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Mon, 17 Sep 2007 23:07:31 +0000 (23:07 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=713655

keduvocdocument/tests/keduvocdocumentvalidatortest.cpp

index 59d3bbc8a702d3df6f74b22359b735d15111504c..ac4c5c417f7ba683de6cd289947b58f4cbfdac8a 100644 (file)
@@ -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 )