From 704ba558e1d1b18a55461e906242b4d84b42f099 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 20 Sep 2023 19:41:13 +0200 Subject: [PATCH] chore(linux): Fix bug and update documentation --- linux/ibus-keyman/src/KeymanSystemServiceClient.cpp | 2 +- linux/ibus-keyman/tests/KmDbusTestServer.cpp | 5 +++++ linux/ibus-keyman/tests/README.md | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp b/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp index 90f459d1a21..2af8226b5e3 100644 --- a/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp +++ b/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp @@ -78,7 +78,7 @@ gint32 KeymanSystemServiceClient::GetCapsLockIndicator() { KEYMAN_INTERFACE_NAME, "GetCapsLockIndicator", error, &msg, ""); if (result < 0) { g_error("%s: Failed to call method GetCapsLockIndicator: %s. %s. %s.", - __FUNCTION__, strerror(-result), error->name, error->message); + __FUNCTION__, strerror(-result), error ? error->name : "-", error ? error->message : "-"); return -1; } diff --git a/linux/ibus-keyman/tests/KmDbusTestServer.cpp b/linux/ibus-keyman/tests/KmDbusTestServer.cpp index 1d4746163d5..e64a9354d8b 100644 --- a/linux/ibus-keyman/tests/KmDbusTestServer.cpp +++ b/linux/ibus-keyman/tests/KmDbusTestServer.cpp @@ -139,6 +139,11 @@ void KmDbusTestServer::Loop() int main(int argc, char *argv[]) { + if (!g_file_test(KEYMAN_TEST_SERVICE_PATH, G_FILE_TEST_IS_DIR)) { + std::cerr << "ERROR: Directory " << KEYMAN_TEST_SERVICE_PATH << " doesn't exist! Exiting." << std::endl; + return 1; + } + KmDbusTestServer testServer; testServer.Loop(); diff --git a/linux/ibus-keyman/tests/README.md b/linux/ibus-keyman/tests/README.md index 046333be9d4..a97f85d443e 100644 --- a/linux/ibus-keyman/tests/README.md +++ b/linux/ibus-keyman/tests/README.md @@ -6,7 +6,7 @@ are stored in `~/.config/glib-2.0/settings/keyfile`. ## Running tests -The tests get run as part of building `ibus-keyman`, more specifically when running `make check`. +The tests get run as part of building `ibus-keyman`, more specifically when running `build.sh test`. ### Run all tests