mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-05 16:55:25 +08:00
qt 6.5.1 original
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
qt_internal_add_test(tst_qnetworkinformation_appless
|
||||
SOURCES
|
||||
tst_qnetworkinformation_appless.cpp
|
||||
LIBRARIES
|
||||
Qt::Network
|
||||
)
|
@ -0,0 +1,42 @@
|
||||
// Copyright (C) 2021 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QtCore/qcoreapplication.h>
|
||||
#include <QtNetwork/qnetworkinformation.h>
|
||||
#include <QtTest/qtest.h>
|
||||
|
||||
class tst_QNetworkInformation_appless : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
void reinit();
|
||||
};
|
||||
|
||||
void tst_QNetworkInformation_appless::reinit()
|
||||
{
|
||||
int argc = 1;
|
||||
char name[] = "./test";
|
||||
char *argv[] = { name, nullptr };
|
||||
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
if (QNetworkInformation::availableBackends().isEmpty())
|
||||
QSKIP("No backends available!");
|
||||
|
||||
QVERIFY(QNetworkInformation::loadDefaultBackend());
|
||||
auto info = QNetworkInformation::instance();
|
||||
QVERIFY(info);
|
||||
}
|
||||
|
||||
QVERIFY(!QNetworkInformation::instance());
|
||||
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
QVERIFY(QNetworkInformation::loadDefaultBackend());
|
||||
auto info = QNetworkInformation::instance();
|
||||
QVERIFY(info);
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_QNetworkInformation_appless);
|
||||
#include "tst_qnetworkinformation_appless.moc"
|
Reference in New Issue
Block a user