diff --git a/makespec/BUILDVERSION b/makespec/BUILDVERSION index a09977be..a77fd92c 100644 --- a/makespec/BUILDVERSION +++ b/makespec/BUILDVERSION @@ -1 +1 @@ -5997 +6000 diff --git a/src/base/Qv2rayLog.hpp b/src/base/Qv2rayLog.hpp index faa09350..19a9eb13 100644 --- a/src/base/Qv2rayLog.hpp +++ b/src/base/Qv2rayLog.hpp @@ -13,7 +13,7 @@ #endif #define NEWLINE "\r\n" -#define ___LOG_EXPAND(___x) , QPair(#___x, [&] { return ___x; }()) +#define ___LOG_EXPAND(___x) , QPair(std::string(#___x), [&] { return ___x; }()) #define A(...) FOREACH_CALL_FUNC(___LOG_EXPAND, __VA_ARGS__) #ifdef QT_DEBUG diff --git a/src/base/models/QvSettingsObject.hpp b/src/base/models/QvSettingsObject.hpp index 67f08002..ce0af572 100644 --- a/src/base/models/QvSettingsObject.hpp +++ b/src/base/models/QvSettingsObject.hpp @@ -177,7 +177,11 @@ namespace Qv2ray::base::config { config_version = QV2RAY_CONFIG_VERSION; } +#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) + Q_DISABLE_COPY(Qv2rayConfigObject); +#else Q_DISABLE_COPY_MOVE(Qv2rayConfigObject); +#endif JSONSTRUCT_REGISTER_NOCOPYMOVE(Qv2rayConfigObject, // F(config_version, autoStartId, lastConnectedId, autoStartBehavior, logLevel), // F(uiConfig, advancedConfig, pluginConfig, updateConfig, kernelConfig, networkConfig), // diff --git a/src/base/models/QvStartupConfig.hpp b/src/base/models/QvStartupConfig.hpp index 31bffd21..eef993d8 100644 --- a/src/base/models/QvStartupConfig.hpp +++ b/src/base/models/QvStartupConfig.hpp @@ -21,8 +21,6 @@ namespace Qv2ray::base /// Exit existing Qv2ray instance bool exitQv2ray; - - /// }; } // namespace Qv2ray::base diff --git a/test/src/components/latency/TestRealPing.cpp b/test/src/components/latency/TestRealPing.cpp index bdd62051..cf295c9a 100644 --- a/test/src/components/latency/TestRealPing.cpp +++ b/test/src/components/latency/TestRealPing.cpp @@ -3,9 +3,35 @@ #define CATCH_CONFIG_MAIN #include "catch.hpp" +int fakeArgc = 0; +char *fakeArgv[]{}; + +class QvTestApplication + : public QCoreApplication + , public Qv2rayApplicationManager +{ + public: + explicit QvTestApplication() : QCoreApplication(fakeArgc, fakeArgv), Qv2rayApplicationManager(){}; + virtual Qv2raySetupStatus Initialize() override + { + return {}; + }; + virtual Qv2rayExitCode RunQv2ray() override + { + return {}; + }; + virtual void MessageBoxWarn(QWidget *, const QString &, const QString &, MessageOpt) override{}; + virtual void MessageBoxInfo(QWidget *, const QString &, const QString &, MessageOpt) override{}; + virtual MessageOpt MessageBoxAsk(QWidget *, const QString &, const QString &, const QList &) override + { + return {}; + }; + virtual void OpenURL(const QString &) override{}; +}; + SCENARIO("Test RealPing get proxy address", "[RealPing]") { - + QvTestApplication app; GIVEN("A realping object") { auto loop = uvw::Loop::create();