From a3d109a32d61827ffa263e30388b265d62664b65 Mon Sep 17 00:00:00 2001 From: Pepper Gray Date: Sat, 12 Sep 2026 13:18:30 +0200 Subject: [PATCH] fix GenericErrorWhenErrnoIsUnknown test on musl testing on musl fails with error ``` sdbus-cpp/tests/unittests/Types_test.cpp:560: Failure Value of: error.getMessage() Expected: is equal to "custom message (Unknown error 123456)" Actual: "custom message (No error information)" ``` due to `musl` and `glibc` returning different error strings. Extend test to cover both messages. Closes: #544 Signed-off-by: Pepper Gray --- tests/unittests/Types_test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unittests/Types_test.cpp b/tests/unittests/Types_test.cpp index 74052651..2b7c60b8 100644 --- a/tests/unittests/Types_test.cpp +++ b/tests/unittests/Types_test.cpp @@ -557,7 +557,10 @@ TEST(AnErrorFactory, CreatesGenericErrorWhenErrnoIsUnknown) auto error = sdbus::createError(123456, "custom message"); EXPECT_THAT(error.getName(), Eq("org.freedesktop.DBus.Error.Failed")); - EXPECT_THAT(error.getMessage(), Eq("custom message (Unknown error 123456)")); + EXPECT_THAT(error.getMessage(), ::testing::AnyOf( + Eq("custom message (Unknown error 123456)"), + Eq("custom message (No error information)") + )); EXPECT_TRUE(error.isValid()); } #endif // SDBUS_basu