mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Added network to UNIT tests (needed for CUrl
Other includes where needed
This commit is contained in:
committed by
Mat Sutcliffe
parent
458daa4532
commit
74be3fa8c2
@@ -14,6 +14,7 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include "blackmisc/typetraits.h"
|
#include "blackmisc/typetraits.h"
|
||||||
#include "blackmisc/integersequence.h"
|
#include "blackmisc/integersequence.h"
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -23,17 +24,17 @@ namespace BlackMisc
|
|||||||
|
|
||||||
// Our own version of C++17 std::invoke().
|
// Our own version of C++17 std::invoke().
|
||||||
template <typename F, typename T, typename = std::enable_if_t<std::is_member_object_pointer<F>::value>>
|
template <typename F, typename T, typename = std::enable_if_t<std::is_member_object_pointer<F>::value>>
|
||||||
decltype(auto) invoke(F ptr, T &&object)
|
decltype(auto) invoke(F ptr, T && object)
|
||||||
{
|
{
|
||||||
return std::forward<T>(object).*ptr;
|
return std::forward<T>(object).*ptr;
|
||||||
}
|
}
|
||||||
template <typename F, typename T, typename... Ts, typename = std::enable_if_t<std::is_member_function_pointer<F>::value>>
|
template <typename F, typename T, typename... Ts, typename = std::enable_if_t<std::is_member_function_pointer<F>::value>>
|
||||||
decltype(auto) invoke(F ptr, T &&object, Ts &&... args)
|
decltype(auto) invoke(F ptr, T && object, Ts && ... args)
|
||||||
{
|
{
|
||||||
return (std::forward<T>(object).*ptr)(std::forward<Ts>(args)...);
|
return (std::forward<T>(object).*ptr)(std::forward<Ts>(args)...);
|
||||||
}
|
}
|
||||||
template <typename F, typename... Ts, typename = std::enable_if_t<! std::is_member_pointer<std::decay_t<F>>::value>>
|
template < typename F, typename... Ts, typename = std::enable_if_t < ! std::is_member_pointer<std::decay_t<F>>::value >>
|
||||||
decltype(auto) invoke(F &&func, Ts &&... args)
|
decltype(auto) invoke(F && func, Ts && ... args)
|
||||||
{
|
{
|
||||||
return std::forward<F>(func)(std::forward<Ts>(args)...);
|
return std::forward<F>(func)(std::forward<Ts>(args)...);
|
||||||
}
|
}
|
||||||
@@ -54,7 +55,7 @@ namespace BlackMisc
|
|||||||
template <typename F, typename T, typename... Ts>
|
template <typename F, typename T, typename... Ts>
|
||||||
decltype(auto) invokeSlot(F &&func, T *object, Ts &&... args)
|
decltype(auto) invokeSlot(F &&func, T *object, Ts &&... args)
|
||||||
{
|
{
|
||||||
using seq = MaskSequence<std::make_index_sequence<sizeof...(Ts)>, ! TIsQPrivateSignal<std::decay_t<Ts>>::value...>;
|
using seq = MaskSequence < std::make_index_sequence<sizeof...(Ts)>, ! TIsQPrivateSignal<std::decay_t<Ts>>::value... >;
|
||||||
return invokeSlotImpl(std::forward<F>(func), object, std::forward_as_tuple(std::forward<Ts>(args)...), seq(), std::is_member_pointer<std::decay_t<F>>());
|
return invokeSlotImpl(std::forward<F>(func), object, std::forward_as_tuple(std::forward<Ts>(args)...), seq(), std::is_member_pointer<std::decay_t<F>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
#ifndef BLACKMISC_NETWORK_URL_H
|
#ifndef BLACKMISC_NETWORK_URL_H
|
||||||
#define BLACKMISC_NETWORK_URL_H
|
#define BLACKMISC_NETWORK_URL_H
|
||||||
|
|
||||||
#include "blackmisc/blackmiscexport.h"
|
|
||||||
#include "blackmisc/metaclass.h"
|
#include "blackmisc/metaclass.h"
|
||||||
#include "blackmisc/propertyindex.h"
|
#include "blackmisc/propertyindex.h"
|
||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
#include "blackmisc/variant.h"
|
#include "blackmisc/variant.h"
|
||||||
|
#include "blackmisc/blackmiscexport.h"
|
||||||
|
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ namespace BlackWxPlugin
|
|||||||
m_maxRange = range;
|
m_maxRange = range;
|
||||||
if (m_gribData.isEmpty())
|
if (m_gribData.isEmpty())
|
||||||
{
|
{
|
||||||
if (!sApp->isInternetAccessible())
|
if (!sApp || !sApp->isInternetAccessible())
|
||||||
{
|
{
|
||||||
CLogMessage(this).error(u"No weather download since network/internet not accessible");
|
CLogMessage(this).error(u"No weather download since network/internet not accessible");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus testlib
|
QT += core dbus testlib network
|
||||||
|
|
||||||
TARGET = testflightplan
|
TARGET = testflightplan
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus testlib
|
QT += core dbus testlib network
|
||||||
|
|
||||||
TARGET = testxplane
|
TARGET = testxplane
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus testlib
|
QT += core dbus testlib network
|
||||||
|
|
||||||
TARGET = testdatastream
|
TARGET = testdatastream
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus testlib
|
QT += core dbus testlib network
|
||||||
|
|
||||||
TARGET = testdbus
|
TARGET = testdbus
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus testlib
|
QT += core dbus testlib network
|
||||||
|
|
||||||
TARGET = testpropertyindex
|
TARGET = testpropertyindex
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus testlib
|
QT += core dbus testlib network
|
||||||
|
|
||||||
TARGET = teststringutils
|
TARGET = teststringutils
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus testlib
|
QT += core dbus testlib network
|
||||||
|
|
||||||
TARGET = testweather
|
TARGET = testweather
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|||||||
Reference in New Issue
Block a user