From d670ef51fe76adccd6f4d017f6a23940ab5284ee Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 30 Oct 2009 10:55:29 +0100 Subject: rename qstringbuilder test classes --- tests/auto/qstringbuilder1/qstringbuilder1.pro | 3 -- tests/auto/qstringbuilder1/stringbuilder.cpp | 56 +--------------------- tests/auto/qstringbuilder1/stringbuilder.h | 55 --------------------- tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp | 33 ++++++++++++- 4 files changed, 33 insertions(+), 114 deletions(-) delete mode 100644 tests/auto/qstringbuilder1/stringbuilder.h (limited to 'tests/auto/qstringbuilder1') diff --git a/tests/auto/qstringbuilder1/qstringbuilder1.pro b/tests/auto/qstringbuilder1/qstringbuilder1.pro index 1ca9d456a8..5bb14d4290 100644 --- a/tests/auto/qstringbuilder1/qstringbuilder1.pro +++ b/tests/auto/qstringbuilder1/qstringbuilder1.pro @@ -3,7 +3,4 @@ load(qttest_p4) QT = core SOURCES += tst_qstringbuilder1.cpp -HEADERS += ../qstringbuilder1/stringbuilder.h - -DEFINES += SCENARIO=1 diff --git a/tests/auto/qstringbuilder1/stringbuilder.cpp b/tests/auto/qstringbuilder1/stringbuilder.cpp index 9fea137a58..f35d4d20d5 100644 --- a/tests/auto/qstringbuilder1/stringbuilder.cpp +++ b/tests/auto/qstringbuilder1/stringbuilder.cpp @@ -39,61 +39,9 @@ ** ****************************************************************************/ -// This is included in various .cpp files as a compile test for various scenarios -// depending on NO_CAST_* and QT_USE_FAST_OPERATOR_PLUS and QT_USE_FAST_CONCATENATION - -#if SCENARIO == 1 -// this is the "no harm done" version. Only operator% is active, -// with NO_CAST * defined -#define P % -#undef QT_USE_FAST_OPERATOR_PLUS -#undef QT_USE_FAST_CONCATENATION -#define QT_NO_CAST_FROM_ASCII -#define QT_NO_CAST_TO_ASCII -#endif - - -#if SCENARIO == 2 -// this is the "full" version. Operator+ is replaced by a QStringBuilder -// based version -// with NO_CAST * defined -#define P + -#define QT_USE_FAST_OPERATOR_PLUS -#define QT_USE_FAST_CONCATENATION -#define QT_NO_CAST_FROM_ASCII -#define QT_NO_CAST_TO_ASCII -#endif - -#if SCENARIO == 3 -// this is the "no harm done" version. Only operator% is active, -// with NO_CAST * _not_ defined -#define P % -#undef QT_USE_FAST_OPERATOR_PLUS -#undef QT_USE_FAST_CONCATENATION -#undef QT_NO_CAST_FROM_ASCII -#undef QT_NO_CAST_TO_ASCII -#endif - -#if SCENARIO == 4 -// this is the "full" version. Operator+ is replaced by a QStringBuilder -// based version -// with NO_CAST * _not_ defined -#define P + -#define QT_USE_FAST_OPERATOR_PLUS -#define QT_USE_FAST_CONCATENATION -#undef QT_NO_CAST_FROM_ASCII -#undef QT_NO_CAST_TO_ASCII -#endif - -#include -#include "stringbuilder.h" - -//TESTED_CLASS=QStringBuilder -//TESTED_FILES=qstringbuilder.cpp - #define LITERAL "some literal" -void tst_QStringBuilder::scenario() +void runScenario() { QLatin1Literal l1literal(LITERAL); QLatin1String l1string(LITERAL); @@ -129,5 +77,3 @@ void tst_QStringBuilder::scenario() QCOMPARE(r, r2); #endif } - -QTEST_APPLESS_MAIN(tst_QStringBuilder) diff --git a/tests/auto/qstringbuilder1/stringbuilder.h b/tests/auto/qstringbuilder1/stringbuilder.h deleted file mode 100644 index 5ac9dbea82..0000000000 --- a/tests/auto/qstringbuilder1/stringbuilder.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TST_QSTRINGBUILDER_H -#define TST_QSTRINGBUILDER_H - -#include - -class tst_QStringBuilder : public QObject -{ - Q_OBJECT - -private slots: - void scenario(); -}; - -#endif diff --git a/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp index bd2e4b0c65..d0a613c572 100644 --- a/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp +++ b/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp @@ -39,4 +39,35 @@ ** ****************************************************************************/ -#include "../qstringbuilder1/stringbuilder.cpp" + +// SCENARIO 1 +// this is the "no harm done" version. Only operator% is active, +// with NO_CAST * defined +#define P % +#undef QT_USE_FAST_OPERATOR_PLUS +#undef QT_USE_FAST_CONCATENATION +#define QT_NO_CAST_FROM_ASCII +#define QT_NO_CAST_TO_ASCII + + +#include + +//TESTED_CLASS=QStringBuilder +//TESTED_FILES=qstringbuilder.cpp + +#define LITERAL "some literal" + +void runScenario(); // Defined in stringbuilder.cpp #included below. + +class tst_QStringBuilder1 : public QObject +{ + Q_OBJECT + +private slots: + void scenario() { runScenario(); } +}; + +#include "stringbuilder.cpp" +#include "tst_qstringbuilder1.moc" + +QTEST_APPLESS_MAIN(tst_QStringBuilder1) -- cgit v1.2.1