mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 10:50:23 +08:00
fix: fixed log and tests issue
This commit is contained in:
parent
264110fefd
commit
94d701ce91
@ -1 +1 @@
|
||||
5997
|
||||
6000
|
||||
|
@ -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
|
||||
|
@ -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), //
|
||||
|
@ -21,8 +21,6 @@ namespace Qv2ray::base
|
||||
|
||||
/// Exit existing Qv2ray instance
|
||||
bool exitQv2ray;
|
||||
|
||||
///
|
||||
};
|
||||
} // namespace Qv2ray::base
|
||||
|
||||
|
@ -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<MessageOpt> &) 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();
|
||||
|
Loading…
Reference in New Issue
Block a user