mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Test line-by-line for equality on Test
We where testing the whole document, wich made qDebug completely bogus to see where we failed at testing the generated file. If we test line-by-line, we can know more easily where we failed. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
27b4ef321a
commit
3776c285e2
1 changed files with 25 additions and 15 deletions
|
@ -119,9 +119,11 @@ void TestParse::testParseCompareOutput()
|
||||||
out.open(QFile::ReadOnly);
|
out.open(QFile::ReadOnly);
|
||||||
QTextStream orgS(&org);
|
QTextStream orgS(&org);
|
||||||
QTextStream outS(&out);
|
QTextStream outS(&out);
|
||||||
QString readin = orgS.readAll();
|
QStringList readin = orgS.readAll().split("\n");
|
||||||
QString written = outS.readAll();
|
QStringList written = outS.readAll().split("\n");
|
||||||
QCOMPARE(readin, written);
|
while(readin.size() && written.size()){
|
||||||
|
QCOMPARE(readin.takeFirst(), written.takeFirst());
|
||||||
|
}
|
||||||
clear_dive_file_data();
|
clear_dive_file_data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,9 +146,11 @@ void TestParse::testParseCompareDM4Output()
|
||||||
out.open(QFile::ReadOnly);
|
out.open(QFile::ReadOnly);
|
||||||
QTextStream orgS(&org);
|
QTextStream orgS(&org);
|
||||||
QTextStream outS(&out);
|
QTextStream outS(&out);
|
||||||
QString readin = orgS.readAll();
|
QStringList readin = orgS.readAll().split("\n");
|
||||||
QString written = outS.readAll();
|
QStringList written = outS.readAll().split("\n");
|
||||||
QCOMPARE(readin, written);
|
while(readin.size() && written.size()){
|
||||||
|
QCOMPARE(readin.takeFirst(), written.takeFirst());
|
||||||
|
}
|
||||||
clear_dive_file_data();
|
clear_dive_file_data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,9 +215,11 @@ void TestParse::testParseCompareHUDCOutput()
|
||||||
out.open(QFile::ReadOnly);
|
out.open(QFile::ReadOnly);
|
||||||
QTextStream orgS(&org);
|
QTextStream orgS(&org);
|
||||||
QTextStream outS(&out);
|
QTextStream outS(&out);
|
||||||
QString readin = orgS.readAll();
|
QStringList readin = orgS.readAll().split("\n");
|
||||||
QString written = outS.readAll();
|
QStringList written = outS.readAll().split("\n");
|
||||||
QCOMPARE(readin, written);
|
while(readin.size() && written.size()){
|
||||||
|
QCOMPARE(readin.takeFirst(), written.takeFirst());
|
||||||
|
}
|
||||||
clear_dive_file_data();
|
clear_dive_file_data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,9 +363,11 @@ void TestParse::testParseCompareNewFormatOutput()
|
||||||
out.open(QFile::ReadOnly);
|
out.open(QFile::ReadOnly);
|
||||||
QTextStream orgS(&org);
|
QTextStream orgS(&org);
|
||||||
QTextStream outS(&out);
|
QTextStream outS(&out);
|
||||||
QString readin = orgS.readAll();
|
QStringList readin = orgS.readAll().split("\n");
|
||||||
QString written = outS.readAll();
|
QStringList written = outS.readAll().split("\n");
|
||||||
QCOMPARE(readin, written);
|
while(readin.size() && written.size()){
|
||||||
|
QCOMPARE(readin.takeFirst(), written.takeFirst());
|
||||||
|
}
|
||||||
clear_dive_file_data();
|
clear_dive_file_data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,9 +397,11 @@ void TestParse::testParseCompareDLDOutput()
|
||||||
out.open(QFile::ReadOnly);
|
out.open(QFile::ReadOnly);
|
||||||
QTextStream orgS(&org);
|
QTextStream orgS(&org);
|
||||||
QTextStream outS(&out);
|
QTextStream outS(&out);
|
||||||
QString readin = orgS.readAll();
|
QStringList readin = orgS.readAll().split("\n");
|
||||||
QString written = outS.readAll();
|
QStringList written = outS.readAll().split("\n");
|
||||||
QCOMPARE(readin, written);
|
while(readin.size() && written.size()){
|
||||||
|
QCOMPARE(readin.takeFirst(), written.takeFirst());
|
||||||
|
}
|
||||||
clear_dive_file_data();
|
clear_dive_file_data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue