Skip to content

Commit cb750b4

Browse files
committed
qt6, test: Use qWarning() instead of QWARN() macro
The `QWARN()` macro internally uses `QTest::qWarn()`, which has been deprecated since Qt 6.3. Replacing it with `qWarning()` ensures compatibility across all Qt versions.
1 parent d812cf1 commit cb750b4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/qt/test/addressbooktests.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ void AddressBookTests::addressBookTests()
222222
// framework when it tries to look up unimplemented cocoa functions,
223223
// and fails to handle returned nulls
224224
// (https://bugreports.qt.io/browse/QTBUG-49686).
225-
QWARN("Skipping AddressBookTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
226-
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
225+
qWarning() << "Skipping AddressBookTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
226+
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.";
227227
return;
228228
}
229229
#endif

src/qt/test/apptests.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ void AppTests::appTests()
6060
// framework when it tries to look up unimplemented cocoa functions,
6161
// and fails to handle returned nulls
6262
// (https://bugreports.qt.io/browse/QTBUG-49686).
63-
QWARN("Skipping AppTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
64-
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
63+
qWarning() << "Skipping AppTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
64+
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.";
6565
return;
6666
}
6767
#endif

src/qt/test/test_main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int main(int argc, char* argv[])
5858
gArgs.ForceSetArg("-natpmp", "0");
5959

6060
std::string error;
61-
if (!gArgs.ReadConfigFiles(error, true)) QWARN(error.c_str());
61+
if (!gArgs.ReadConfigFiles(error, true)) qWarning() << error.c_str();
6262

6363
// Prefer the "minimal" platform for the test instead of the normal default
6464
// platform ("xcb", "windows", or "cocoa") so tests can't unintentionally

src/qt/test/wallettests.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,8 @@ void WalletTests::walletTests()
475475
// framework when it tries to look up unimplemented cocoa functions,
476476
// and fails to handle returned nulls
477477
// (https://bugreports.qt.io/browse/QTBUG-49686).
478-
QWARN("Skipping WalletTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
479-
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
478+
qWarning() << "Skipping WalletTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
479+
"with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.";
480480
return;
481481
}
482482
#endif

0 commit comments

Comments
 (0)