[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevplatform/veritas
From:       Manuel Breugelmans <mbr.nxi () gmail ! com>
Date:       2008-10-24 22:11:55
Message-ID: 1224886315.458668.21410.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 875608 by mbreugel:

- Descriptive messages for some runnertesthelper assertions
- Correctly execute jump-to-source in case of subresults


 M  +7 -1      internal/resultsmodel.cpp  
 M  +2 -0      internal/resultsmodel.h  
 M  +2 -2      internal/runnerwindow.cpp  
 M  +8 -4      tests/runnertesthelper.cpp  


--- trunk/KDE/kdevplatform/veritas/internal/resultsmodel.cpp #875607:875608
@@ -65,7 +65,6 @@
 {
     if (!index.isValid()) return QVariant();
 
-    Test* ownerTest = 0;
     switch (role) {
     case Qt::TextAlignmentRole:
         return int(Qt::AlignLeft | Qt::AlignTop);
@@ -156,3 +155,10 @@
         endInsertRows();
     }
 }
+
+TestResult* ResultsModel::testResult(const QModelIndex& index) const
+{
+    int row = index.row();
+    if (row>=m_results.size()) return 0;
+    return m_results[row];
+}
--- trunk/KDE/kdevplatform/veritas/internal/resultsmodel.h #875607:875608
@@ -96,6 +96,8 @@
     /*! Forces attached views to update */
     void changed();
 
+    TestResult* testResult(const QModelIndex&) const;
+
 public slots:
 
     /*! Adds \a testItemIndex at the end of the results list. */
--- trunk/KDE/kdevplatform/veritas/internal/runnerwindow.cpp #875607:875608
@@ -691,8 +691,8 @@
     // Determine the results model index.
     QModelIndex resultIndex;
     resultIndex = Utils::modelIndexFromProxy(resultsProxyModel(), indexes.first());
-    Test* t = resultsModel()->testFromIndex(resultIndex);
-    TestResult* r = t->result();
+    TestResult* r = resultsModel()->testResult(resultIndex);
+    if (!r) return;
 
     KTextEditor::Cursor range(r->line() - 1, 0);
     IDocumentController* dc = ICore::self()->documentController();
--- trunk/KDE/kdevplatform/veritas/tests/runnertesthelper.cpp #875607:875608
@@ -71,10 +71,14 @@
 {
     QAbstractItemModel* results = m_window->resultsView()->model();
 
-    KOMPARE(item[0], results->data(results->index(num, 0))); // test name
-    KOMPARE(item[1], results->data(results->index(num, 1))); // failure message
-    KOMPARE(item[2], results->data(results->index(num, 2))); // filename
-    KOMPARE(item[3], results->data(results->index(num, 3))); // line number
+    KOMPARE_MSG(item[0], results->data(results->index(num, 0)), // test name
+        QString("Test name does not match for result item %1").arg(num));
+    KOMPARE_MSG(item[1], results->data(results->index(num, 1)), // failure message
+        QString("Descriptive message does not match for result item %1").arg(num));
+    KOMPARE_MSG(item[2], results->data(results->index(num, 2)), // filename
+        QString("Filename does not match for result item %1").arg(num));
+    KOMPARE_MSG(item[3], results->data(results->index(num, 3)),  // line number
+        QString("Line number does not match for result item %1").arg(num));
 }
 
 void RunnerTestHelper::nrofMessagesEquals(int num)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic