From 9c51bd4fc83a2ee5f3e88c49a77e7eb5c50b29da Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 1 Sep 2011 14:24:53 +1000 Subject: Fix various trivial formatting issues. Change-Id: Ifa2a2dd2aa26dab178ec1334376db42fc3ebb355 Reviewed-on: http://codereview.qt.nokia.com/4029 Reviewed-by: Rohan McGovern --- src/testlib/qbenchmark.cpp | 12 +++++------ src/testlib/qbenchmark_p.h | 4 ++-- src/testlib/qbenchmarkevent_p.h | 4 ++-- src/testlib/qbenchmarkmeasurement.cpp | 22 +++++++++---------- src/testlib/qbenchmarkmeasurement_p.h | 4 ++-- src/testlib/qbenchmarkmetric.cpp | 2 +- src/testlib/qbenchmarkvalgrind.cpp | 8 +++---- src/testlib/qtestassert.h | 4 ++-- src/testlib/qtestcase.cpp | 40 +++++++++++++++++------------------ src/testlib/qtestcoreelement.h | 15 ++++++------- src/testlib/qtestcorelist.h | 6 +++--- src/testlib/qtestdata.cpp | 2 +- src/testlib/qtestelement.cpp | 10 ++++----- src/testlib/qtestelementattribute.cpp | 36 +++++++++++++++---------------- src/testlib/qtestkeyboard.h | 2 +- src/testlib/qtestmouse.h | 2 +- src/testlib/qtestxunitstreamer.cpp | 16 +++++++------- src/testlib/qxmltestlogger.cpp | 2 +- src/testlib/qxunittestlogger.cpp | 6 +++--- 19 files changed, 96 insertions(+), 101 deletions(-) diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 2e8fa1ee99..8894d41bee 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -119,7 +119,6 @@ QBenchmarkTestMethodData *QBenchmarkTestMethodData::current; QBenchmarkTestMethodData::QBenchmarkTestMethodData() :resultAccepted(false), runOnce(false), iterationCount(-1) { - } QBenchmarkTestMethodData::~QBenchmarkTestMethodData() @@ -134,7 +133,6 @@ void QBenchmarkTestMethodData::beginDataRun() void QBenchmarkTestMethodData::endDataRun() { - } int QBenchmarkTestMethodData::adjustIterationCount(int suggestion) @@ -164,7 +162,7 @@ void QBenchmarkTestMethodData::setResult( accepted = true; } - // Test the result directly without calling the measurer if the minimum time + // Test the result directly without calling the measurer if the minimum time // has been specified on the command line with -minimumvalue. else if (QBenchmarkGlobalData::current->walltimeMinimum != -1) accepted = (value > QBenchmarkGlobalData::current->walltimeMinimum); @@ -196,7 +194,7 @@ QTest::QBenchmarkIterationController::QBenchmarkIterationController(RunMode runM { i = 0; if (runMode == RunOnce) - QBenchmarkTestMethodData::current->runOnce = true; + QBenchmarkTestMethodData::current->runOnce = true; QTest::beginBenchmarkMeasurement(); } @@ -265,16 +263,16 @@ void QTest::beginBenchmarkMeasurement() quint64 QTest::endBenchmarkMeasurement() { // the clock is ticking before the line below, don't add code here. - return QBenchmarkGlobalData::current->measurer->stop(); + return QBenchmarkGlobalData::current->measurer->stop(); } /*! Sets the benchmark result for this test function to \a result. - + Use this function if you want to report benchmark results without using the QBENCHMARK macro. Use \a metric to specify how QTestLib should interpret the results. - + The context for the result will be the test function name and any data tag from the _data function. This function can only be called once in each test function, subsequent calls will replace the diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h index e5e07c0035..36e4b35493 100644 --- a/src/testlib/qbenchmark_p.h +++ b/src/testlib/qbenchmark_p.h @@ -58,7 +58,7 @@ #include #if (defined(Q_OS_LINUX) || defined Q_OS_MAC) && !defined(QT_NO_PROCESS) -#define QTESTLIB_USE_VALGRIND +#define QTESTLIB_USE_VALGRIND #else #undef QTESTLIB_USE_VALGRIND #endif @@ -119,7 +119,7 @@ public: , valid(true) { } - bool operator<(const QBenchmarkResult &other) const + bool operator<(const QBenchmarkResult &other) const { return (value / iterations) < (other.value / other.iterations); } diff --git a/src/testlib/qbenchmarkevent_p.h b/src/testlib/qbenchmarkevent_p.h index fc0729e82f..2cf17ea6a2 100644 --- a/src/testlib/qbenchmarkevent_p.h +++ b/src/testlib/qbenchmarkevent_p.h @@ -69,12 +69,12 @@ public: bool isMeasurementAccepted(qint64 measurement); int adjustIterationCount(int suggestion); int adjustMedianCount(int suggestion); - bool repeatCount() { return 1; } + bool repeatCount() { return 1; } QTest::QBenchmarkMetric metricType(); static bool eventCountingMechanism(void *message); static qint64 eventCounter; }; QT_END_NAMESPACE - + #endif // QBENCHMARKEVENT_H diff --git a/src/testlib/qbenchmarkmeasurement.cpp b/src/testlib/qbenchmarkmeasurement.cpp index 4aad71da34..2c14f5d3fe 100644 --- a/src/testlib/qbenchmarkmeasurement.cpp +++ b/src/testlib/qbenchmarkmeasurement.cpp @@ -60,7 +60,7 @@ qint64 QBenchmarkTimeMeasurer::checkpoint() } qint64 QBenchmarkTimeMeasurer::stop() -{ +{ return time.elapsed(); } @@ -70,8 +70,8 @@ bool QBenchmarkTimeMeasurer::isMeasurementAccepted(qint64 measurement) } int QBenchmarkTimeMeasurer::adjustIterationCount(int suggestion) -{ - return suggestion; +{ + return suggestion; } bool QBenchmarkTimeMeasurer::needsWarmupIteration() @@ -80,8 +80,8 @@ bool QBenchmarkTimeMeasurer::needsWarmupIteration() } int QBenchmarkTimeMeasurer::adjustMedianCount(int) -{ - return 1; +{ + return 1; } QTest::QBenchmarkMetric QBenchmarkTimeMeasurer::metricType() @@ -114,18 +114,18 @@ bool QBenchmarkTickMeasurer::isMeasurementAccepted(qint64) } int QBenchmarkTickMeasurer::adjustIterationCount(int) -{ - return 1; +{ + return 1; } int QBenchmarkTickMeasurer::adjustMedianCount(int) -{ - return 1; +{ + return 1; } bool QBenchmarkTickMeasurer::needsWarmupIteration() -{ - return true; +{ + return true; } QTest::QBenchmarkMetric QBenchmarkTickMeasurer::metricType() diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h index 8242365f20..6d7d8c6c0d 100644 --- a/src/testlib/qbenchmarkmeasurement_p.h +++ b/src/testlib/qbenchmarkmeasurement_p.h @@ -72,8 +72,8 @@ public: virtual bool isMeasurementAccepted(qint64 measurement) = 0; virtual int adjustIterationCount(int suggestion) = 0; virtual int adjustMedianCount(int suggestion) = 0; - virtual bool repeatCount() { return 1; } - virtual bool needsWarmupIteration() { return false; } + virtual bool repeatCount() { return 1; } + virtual bool needsWarmupIteration() { return false; } virtual QTest::QBenchmarkMetric metricType() = 0; }; diff --git a/src/testlib/qbenchmarkmetric.cpp b/src/testlib/qbenchmarkmetric.cpp index d4efe84989..fb7f8f857a 100644 --- a/src/testlib/qbenchmarkmetric.cpp +++ b/src/testlib/qbenchmarkmetric.cpp @@ -46,7 +46,7 @@ \since 4.7 This enum lists all the things that can be benchmarked. - + \value FramesPerSecond Frames per second \value BitsPerSecond Bits per second \value BytesPerSecond Bytes per second diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp index 4b260e8597..7e43d555e0 100644 --- a/src/testlib/qbenchmarkvalgrind.cpp +++ b/src/testlib/qbenchmarkvalgrind.cpp @@ -238,7 +238,7 @@ qint64 QBenchmarkCallgrindMeasurer::checkpoint() } qint64 QBenchmarkCallgrindMeasurer::stop() -{ +{ return checkpoint(); } @@ -249,17 +249,17 @@ bool QBenchmarkCallgrindMeasurer::isMeasurementAccepted(qint64 measurement) } int QBenchmarkCallgrindMeasurer::adjustIterationCount(int) -{ +{ return 1; } int QBenchmarkCallgrindMeasurer::adjustMedianCount(int) -{ +{ return 1; } bool QBenchmarkCallgrindMeasurer::needsWarmupIteration() -{ +{ return true; } diff --git a/src/testlib/qtestassert.h b/src/testlib/qtestassert.h index fa1ee0caec..24edab278d 100644 --- a/src/testlib/qtestassert.h +++ b/src/testlib/qtestassert.h @@ -50,9 +50,9 @@ QT_BEGIN_NAMESPACE QT_MODULE(Test) -#define QTEST_ASSERT(cond) do {if(!(cond))qt_assert(#cond,__FILE__,__LINE__);} while (0) +#define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (0) -#define QTEST_ASSERT_X(cond, where, what) do {if(!(cond))qt_assert_x(where, what,__FILE__,__LINE__);} while (0) +#define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (0) QT_END_NAMESPACE diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index d3176bbe09..666f0a7318 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1059,7 +1059,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) qPrintTestSlots(stdout); exit(0); } - } else if(strcmp(argv[i], "-xunitxml") == 0){ + } else if (strcmp(argv[i], "-xunitxml") == 0) { QTestLog::setLogMode(QTestLog::XunitXML); } else if (strcmp(argv[i], "-xml") == 0) { QTestLog::setLogMode(QTestLog::XML); @@ -1189,7 +1189,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) // we load the QML files. So just store the data for now. int colon = -1; int offset; - for(offset = 0; *(argv[i]+offset); ++offset) { + for (offset = 0; *(argv[i]+offset); ++offset) { if (*(argv[i]+offset) == ':') { if (*(argv[i]+offset+1) == ':') { // "::" is used as a test name separator. @@ -1218,13 +1218,13 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml) int colon = -1; char buf[512], *data=0; int off; - for(off = 0; *(argv[i]+off); ++off) { + for (off = 0; *(argv[i]+off); ++off) { if (*(argv[i]+off) == ':') { colon = off; break; } } - if(colon != -1) { + if (colon != -1) { data = qstrdup(argv[i]+colon+1); } QTest::qt_snprintf(buf, qMin(512, off + 1), "%s", argv[i]); // copy text before the ':' into buf @@ -1425,7 +1425,7 @@ static bool qInvokeTestMethod(const char *slotName, const char *data=0) if (data && !foundFunction) { fprintf(stderr, "Unknown testdata for function %s: '%s'\n", slotName, data); fprintf(stderr, "Available testdata:\n"); - for(int i = 0; i < table.dataCount(); ++i) + for (int i = 0; i < table.dataCount(); ++i) fprintf(stderr, "%s\n", table.testData(i)->dataTag()); return false; } @@ -1476,7 +1476,7 @@ void *fetchData(QTestData *data, const char *tagName, int typeId) */ char *toHexRepresentation(const char *ba, int length) { - if(length == 0) + if (length == 0) return qstrdup(""); /* We output at maximum about maxLen characters in order to avoid @@ -1490,7 +1490,7 @@ char *toHexRepresentation(const char *ba, int length) const int len = qMin(maxLen, length); char *result = 0; - if(length > maxLen) { + if (length > maxLen) { const int size = len * 3 + 4; result = new char[size]; @@ -1511,7 +1511,7 @@ char *toHexRepresentation(const char *ba, int length) int i = 0; int o = 0; - while(true) { + while (true) { const char at = ba[i]; result[o] = toHex[(at >> 4) & 0x0F]; @@ -1520,7 +1520,7 @@ char *toHexRepresentation(const char *ba, int length) ++i; ++o; - if(i == len) + if (i == len) break; else { result[o] = ' '; @@ -1549,7 +1549,7 @@ static void qInvokeTestMethods(QObject *testObject) const bool previousFailed = QTestResult::testFailed(); QTestResult::finishedCurrentTestFunction(); - if(!QTestResult::skipCurrentTest() && !previousFailed) { + if (!QTestResult::skipCurrentTest() && !previousFailed) { if (QTest::testFuncs) { for (int i = 0; i != QTest::testFuncCount; i++) { @@ -1722,18 +1722,18 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #endif #ifdef Q_WS_MAC - bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0); + bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0); #ifdef QT_MAC_USE_COCOA - IOPMAssertionID powerID; + IOPMAssertionID powerID; #endif #endif #ifndef QT_NO_EXCEPTIONS try { #endif - #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX); - #endif +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX); +#endif #ifdef Q_WS_MAC // Starting with Qt 4.4, applications launched from the command line @@ -1742,13 +1742,13 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) if (macNeedsActivate) { ProcessSerialNumber psn = { 0, kCurrentProcess }; SetFrontProcess(&psn); -# ifdef QT_MAC_USE_COCOA +#ifdef QT_MAC_USE_COCOA IOReturn ok = IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &powerID); if (ok != kIOReturnSuccess) macNeedsActivate = false; // no need to release the assertion on exit. -# else +#else UpdateSystemActivity(1); // Wake the display. -# endif +#endif } #endif @@ -1810,7 +1810,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) throw; return 1; } -# endif +#endif currentTestObject = 0; #ifdef QT_MAC_USE_COCOA @@ -1843,7 +1843,7 @@ int QTest::qExec(QObject *testObject, const QStringList &arguments) QVector args; args.reserve(argc); - for(int i = 0; i < argc; ++i) + for (int i = 0; i < argc; ++i) { args.append(arguments.at(i).toLocal8Bit().constData()); argv[i] = args.last().data(); diff --git a/src/testlib/qtestcoreelement.h b/src/testlib/qtestcoreelement.h index ecd088ad12..1d06c8d8cd 100644 --- a/src/testlib/qtestcoreelement.h +++ b/src/testlib/qtestcoreelement.h @@ -87,10 +87,7 @@ QTestCoreElement::~QTestCoreElement() template void QTestCoreElement::addAttribute(const QTest::AttributeIndex attributeIndex, const char *value) { - if(attributeIndex == -1) - return; - - if (attribute(attributeIndex)) + if (attributeIndex == -1 || attribute(attributeIndex)) return; QTestElementAttribute *testAttribute = new QTestElementAttribute; @@ -108,7 +105,7 @@ template const char *QTestCoreElement::attributeValue(QTest::AttributeIndex index) const { const QTestElementAttribute *attrb = attribute(index); - if(attrb) + if (attrb) return attrb->value(); return 0; @@ -118,7 +115,7 @@ template const char *QTestCoreElement::attributeName(QTest::AttributeIndex index) const { const QTestElementAttribute *attrb = attribute(index); - if(attrb) + if (attrb) return attrb->name(); return 0; @@ -139,7 +136,7 @@ const char *QTestCoreElement::elementName() const "system-err" }; - if(type != QTest::LET_Undefined) + if (type != QTest::LET_Undefined) return xmlElementNames[type]; return 0; @@ -155,8 +152,8 @@ template const QTestElementAttribute *QTestCoreElement::attribute(QTest::AttributeIndex index) const { QTestElementAttribute *iterator = listOfAttributes; - while(iterator){ - if(iterator->index() == index) + while (iterator) { + if (iterator->index() == index) return iterator; iterator = iterator->nextElement(); diff --git a/src/testlib/qtestcorelist.h b/src/testlib/qtestcorelist.h index 0790ea5c39..5027e4fcf9 100644 --- a/src/testlib/qtestcorelist.h +++ b/src/testlib/qtestcorelist.h @@ -70,8 +70,8 @@ class QTestCoreList template QTestCoreList::QTestCoreList() -:next(0) -,prev(0) + : next(0) + , prev(0) { } @@ -121,7 +121,7 @@ int QTestCoreList::count() int numOfElements = 0; T *it = next; - while(it){ + while (it) { ++numOfElements; it = it->nextElement(); } diff --git a/src/testlib/qtestdata.cpp b/src/testlib/qtestdata.cpp index d32a591eff..6797abf1d0 100644 --- a/src/testlib/qtestdata.cpp +++ b/src/testlib/qtestdata.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QTestDataPrivate { public: - QTestDataPrivate(): tag(0), parent(0), data(0), dataCount(0) {} + QTestDataPrivate() : tag(0), parent(0), data(0), dataCount(0) {} char *tag; QTestTable *parent; diff --git a/src/testlib/qtestelement.cpp b/src/testlib/qtestelement.cpp index 3dc5ba60a8..a3c002f964 100644 --- a/src/testlib/qtestelement.cpp +++ b/src/testlib/qtestelement.cpp @@ -44,9 +44,9 @@ QT_BEGIN_NAMESPACE QTestElement::QTestElement(int type) - :QTestCoreElement(type), - listOfChildren(0), - parent(0) + : QTestCoreElement(type) + , listOfChildren(0) + , parent(0) { } @@ -57,10 +57,10 @@ QTestElement::~QTestElement() bool QTestElement::addLogElement(QTestElement *element) { - if(!element) + if (!element) return false; - if(element->elementType() != QTest::LET_Undefined){ + if (element->elementType() != QTest::LET_Undefined) { element->addToList(&listOfChildren); element->setParent(this); return true; diff --git a/src/testlib/qtestelementattribute.cpp b/src/testlib/qtestelementattribute.cpp index dcd518ca2a..9799ade577 100644 --- a/src/testlib/qtestelementattribute.cpp +++ b/src/testlib/qtestelementattribute.cpp @@ -50,37 +50,37 @@ QT_BEGIN_NAMESPACE This enum numbers the different tests. \value AI_Undefined - + \value AI_Name - + \value AI_Result - + \value AI_Tests - + \value AI_Failures - + \value AI_Errors - + \value AI_Type - + \value AI_Description - + \value AI_PropertyValue - + \value AI_QTestVersion - + \value AI_QtVersion - + \value AI_File - + \value AI_Line - + \value AI_Metric - + \value AI_Tag - + \value AI_Value - + \value AI_Iterations */ @@ -144,7 +144,7 @@ const char *QTestElementAttribute::name() const "iterations" }; - if(attributeIndex != QTest::AI_Undefined) + if (attributeIndex != QTest::AI_Undefined) return AttributeNames[attributeIndex]; return 0; @@ -162,7 +162,7 @@ bool QTestElementAttribute::isNull() const bool QTestElementAttribute::setPair(QTest::AttributeIndex index, const char *value) { - if(!value) + if (!value) return false; delete[] attributeValue; diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h index 1a87e2515a..43fed84abc 100644 --- a/src/testlib/qtestkeyboard.h +++ b/src/testlib/qtestkeyboard.h @@ -75,7 +75,7 @@ namespace QTest if (delay == -1 || delay < defaultKeyDelay()) delay = defaultKeyDelay(); - if(delay > 0) + if (delay > 0) QTest::qWait(delay); QKeyEvent a(press ? QEvent::KeyPress : QEvent::KeyRelease, code, modifier, text, repeat); diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h index cc076361c2..942b041eb1 100644 --- a/src/testlib/qtestmouse.h +++ b/src/testlib/qtestmouse.h @@ -76,7 +76,7 @@ namespace QTest if (delay == -1 || delay < defaultMouseDelay()) delay = defaultMouseDelay(); - if(delay > 0) + if (delay > 0) QTest::qWait(delay); if (pos.isNull()) diff --git a/src/testlib/qtestxunitstreamer.cpp b/src/testlib/qtestxunitstreamer.cpp index f70945add0..3e9c2feffc 100644 --- a/src/testlib/qtestxunitstreamer.cpp +++ b/src/testlib/qtestxunitstreamer.cpp @@ -80,7 +80,7 @@ void QTestXunitStreamer::indentForElement(const QTestElement* element, char* buf void QTestXunitStreamer::formatStart(const QTestElement *element, QTestCharBuffer *formatted) const { - if(!element || !formatted ) + if (!element || !formatted ) return; char indent[20]; @@ -104,7 +104,7 @@ void QTestXunitStreamer::formatEnd(const QTestElement *element, QTestCharBuffer if (!element || !formatted ) return; - if (!element->childElements()){ + if (!element->childElements()) { formatted->data()[0] = '\0'; return; } @@ -117,7 +117,7 @@ void QTestXunitStreamer::formatEnd(const QTestElement *element, QTestCharBuffer void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTestElementAttribute *attribute, QTestCharBuffer *formatted) const { - if(!attribute || !formatted ) + if (!attribute || !formatted ) return; QTest::AttributeIndex attrindex = attribute->index(); @@ -149,7 +149,7 @@ void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTe void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, QTestCharBuffer *formatted) const { - if(!element || !formatted ) + if (!element || !formatted ) return; // Errors are written as CDATA within system-err, comments elsewhere @@ -162,7 +162,7 @@ void QTestXunitStreamer::formatAfterAttributes(const QTestElement *element, QTes return; } - if(!element->childElements()) + if (!element->childElements()) QTest::qt_asprintf(formatted, "/>\n"); else QTest::qt_asprintf(formatted, ">\n"); @@ -190,7 +190,7 @@ void QTestXunitStreamer::outputElements(QTestElement *element, bool) const while (element) { hasChildren = element->childElements(); - if(element->elementType() != QTest::LET_Benchmark){ + if (element->elementType() != QTest::LET_Benchmark) { formatStart(element, &buf); outputString(buf.data()); @@ -199,7 +199,7 @@ void QTestXunitStreamer::outputElements(QTestElement *element, bool) const formatAfterAttributes(element, &buf); outputString(buf.data()); - if(hasChildren) + if (hasChildren) outputElements(element->childElements(), true); formatEnd(element, &buf); @@ -212,7 +212,7 @@ void QTestXunitStreamer::outputElements(QTestElement *element, bool) const void QTestXunitStreamer::outputElementAttributes(const QTestElement* element, QTestElementAttribute *attribute) const { QTestCharBuffer buf; - while(attribute){ + while (attribute) { formatAttributes(element, attribute, &buf); outputString(buf.data()); attribute = attribute->nextElement(); diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp index 5ed7079ab6..ec153c8e17 100644 --- a/src/testlib/qxmltestlogger.cpp +++ b/src/testlib/qxmltestlogger.cpp @@ -115,7 +115,7 @@ void QXmlTestLogger::startLogging(const char *filename) outputString(buf.constData()); } - QTest::qt_asprintf(&buf, + QTest::qt_asprintf(&buf, "\n" " %s\n" " "QTEST_VERSION_STR"\n" diff --git a/src/testlib/qxunittestlogger.cpp b/src/testlib/qxunittestlogger.cpp index 05a8c47c47..69705b837b 100644 --- a/src/testlib/qxunittestlogger.cpp +++ b/src/testlib/qxunittestlogger.cpp @@ -169,7 +169,7 @@ void QXunitTestLogger::addIncident(IncidentTypes type, const char *description, if (type == QAbstractTestLogger::Fail || type == QAbstractTestLogger::XPass) { QTestElement *failureElement = new QTestElement(QTest::LET_Failure); failureElement->addAttribute(QTest::AI_Result, typeBuf); - if(file) + if (file) failureElement->addAttribute(QTest::AI_File, file); else failureElement->addAttribute(QTest::AI_File, ""); @@ -207,7 +207,7 @@ void QXunitTestLogger::addIncident(IncidentTypes type, const char *description, currentLogElement->addAttribute(QTest::AI_Result, typeBuf); } - if(file) + if (file) currentLogElement->addAttribute(QTest::AI_File, file); else currentLogElement->addAttribute(QTest::AI_File, ""); @@ -297,7 +297,7 @@ void QXunitTestLogger::addMessage(MessageTypes type, const char *message, const errorElement->addAttribute(QTest::AI_Description, message); addTag(errorElement); - if(file) + if (file) errorElement->addAttribute(QTest::AI_File, file); else errorElement->addAttribute(QTest::AI_File, ""); -- cgit v1.2.3