diff --git a/src/plugins/simulator/fsxcommon/simconnectsymbols.cpp b/src/plugins/simulator/fsxcommon/simconnectsymbols.cpp index c4ac1fa5d..ac88fcb31 100644 --- a/src/plugins/simulator/fsxcommon/simconnectsymbols.cpp +++ b/src/plugins/simulator/fsxcommon/simconnectsymbols.cpp @@ -10,6 +10,7 @@ #include "simconnectsymbols.h" #include "blackmisc/stringutils.h" #include "blackmisc/logmessage.h" +#include "blackmisc/logcategory.h" #include #include #include @@ -117,7 +118,7 @@ bool resolveSimConnectSymbol(QLibrary &library, FuncPtr &funcPtr, const char *fu funcPtr = reinterpret_cast(library.resolve(funcName)); if (! funcPtr) { - CLogMessage(static_cast(nullptr)).error("Failed to resolve %1: %2") << funcName << library.errorString(); + CLogMessage(CLogCategory::driver()).error("Failed to resolve %1: %2") << funcName << library.errorString(); return false; } return true; @@ -208,21 +209,21 @@ bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version) const bool resolvedP3DSimConnectSymbols = resolveP3DSimConnectSymbols(simConnectDll); if (!resolvedCommon) { - CLogMessage(static_cast(nullptr)).error("Failed to resolve common symbols from SimConnect.dll: '%1'") << simConnectFileName; + CLogMessage(CLogCategory::driver()).error("Failed to resolve common symbols from SimConnect.dll: '%1'") << simConnectFileName; return false; } if (!resolvedP3DSimConnectSymbols) { - CLogMessage(static_cast(nullptr)).error("Failed to resolve P3D symbols from SimConnect.dll: '%1'") << simConnectFileName; + CLogMessage(CLogCategory::driver()).error("Failed to resolve P3D symbols from SimConnect.dll: '%1'") << simConnectFileName; return false; } - CLogMessage(static_cast(nullptr)).info("Loaded and resolved P3D symbols from SimConnect.dll: '%1'") << simConnectFileName; + CLogMessage(CLogCategory::driver()).info("Loaded and resolved P3D symbols from SimConnect.dll: '%1'") << simConnectFileName; return resolvedCommon && resolvedP3DSimConnectSymbols; } else { - CLogMessage(static_cast(nullptr)).error("Failed to load SimConnect.dll: '%1' '%2'") << simConnectFileName << simConnectDll.errorString(); + CLogMessage(CLogCategory::driver()).error("Failed to load SimConnect.dll: '%1' '%2'") << simConnectFileName << simConnectDll.errorString(); return false; } } @@ -286,7 +287,7 @@ bool loadAndResolveFsxSimConnect(bool manifestProbing) } else { - CLogMessage(static_cast(nullptr)).error("Failed to load SimConnect.dll: %1") << simConnectDll.errorString(); + CLogMessage(CLogCategory::driver()).error("Failed to load SimConnect.dll: %1") << simConnectDll.errorString(); return false; } } diff --git a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.cpp b/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.cpp index 9677a69a9..7d86de24a 100644 --- a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.cpp +++ b/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.cpp @@ -18,6 +18,7 @@ #include "plugins/simulator/fsxcommon/simconnectdatadefinition.h" #include "plugins/simulator/fsxcommon/simconnectsymbols.h" #include "plugins/simulator/fsxcommon/simulatorfsxcommon.h" + #include using namespace BlackSimPlugin::FsxCommon; @@ -26,7 +27,11 @@ namespace BlackSimPluginFsxP3D { void CSimPluginFsxP3d::resolveSymbols() { - QVERIFY2(loadAndResolveSimConnect(false), "Could not load and resolve SimConnect library!"); +#ifdef Q_OS_WIN64 + QVERIFY2(loadAndResolveP3DSimConnect(P3DSimConnectv42), "Could not load and resolve SimConnect library!"); +#else + QVERIFY2(loadAndResolveFsxSimConnect(false), "Could not load and resolve SimConnect library!"); +#endif HANDLE hSimConnect; SimConnect_Open(&hSimConnect, "Test", nullptr, 0, nullptr, 0); SimConnect_Close(hSimConnect); diff --git a/tests/tests.pro b/tests/tests.pro index e91117ead..1ddd4e1a3 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,3 +1,5 @@ +load(common_pre) + TEMPLATE = subdirs CONFIG += ordered @@ -13,3 +15,5 @@ contains(BLACK_CONFIG,FSX|P3D) { SUBDIRS += testsimpluginfsxp3d testsimpluginfsxp3d.file = blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro } + +load(common_post)