diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-15 23:21:44 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-22 18:08:44 +0200 |
commit | 34e64b8bb4e54185d3235a9d8cd15cd446eb20c1 (patch) | |
tree | 5dcc35a4b62c3041075b03e16c3eba91d879a455 /tests | |
parent | b6d24bad6ce6f52624467a4fe4043caee6e59ab4 (diff) | |
download | qtlocation-34e64b8bb4e54185d3235a9d8cd15cd446eb20c1.tar.gz |
Cleanup: QPlaceContent and subclasses (2/3)
Remove deprecated APIs entirely, and add them as gone to the
changes documentation.
Change-Id: If55339881142b0fddc3f045d8c5a0eca0490c727
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/auto/qplaceeditorial/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/auto/qplaceeditorial/tst_qplaceeditorial.cpp | 123 | ||||
-rw-r--r-- | tests/auto/qplaceimage/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/auto/qplaceimage/tst_qplaceimage.cpp | 124 | ||||
-rw-r--r-- | tests/auto/qplacereview/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/auto/qplacereview/tst_qplacereview.cpp | 172 |
7 files changed, 0 insertions, 443 deletions
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 6a014f33..ed347367 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -9,15 +9,12 @@ if(TARGET Qt::Location) add_subdirectory(qplacecontactdetail) add_subdirectory(qplacecontentrequest) add_subdirectory(qplacedetailsreply) - add_subdirectory(qplaceeditorial) add_subdirectory(qplacematchreply) add_subdirectory(qplacematchrequest) - add_subdirectory(qplaceimage) add_subdirectory(qplaceratings) add_subdirectory(qplaceresult) add_subdirectory(qproposedsearchresult) add_subdirectory(qplacereply) - add_subdirectory(qplacereview) add_subdirectory(qplacesearchrequest) add_subdirectory(qplacesupplier) add_subdirectory(qplacesearchresult) diff --git a/tests/auto/qplaceeditorial/CMakeLists.txt b/tests/auto/qplaceeditorial/CMakeLists.txt deleted file mode 100644 index 53e82744..00000000 --- a/tests/auto/qplaceeditorial/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -qt_internal_add_test(tst_qplaceeditorial - SOURCES - tst_qplaceeditorial.cpp - LIBRARIES - Qt::Core - Qt::Location -) diff --git a/tests/auto/qplaceeditorial/tst_qplaceeditorial.cpp b/tests/auto/qplaceeditorial/tst_qplaceeditorial.cpp deleted file mode 100644 index 934d94b0..00000000 --- a/tests/auto/qplaceeditorial/tst_qplaceeditorial.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtCore/QString> -#include <QtTest/QtTest> - -#include <QtLocation/QPlaceEditorial> -#include <QtLocation/QPlaceSupplier> -#include <QtLocation/QPlaceUser> - -#include "../utils/qlocationtestutils_p.h" - -QT_USE_NAMESPACE - -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - -class tst_QPlaceEditorial : public QObject -{ - Q_OBJECT - -public: - tst_QPlaceEditorial(); - -private Q_SLOTS: - void constructorTest(); - void supplierTest(); - void textTest(); - void titleTest(); - void languageTest(); - void operatorsTest(); -}; - -tst_QPlaceEditorial::tst_QPlaceEditorial() -{ -} - -void tst_QPlaceEditorial::constructorTest() -{ - QPlaceEditorial testObj; - testObj.setText("testId"); - QPlaceEditorial *testObjPtr = new QPlaceEditorial(testObj); - QVERIFY2(testObjPtr != NULL, "Copy constructor - null"); - QVERIFY2(*testObjPtr == testObj, "Copy constructor - compare"); - delete testObjPtr; -} - -void tst_QPlaceEditorial::supplierTest() -{ - QPlaceEditorial testObj; - QVERIFY2(testObj.supplier().supplierId() == QString(), "Wrong default value"); - QPlaceSupplier sup; - sup.setName("testName1"); - sup.setSupplierId("testId"); - testObj.setSupplier(sup); - QVERIFY2(testObj.supplier() == sup, "Wrong value returned"); -} - -void tst_QPlaceEditorial::textTest() -{ - QPlaceEditorial testObj; - QVERIFY2(testObj.text() == QString(), "Wrong default value"); - testObj.setText("testText"); - QVERIFY2(testObj.text() == "testText", "Wrong value returned"); -} - -void tst_QPlaceEditorial::titleTest() -{ - QPlaceEditorial testObj; - QVERIFY2(testObj.title() == QString(), "Wrong default value"); - testObj.setTitle("testText"); - QVERIFY2(testObj.title() == "testText", "Wrong value returned"); -} - -void tst_QPlaceEditorial::languageTest() -{ - QPlaceEditorial testObj; - QVERIFY2(testObj.language() == QString(), "Wrong default value"); - testObj.setLanguage("testText"); - QVERIFY2(testObj.language() == "testText", "Wrong value returned"); -} - -void tst_QPlaceEditorial::operatorsTest() -{ - QPlaceEditorial testObj; - testObj.setLanguage("testValue"); - QPlaceEditorial testObj2; - testObj2 = testObj; - QVERIFY2(testObj == testObj2, "Not copied correctly"); - testObj2.setText("testValue2"); - QVERIFY2(testObj != testObj2, "Object should be different"); -} - -QT_WARNING_POP - -QTEST_APPLESS_MAIN(tst_QPlaceEditorial); - -#include "tst_qplaceeditorial.moc" diff --git a/tests/auto/qplaceimage/CMakeLists.txt b/tests/auto/qplaceimage/CMakeLists.txt deleted file mode 100644 index e88f0621..00000000 --- a/tests/auto/qplaceimage/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -qt_internal_add_test(tst_qplaceimage - SOURCES - tst_qplaceimage.cpp - LIBRARIES - Qt::Core - Qt::Location -) diff --git a/tests/auto/qplaceimage/tst_qplaceimage.cpp b/tests/auto/qplaceimage/tst_qplaceimage.cpp deleted file mode 100644 index a67eedd8..00000000 --- a/tests/auto/qplaceimage/tst_qplaceimage.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtCore/QString> -#include <QtLocation/QPlaceImage> -#include <QtLocation/QPlaceUser> -#include <QtLocation/QPlaceSupplier> -#include <QtTest/QtTest> - -#include "../utils/qlocationtestutils_p.h" - -QT_USE_NAMESPACE - -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - -class tst_QPlaceImage : public QObject -{ - Q_OBJECT - -public: - tst_QPlaceImage(); - -private Q_SLOTS: - void constructorTest(); - void supplierTest(); - void idTest(); - void mimeTypeTest(); - void attributionTest(); - void operatorsTest(); -}; - -tst_QPlaceImage::tst_QPlaceImage() -{ -} - -void tst_QPlaceImage::constructorTest() -{ - QPlaceImage testObj; - testObj.setImageId("testId"); - QPlaceImage *testObjPtr = new QPlaceImage(testObj); - QVERIFY2(testObjPtr != NULL, "Copy constructor - null"); - QVERIFY2(*testObjPtr == testObj, "Copy constructor - compare"); - delete testObjPtr; -} - -void tst_QPlaceImage::supplierTest() -{ - QPlaceImage testObj; - QVERIFY2(testObj.supplier().supplierId() == QString(), "Wrong default value"); - QPlaceSupplier sup; - sup.setName("testName1"); - sup.setSupplierId("testId"); - testObj.setSupplier(sup); - QVERIFY2(testObj.supplier() == sup, "Wrong value returned"); -} - -void tst_QPlaceImage::idTest() -{ - QPlaceImage testObj; - QVERIFY2(testObj.imageId() == QString(), "Wrong default value"); - testObj.setImageId("testText"); - QVERIFY2(testObj.imageId() == "testText", "Wrong value returned"); -} - -void tst_QPlaceImage::mimeTypeTest() -{ - QPlaceImage testObj; - QVERIFY2(testObj.mimeType() == QString(), "Wrong default value"); - testObj.setMimeType("testText"); - QVERIFY2(testObj.mimeType() == "testText", "Wrong value returned"); -} - -void tst_QPlaceImage::attributionTest() -{ - QPlaceImage image; - QVERIFY(image.attribution().isEmpty()); - image.setAttribution(QStringLiteral("Brought to you by acme")); - QCOMPARE(image.attribution(), QStringLiteral("Brought to you by acme")); - image.setAttribution(QString()); - QVERIFY(image.attribution().isEmpty()); -} - -void tst_QPlaceImage::operatorsTest() -{ - QPlaceImage testObj; - testObj.setMimeType("testValue"); - QPlaceImage testObj2; - testObj2 = testObj; - QVERIFY2(testObj == testObj2, "Not copied correctly"); - testObj2.setImageId("testValue2"); - QVERIFY2(testObj != testObj2, "Object should be different"); -} - -QT_WARNING_POP - -QTEST_APPLESS_MAIN(tst_QPlaceImage); - -#include "tst_qplaceimage.moc" diff --git a/tests/auto/qplacereview/CMakeLists.txt b/tests/auto/qplacereview/CMakeLists.txt deleted file mode 100644 index dfc485bd..00000000 --- a/tests/auto/qplacereview/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -qt_internal_add_test(tst_qplacereview - SOURCES - tst_qplacereview.cpp - LIBRARIES - Qt::Core - Qt::Location -) diff --git a/tests/auto/qplacereview/tst_qplacereview.cpp b/tests/auto/qplacereview/tst_qplacereview.cpp deleted file mode 100644 index b1607434..00000000 --- a/tests/auto/qplacereview/tst_qplacereview.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtCore/QString> -#include <QtTest/QtTest> - -#include <QtLocation/QPlaceReview> -#include <QtLocation/QPlaceSupplier> -#include <QtLocation/QPlaceUser> - -#include "../utils/qlocationtestutils_p.h" - -QT_USE_NAMESPACE - -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - -class tst_QPlaceReview : public QObject -{ - Q_OBJECT - -public: - tst_QPlaceReview(); - -private Q_SLOTS: - void constructorTest(); - void supplierTest(); - void dateTest(); - void textTest(); - void languageTest(); - void ratingTest(); - void reviewIdTest(); - void titleTest(); - void userTest(); - void operatorsTest(); -}; - -tst_QPlaceReview::tst_QPlaceReview() -{ -} - -void tst_QPlaceReview::constructorTest() -{ - QPlaceReview testObj; - testObj.setLanguage("testId"); - QPlaceReview *testObjPtr = new QPlaceReview(testObj); - QVERIFY2(testObjPtr != NULL, "Copy constructor - null"); - QVERIFY2(*testObjPtr == testObj, "Copy constructor - compare"); - delete testObjPtr; -} - -void tst_QPlaceReview::supplierTest() -{ - QPlaceReview testObj; - QVERIFY2(testObj.supplier().supplierId() == QString(), "Wrong default value"); - QPlaceSupplier sup; - sup.setName("testName1"); - sup.setSupplierId("testId"); - testObj.setSupplier(sup); - QVERIFY2(testObj.supplier() == sup, "Wrong value returned"); -} - -void tst_QPlaceReview::dateTest() -{ - QPlaceReview testObj; - QCOMPARE(testObj.dateTime(), QDateTime()); - - QDateTime dt = QDateTime::currentDateTime(); - testObj.setDateTime(dt); - QCOMPARE(testObj.dateTime(), dt); -} - -void tst_QPlaceReview::textTest() -{ - QPlaceReview testObj; - QVERIFY2(testObj.text() == QString(), "Wrong default value"); - testObj.setText("testText"); - QVERIFY2(testObj.text() == "testText", "Wrong value returned"); -} - -void tst_QPlaceReview::languageTest() -{ - QPlaceReview testObj; - QVERIFY2(testObj.language() == QString(), "Wrong default value"); - testObj.setLanguage("testText"); - QVERIFY2(testObj.language() == "testText", "Wrong value returned"); -} - -void tst_QPlaceReview::ratingTest() -{ - QPlaceReview testObj; - QVERIFY2(testObj.rating() == 0, "Wrong default value"); - testObj.setRating(-10); - QCOMPARE(testObj.rating(), -10.0); - testObj.setRating(3.4); - QCOMPARE(testObj.rating(), 3.4); -} - -void tst_QPlaceReview::operatorsTest() -{ - QPlaceReview testObj; - testObj.setText("testValue"); - QPlaceReview testObj2; - testObj2 = testObj; - QVERIFY2(testObj == testObj2, "Not copied correctly"); - testObj2.setLanguage("testValue2"); - QVERIFY2(testObj != testObj2, "Object should be different"); -} - -void tst_QPlaceReview::reviewIdTest() -{ - QPlaceReview testObj; - QVERIFY2(testObj.reviewId() == QString(), "Wrong default value"); - testObj.setReviewId("testText"); - QVERIFY2(testObj.reviewId() == "testText", "Wrong value returned"); -} -void tst_QPlaceReview::titleTest() -{ - QPlaceReview testObj; - QVERIFY2(testObj.title() == QString(), "Wrong default value"); - testObj.setTitle("testText"); - QVERIFY2(testObj.title() == "testText", "Wrong value returned"); -} - -void tst_QPlaceReview::userTest() -{ - QPlaceReview review; - QVERIFY(review.user().userId().isEmpty()); - QVERIFY(review.user().name().isEmpty()); - QPlaceUser user; - user.setUserId(QStringLiteral("11111")); - user.setName(QStringLiteral("Bob")); - - review.setUser(user); - QCOMPARE(review.user().userId(), QStringLiteral("11111")); - QCOMPARE(review.user().name(), QStringLiteral("Bob")); - - review.setUser(QPlaceUser()); - QVERIFY(review.user().userId().isEmpty()); - QVERIFY(review.user().name().isEmpty()); -} - -QT_WARNING_POP - -QTEST_APPLESS_MAIN(tst_QPlaceReview) - -#include "tst_qplacereview.moc" |