diff -r 41300fa6a67c -r f7bc934e204c src/testlib/qtestcase.cpp --- a/src/testlib/qtestcase.cpp Tue Feb 02 00:43:10 2010 +0200 +++ b/src/testlib/qtestcase.cpp Wed Mar 31 11:06:36 2010 +0300 @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -964,7 +964,7 @@ " -xunitxml : Outputs results as XML XUnit document\n" " -xml : Outputs results as XML document\n" " -lightxml : Outputs results as stream of XML tags\n" - " -flush : Flushes the resutls\n" + " -flush : Flushes the results\n" " -o filename: Writes all output into a file\n" " -silent : Only outputs warnings and failures\n" " -v1 : Print enter messages for each testfunction\n" @@ -1113,6 +1113,14 @@ #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); @@ -1298,11 +1306,23 @@ 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(0) + QTestDataSetter s(curDataIndex >= dataCount ? static_cast(0) : table.testData(curDataIndex)); qInvokeTestMethodDataEntry(slot);