Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/testlib/qtestlog.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the QtTest module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4747#include "QtTest/private/qplaintestlogger_p.h"
    4848#include "QtTest/private/qxmltestlogger_p.h"
    49 
    5049#include <QtCore/qatomic.h>
    5150#include <QtCore/qbytearray.h>
     
    5453#include <string.h>
    5554#include <limits.h>
     55
     56
     57
    5658
    5759QT_BEGIN_NAMESPACE
     
    8486
    8587    static QTestLog::LogMode logMode = QTestLog::Plain;
     88
    8689    static int verbosity = 0;
    8790    static int maxWarnings = 2002;
     
    137140            if (!counter.deref()) {
    138141                QTest::testLogger->addMessage(QAbstractTestLogger::QSystem,
    139                         "Maximum amount of warnings exceeded.");
     142                        "Maximum amount of warnings exceeded.");
    140143                return;
    141144            }
     
    271274
    272275    switch (QTest::logMode) {
    273     case QTestLog::Plain:
    274         QTest::testLogger = new QPlainTestLogger();
    275         break;
    276     case QTestLog::XML:
    277         QTest::testLogger = new QXmlTestLogger(QXmlTestLogger::Complete);
    278         break;
    279     case QTestLog::LightXML:
    280         QTest::testLogger = new QXmlTestLogger(QXmlTestLogger::Light);
    281     }
     276        case QTestLog::Plain:
     277            QTest::testLogger = new QPlainTestLogger;
     278            break;
     279        case QTestLog::XML:{
     280            if(QTest::flushMode == QTestLog::FLushOn)
     281                QTest::testLogger = new QXmlTestLogger(QXmlTestLogger::Complete);
     282            else
     283                QTest::testLogger = new QTestLogger(QTestLogger::TLF_XML);
     284            break;
     285        }case QTestLog::LightXML:{
     286            if(QTest::flushMode == QTestLog::FLushOn)
     287                QTest::testLogger = new QXmlTestLogger(QXmlTestLogger::Light);
     288            else
     289                QTest::testLogger = new QTestLogger(QTestLogger::TLF_LightXml);
     290            break;
     291        }case QTestLog::XunitXML:
     292            QTest::testLogger = new QTestLogger(QTestLogger::TLF_XunitXml);
     293        }
    282294
    283295    QTest::testLogger->startLogging();
     
    298310void QTestLog::warn(const char *msg)
    299311{
     312
    300313    QTEST_ASSERT(msg);
    301314
     
    308321
    309322    if (QTest::testLogger)
    310     QTest::testLogger->addMessage(QAbstractTestLogger::Info, msg, file, line);
     323    QTest::testLogger->addMessage(QAbstractTestLogger::Info, msg, file, line);
    311324}
    312325
     
    362375}
    363376
     377
     378
     379
     380
     381
    364382QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.