diff options
author | Mrudul Pendharkar <mrudul.v.pendharkar@nokia.com> | 2012-05-18 16:13:51 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-31 13:45:30 +0200 |
commit | a63a84db1696326f3a336af04da3f9b66ae70a54 (patch) | |
tree | 1845b339dfb81a4ec54b6caf8d3bdaa01cb45125 /tests | |
parent | f839320dd7173bf5f1cda8de3d30394b09fb5ecf (diff) |
Cleaning code and removing dependency on QCoreApplication
Change-Id: Ie37bc765656ec420989460563cc0424813f2f7a9
Reviewed-by: Jaakko Korpela <jaakko.korpela@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 1 | ||||
-rw-r--r-- | tests/auto/qfeedbacknoplugins/qfeedbacknoplugins.pro | 5 | ||||
-rw-r--r-- | tests/auto/qfeedbacknoplugins/tst_qfeedbacknoplugins.cpp | 169 |
3 files changed, 0 insertions, 175 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 2d25bd1..4382f19 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -3,7 +3,6 @@ SUBDIRS += \ qfeedbackactuator \ qfeedbackhapticseffect \ qfeedbackplugin \ - qfeedbacknoplugins \ qfeedbackmmk \ qdeclarativefeedback \ diff --git a/tests/auto/qfeedbacknoplugins/qfeedbacknoplugins.pro b/tests/auto/qfeedbacknoplugins/qfeedbacknoplugins.pro deleted file mode 100644 index 2847925..0000000 --- a/tests/auto/qfeedbacknoplugins/qfeedbacknoplugins.pro +++ /dev/null @@ -1,5 +0,0 @@ -include(../auto.pri) - -QT += feedback - -SOURCES += tst_qfeedbacknoplugins.cpp diff --git a/tests/auto/qfeedbacknoplugins/tst_qfeedbacknoplugins.cpp b/tests/auto/qfeedbacknoplugins/tst_qfeedbacknoplugins.cpp deleted file mode 100644 index 7a63f8f..0000000 --- a/tests/auto/qfeedbacknoplugins/tst_qfeedbacknoplugins.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//TESTED_COMPONENT=src/feedback - -#include <QtTest/QtTest> - -#include <qfeedbackeffect.h> -#include <qfeedbackactuator.h> - -QT_USE_NAMESPACE - -class tst_QFeedbackNoPlugins : public QObject -{ - Q_OBJECT -public: - tst_QFeedbackNoPlugins(); - ~tst_QFeedbackNoPlugins(); - -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private slots: - void testHapticEffect(); - void testFileEffect(); - void testThemeEffect(); - void testActuators(); -}; - -tst_QFeedbackNoPlugins::tst_QFeedbackNoPlugins() -{ - // This turns off plugin loading in unit test builds - qApp->setProperty("QFEEDBACK_TEST_NO_PLUGINS", 1); -} - -tst_QFeedbackNoPlugins::~tst_QFeedbackNoPlugins() -{ -} - -void tst_QFeedbackNoPlugins::initTestCase() -{ -} - -void tst_QFeedbackNoPlugins::cleanupTestCase() -{ -} - -void tst_QFeedbackNoPlugins::init() -{ -} - -void tst_QFeedbackNoPlugins::cleanup() -{ -} - -void tst_QFeedbackNoPlugins::testThemeEffect() -{ - // No plugins - QVERIFY(!QFeedbackEffect::supportsThemeEffect()); - QVERIFY(!QFeedbackEffect::playThemeEffect(QFeedbackEffect::Press)); - QVERIFY(!QFeedbackEffect::playThemeEffect(QFeedbackEffect::Release)); -} - -void tst_QFeedbackNoPlugins::testFileEffect() -{ - QFeedbackFileEffect fileEffect; - QVERIFY(QFeedbackFileEffect::supportedMimeTypes().isEmpty()); - - QVERIFY(fileEffect.state() == QFeedbackEffect::Stopped); - - fileEffect.setSource(QUrl("load")); // this should call load - QVERIFY(fileEffect.state() == QFeedbackEffect::Stopped); // fail :D - QVERIFY(!fileEffect.isLoaded()); - fileEffect.setLoaded(true); - QVERIFY(!fileEffect.isLoaded()); - fileEffect.setLoaded(false); - QVERIFY(!fileEffect.isLoaded()); - fileEffect.start(); - QVERIFY(fileEffect.state() == QFeedbackEffect::Stopped); // fail :D -} - -void tst_QFeedbackNoPlugins::testHapticEffect() -{ - QFeedbackHapticsEffect testEffect; - - // it will do nothing, so stick some values in and play it. - testEffect.setAttackIntensity(0.0); - testEffect.setAttackTime(250); - testEffect.setIntensity(1.0); - testEffect.setDuration(100); - testEffect.setFadeTime(250); - testEffect.setFadeIntensity(0.0); - testEffect.start(); - QVERIFY(testEffect.state() == QFeedbackHapticsEffect::Stopped); - testEffect.pause(); - QVERIFY(testEffect.state() == QFeedbackHapticsEffect::Stopped); - testEffect.start(); - QVERIFY(testEffect.state() == QFeedbackHapticsEffect::Stopped); - testEffect.stop(); - QVERIFY(testEffect.state() == QFeedbackHapticsEffect::Stopped); -} - - -void tst_QFeedbackNoPlugins::testActuators() -{ - QList<QFeedbackActuator*> actuators = QFeedbackActuator::actuators(); - - // No plugins == no actuators - QVERIFY(actuators.isEmpty()); - - // Create a default one, anyway - QFeedbackActuator a; - - QVERIFY(a.isValid() == false); - QVERIFY(a.name().isEmpty()); - - QCOMPARE(a.isCapabilitySupported(QFeedbackActuator::Envelope), false); - QCOMPARE(a.isCapabilitySupported(QFeedbackActuator::Period), false); - - a.setEnabled(false); - QVERIFY(!a.isEnabled()); - a.setEnabled(true); - QVERIFY(!a.isEnabled()); -} - -QTEST_MAIN(tst_QFeedbackNoPlugins) - -#include "tst_qfeedbacknoplugins.moc" |