summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-02-21 16:16:18 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-02-21 16:16:18 (GMT)
commitfe1a44a850e61d8b64626424b45ef7592ec66589 (patch)
tree5cceb6849ddebd37f3098664c52bdb629543cca1 /src/testlib
parentef01812875f0dfc8e032fefb90f1afeb57aaa821 (diff)
parent2181a341839b72a627a7ef641de58d1d2411f123 (diff)
downloadQt-fe1a44a850e61d8b64626424b45ef7592ec66589.zip
Qt-fe1a44a850e61d8b64626424b45ef7592ec66589.tar.gz
Qt-fe1a44a850e61d8b64626424b45ef7592ec66589.tar.bz2
Merge branch 'master' of git:qt/qt
Conflicts: doc/src/declarative/advtutorial1.qdoc doc/src/declarative/advtutorial2.qdoc doc/src/declarative/advtutorial3.qdoc doc/src/declarative/advtutorial4.qdoc doc/src/declarative/tutorial1.qdoc doc/src/declarative/tutorial2.qdoc doc/src/declarative/tutorial3.qdoc
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 22b59ae..5c9dd55 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1123,6 +1123,14 @@ static void qParseArgs(int argc, char *argv[])
#endif
} else if (strcmp(argv[i], "-qws") == 0) {
// do nothing
+ } else if (strcmp(argv[i], "-graphicssystem") == 0) {
+ // do nothing
+ if (i + 1 >= argc) {
+ printf("-graphicssystem needs an extra parameter specifying the graphics system\n");
+ exit(1);
+ } else {
+ ++i;
+ }
} else if (argv[i][0] == '-') {
printf("Unknown option: '%s'\n\n%s", argv[i], testOptions);
exit(1);
@@ -1308,11 +1316,23 @@ static bool qInvokeTestMethod(const char *slotName, const char *data=0)
const int dataCount = table.dataCount();
QTestResult::setSkipCurrentTest(false);
+ // Data tag requested but none available?
+ if (data && !dataCount) {
+ // Let empty data tag through.
+ if (!*data)
+ data = 0;
+ else {
+ printf("Unknown testdata for function %s: '%s'\n", slotName, data);
+ printf("Function has no testdata.\n");
+ return false;
+ }
+ }
+
/* For each entry in the data table, do: */
do {
if (!data || !qstrcmp(data, table.testData(curDataIndex)->dataTag())) {
foundFunction = true;
- QTestDataSetter s(table.isEmpty() ? static_cast<QTestData *>(0)
+ QTestDataSetter s(curDataIndex >= dataCount ? static_cast<QTestData *>(0)
: table.testData(curDataIndex));
qInvokeTestMethodDataEntry(slot);