@@ -157,21 +157,26 @@ static ErrorItem createErrorItem(const QString& file, int line, Severity sev, co
157157
158158void TestResultsTree::multiLineResult () const
159159{
160+ // Create tree with 1 multiline message
160161 ResultsTree tree (nullptr );
161162 ErrorItem errorItem = createErrorItem (" file1.c" , 10 , Severity::style, " test" , " bugId" );
162163 errorItem.errorPath << createErrorPathItem (" file2.c" , 23 , 2 , " abc" );
163164 tree.addErrorItem (errorItem);
165+
166+ // Verify model
164167 QStandardItemModel* model = dynamic_cast <QStandardItemModel*>(tree.model ());
165168 QVERIFY (model != nullptr );
166169 QVERIFY (model->rowCount () == 1 );
167170
171+ // Verify file item
168172 const ResultItem* fileItem = dynamic_cast <ResultItem*>(model->item (0 ,0 ));
169173 QVERIFY (fileItem != nullptr );
170174 QCOMPARE (fileItem->getType (), ResultItem::Type::file);
171175 QCOMPARE (fileItem->text (), " file2.c" );
172176 QCOMPARE (fileItem->getErrorPathItem ().file , " file2.c" );
173177 QVERIFY (fileItem->rowCount () == 1 );
174178
179+ // Verify message item
175180 const ResultItem* res = dynamic_cast <ResultItem*>(fileItem->child (0 ,0 ));
176181 QVERIFY (res != nullptr );
177182 QCOMPARE (res->text (), " file2.c" );
@@ -183,6 +188,7 @@ void TestResultsTree::multiLineResult() const
183188 QCOMPARE (res->getErrorPathItem ().file , " file2.c" );
184189 QVERIFY (res->rowCount () == 2 );
185190 QVERIFY (res->columnCount () > 5 );
191+ // Verify both notes
186192 for (int row = 0 ; row < 2 ; ++row) {
187193 for (int col = 0 ; col < res->columnCount (); ++col) {
188194 const ResultItem* item = dynamic_cast <ResultItem*>(res->child (row,col));
0 commit comments