diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2022-10-21 22:23:04 +0300 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2022-10-26 14:57:40 +0300 |
commit | c7b93d471d763b5e7986305deb4d0d83d7b69068 (patch) | |
tree | f066523b848f4a78bd98ab783cdf6fbd8c64b1fe /tests/auto/other | |
parent | 6c832731304414932fafa10c300707192e11e751 (diff) |
Android: delete dead code for tst_android under tests/auto/other/android
This amends 23780891a50ba678714f7e0a4cf43a0f8164b440 which moved the.txt
test to tets/auto/corelib/platform/android and kept the old location
mistakenly.
Pick-to: 6.4 6.2
Change-Id: If58422f9a94cfe4d6a941cc5453d8f0506057dcb
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'tests/auto/other')
-rw-r--r-- | tests/auto/other/android/CMakeLists.txt | 24 | ||||
-rw-r--r-- | tests/auto/other/android/testdata/assets/test.txt | 1 | ||||
-rw-r--r-- | tests/auto/other/android/tst_android.cpp | 57 |
3 files changed, 0 insertions, 82 deletions
diff --git a/tests/auto/other/android/CMakeLists.txt b/tests/auto/other/android/CMakeLists.txt deleted file mode 100644 index 2444679f9c..0000000000 --- a/tests/auto/other/android/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -# Generated from android.pro. - -##################################################################### -## tst_android Test: -##################################################################### - -qt_internal_add_test(tst_android - SOURCES - tst_android.cpp -) - -if(ANDROID) - set_property(TARGET tst_android APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR - ${CMAKE_CURRENT_SOURCE_DIR}/testdata - ) - # QTBUG-88840 # special case - qt_android_generate_deployment_settings(tst_android) # special case -endif() - -#### Keys ignored in scope 1:.:.:android.pro:<TRUE>: -# DISTFILES = "testdata/assets/test.txt" diff --git a/tests/auto/other/android/testdata/assets/test.txt b/tests/auto/other/android/testdata/assets/test.txt deleted file mode 100644 index 61e2c47c25..0000000000 --- a/tests/auto/other/android/testdata/assets/test.txt +++ /dev/null @@ -1 +0,0 @@ -FooBar
\ No newline at end of file diff --git a/tests/auto/other/android/tst_android.cpp b/tests/auto/other/android/tst_android.cpp deleted file mode 100644 index 938ff3c9b2..0000000000 --- a/tests/auto/other/android/tst_android.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#include <jni.h> - -#include <QTest> -#include <QtCore/qnativeinterface.h> -#include <QtCore/qjniobject.h> - -class tst_Android : public QObject -{ -Q_OBJECT -private slots: - void assetsRead(); - void assetsNotWritable(); - void testAndroidSdkVersion(); - void testAndroidActivity(); -}; - -void tst_Android::assetsRead() -{ - { - QFile file(QStringLiteral("assets:/test.txt")); - QVERIFY(file.open(QIODevice::ReadOnly)); - QCOMPARE(file.readAll(), QByteArray("FooBar")); - } - - { - QFile file(QStringLiteral("assets:/test.txt")); - QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); - QCOMPARE(file.readAll(), QByteArray("FooBar")); - } -} - -void tst_Android::assetsNotWritable() -{ - QFile file(QStringLiteral("assets:/test.txt")); - QVERIFY(!file.open(QIODevice::WriteOnly)); - QVERIFY(!file.open(QIODevice::ReadWrite)); - QVERIFY(!file.open(QIODevice::Append)); -} - -void tst_Android::testAndroidSdkVersion() -{ - QVERIFY(QNativeInterface::QAndroidApplication::sdkVersion() > 0); -} - -void tst_Android::testAndroidActivity() -{ - QJniObject activity = QNativeInterface::QAndroidApplication::context(); - QVERIFY(activity.isValid()); - QVERIFY(activity.callMethod<jboolean>("isTaskRoot")); -} - -QTEST_MAIN(tst_Android) -#include "tst_android.moc" - |