summaryrefslogtreecommitdiffstats
path: root/src/test-text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test-text.c')
-rw-r--r--src/test-text.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test-text.c b/src/test-text.c
new file mode 100644
index 0000000..37bc3a6
--- /dev/null
+++ b/src/test-text.c
@@ -0,0 +1,42 @@
+#include "ibus.h"
+
+int main()
+{
+ g_type_init ();
+
+ IBusText *text1;
+ IBusText *text2;
+ IBusMessage *message;
+ IBusError *error;
+ gboolean retval;
+
+ text1 = ibus_text_new_from_string ("Hello");
+ text2 = ibus_text_new_from_static_string ("Hello");
+
+ message = ibus_message_new_signal ("/org/freedesktop/IBus",
+ "org.freedesktop.IBus",
+ "Test");
+
+ retval = ibus_message_append_args (message,
+ IBUS_TYPE_SERIALIZABLE, &text1,
+ IBUS_TYPE_SERIALIZABLE, &text2,
+ G_TYPE_INVALID);
+ g_assert (retval);
+ g_object_unref (text1);
+ g_object_unref (text2);
+
+ retval = ibus_message_get_args (message,
+ &error,
+ IBUS_TYPE_SERIALIZABLE, &text1,
+ IBUS_TYPE_SERIALIZABLE, &text2,
+ G_TYPE_INVALID);
+ g_assert (retval);
+ g_assert_cmpstr (text1->text, ==, "Hello");
+ g_assert_cmpstr (text2->text, ==, "Hello");
+
+ g_object_unref (text1);
+ g_object_unref (text2);
+
+ return 0;
+
+}