[glib: 2/3] Added test case for g_dbus_is_error_name
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/3] Added test case for g_dbus_is_error_name
- Date: Wed, 16 Jun 2021 10:58:05 +0000 (UTC)
commit a70df97c636d23a4673d715d10e22b5fbaa833f4
Author: nitinosiris <nitinwartkar58 gmail com>
Date: Tue Jun 15 21:34:52 2021 +0530
Added test case for g_dbus_is_error_name
gio/gdbusmessage.c | 2 +-
gio/tests/gdbus-names.c | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index e36d1fe88..cdc0b83e8 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -3204,7 +3204,7 @@ g_dbus_message_set_error_name (GDBusMessage *message,
const gchar *value)
{
g_return_if_fail (G_IS_DBUS_MESSAGE (message));
- g_return_if_fail (value == NULL || g_dbus_is_interface_name (value));
+ g_return_if_fail (value == NULL || g_dbus_is_error_name (value));
set_string_header (message, G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME, value);
}
diff --git a/gio/tests/gdbus-names.c b/gio/tests/gdbus-names.c
index 89bccb83d..8504220a9 100644
--- a/gio/tests/gdbus-names.c
+++ b/gio/tests/gdbus-names.c
@@ -1162,9 +1162,15 @@ test_validate_names (void)
g_assert (!g_dbus_is_unique_name (names[n].string));
if (names[n].interface)
- g_assert (g_dbus_is_interface_name (names[n].string));
+ {
+ g_assert (g_dbus_is_interface_name (names[n].string));
+ g_assert (g_dbus_is_error_name (names[n].string));
+ }
else
- g_assert (!g_dbus_is_interface_name (names[n].string));
+ {
+ g_assert (!g_dbus_is_interface_name (names[n].string));
+ g_assert (!g_dbus_is_error_name (names[n].string));
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]