Merge lp:~cimi/unity8/cardcreator_better_test into lp:unity8

Proposed by Andrea Cimitan
Status: Rejected
Rejected by: Andrea Cimitan
Proposed branch: lp:~cimi/unity8/cardcreator_better_test
Merge into: lp:unity8
Prerequisite: lp:~cimi/unity8/card_touchdown_2
Diff against target: 25 lines (+6/-2)
1 file modified
tests/plugins/Dash/cardcreatortest.cpp (+6/-2)
To merge this branch: bzr merge lp:~cimi/unity8/cardcreator_better_test
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Unity Team Pending
Review via email: mp+228314@code.launchpad.net

Commit message

Improved cardcreator test, comparing line by line

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No
 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
 * Did you make sure that your branch does not contain spurious tags?
Yes
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
n/a
 * If you changed the UI, has there been a design review?
n/a

To post a comment you must log in.
1083. By Andrea Cimitan

Removed commented code

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

Merged in touchdown branch

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/plugins/Dash/cardcreatortest.cpp'
2--- tests/plugins/Dash/cardcreatortest.cpp 2014-05-06 13:09:08 +0000
3+++ tests/plugins/Dash/cardcreatortest.cpp 2014-07-25 14:02:24 +0000
4@@ -19,6 +19,7 @@
5 #include <QQuickItem>
6 #include <QQuickView>
7 #include <QtTestGui>
8+#include <QDebug>
9
10 class CardCreatorTest : public QObject
11 {
12@@ -73,8 +74,11 @@
13 QFile testResultFile(testDirPath + resultFileName);
14 QVERIFY(testResultFile.open(QIODevice::ReadOnly));
15 QTextStream ts2(&testResultFile);
16- const QString expectedResult = ts2.readAll();
17- QCOMPARE(cardStringResult.toString().simplified(), expectedResult.simplified());
18+ const QStringList expectedLines = ts2.readAll().trimmed().replace(QRegExp("\n\\s*\n"),"\n").split("\n");
19+ const QStringList cardStringResultLines = cardStringResult.toString().trimmed().replace(QRegExp("\n\\s*\n"),"\n").split("\n");
20+ for (int i = 0; i < expectedLines.size(); ++i) {
21+ QCOMPARE(cardStringResultLines[i].simplified(), expectedLines[i].simplified());
22+ }
23
24 QVariant createCardComponentResult;
25 QMetaObject::invokeMethod(view->rootObject(), "createCardComponent", Q_RETURN_ARG(QVariant, createCardComponentResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON));

Subscribers

People subscribed via source and target branches