Android: delete dead code for tst_android under tests/auto/other/android
This amends 23780891a5 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>
bb10
parent
6c83273130
commit
c7b93d471d
|
|
@ -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"
|
||||
|
|
@ -1 +0,0 @@
|
|||
FooBar
|
||||
|
|
@ -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"
|
||||
|
||||
Loading…
Reference in New Issue