tst_QApplication: Remove test windowsCommandLine().

According to history, the test was supposed to verify
the correct parsing of the command line on Windows by the qWinCmdLine()
function in corelib. It did not test anything since the test
application printed out argv[1] instead of
QCoreApplication::arguments()[1]. Since qWinCmdLine() has been replaced
by the WinAPI CommandLineToArgvW(), the test no longer makes sense
and also starts to fail then warnings are printed to the error output.

Change-Id: Idf642783ebb56eaa8fba9004174557485563a84f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
bb10
Friedemann Kleint 2015-07-29 09:21:38 +02:00
parent 93cb984174
commit 318f62748b
4 changed files with 0 additions and 88 deletions

View File

@ -2,6 +2,5 @@ TEMPLATE = subdirs
SUBDIRS = desktopsettingsaware modal
win32:!wince: SUBDIRS += wincmdline
test.depends += $$SUBDIRS
SUBDIRS += test

View File

@ -162,9 +162,6 @@ private slots:
void setAttribute();
void windowsCommandLine_data();
void windowsCommandLine();
void touchEventPropagation();
void qtbug_12673();
@ -1933,39 +1930,6 @@ void tst_QApplication::setAttribute()
delete w;
}
void tst_QApplication::windowsCommandLine_data()
{
#if defined(Q_OS_WIN)
QTest::addColumn<QString>("args");
QTest::addColumn<QString>("expected");
QTest::newRow("hello world")
<< QString("Hello \"World\"")
<< QString("Hello \"World\"");
QTest::newRow("sql")
<< QString("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PNR' AND TABLE_TYPE = 'VIEW' ORDER BY TABLE_NAME")
<< QString("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PNR' AND TABLE_TYPE = 'VIEW' ORDER BY TABLE_NAME");
#endif
}
void tst_QApplication::windowsCommandLine()
{
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
QFETCH(QString, args);
QFETCH(QString, expected);
QProcess testProcess;
const QString path = QStringLiteral("wincmdline/wincmdline");
testProcess.start(path, QStringList(args));
QVERIFY2(testProcess.waitForStarted(),
qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
QVERIFY(testProcess.waitForFinished(10000));
QByteArray error = testProcess.readAllStandardError();
QString procError(error);
QCOMPARE(procError, expected);
#endif
}
class TouchEventPropagationTestWidget : public QWidget
{
Q_OBJECT

View File

@ -1,46 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** 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 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QApplication>
#include <stdio.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
if (argc > 1)
fprintf(stderr, "%s", argv[1]);
else
fprintf(stderr, "Failed");
fflush(stderr);
return 0;
}

View File

@ -1,5 +0,0 @@
QT += widgets
CONFIG -= app_bundle debug_and_release_target
SOURCES += main.cpp
DESTDIR = ./