[Telepathy-commits] [telepathy-glib/master] Add test-availability-cmp
Xavier Claessens
xclaesse at gmail.com
Mon Sep 22 10:20:48 PDT 2008
---
.gitignore | 1 +
tests/Makefile.am | 6 ++++++
tests/test-availability-cmp.c | 16 ++++++++++++++++
3 files changed, 23 insertions(+), 0 deletions(-)
create mode 100644 tests/test-availability-cmp.c
diff --git a/.gitignore b/.gitignore
index b46b56a..32e44c7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,6 +71,7 @@ tests/dbus/test-invalidated-while-invoking-signals
tests/dbus/test-properties
tests/dbus/test-unsupported-interface
tests/test-asv
+tests/test-availability-cmp
tests/test-heap
tests/test-internal-debug
tests/test-intset
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 87dd04a..70d78df 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -6,6 +6,7 @@ SUBDIRS = \
DYNAMIC_TESTS = \
test-asv \
+ test-availability-cmp \
test-heap \
test-intset \
test-util
@@ -55,6 +56,11 @@ test_intset_SOURCES = \
test_intset_LDADD = \
$(top_builddir)/telepathy-glib/libtelepathy-glib.la
+test_availability_cmp_SOURCES = \
+ test-availability-cmp.c
+test_availability_cmp_LDADD = \
+ $(top_builddir)/telepathy-glib/libtelepathy-glib.la
+
# this needs to link against the static convenience library so that
# _tp_debug is still visible
test_internal_debug_SOURCES = \
diff --git a/tests/test-availability-cmp.c b/tests/test-availability-cmp.c
new file mode 100644
index 0000000..56ce828
--- /dev/null
+++ b/tests/test-availability-cmp.c
@@ -0,0 +1,16 @@
+#include <glib.h>
+#include <telepathy-glib/connection.h>
+
+int main (int argc, char **argv)
+{
+ g_assert (tp_connection_presence_type_cmp_availability (
+ TP_CONNECTION_PRESENCE_TYPE_AWAY, TP_CONNECTION_PRESENCE_TYPE_UNSET) == 1);
+
+ g_assert (tp_connection_presence_type_cmp_availability (
+ TP_CONNECTION_PRESENCE_TYPE_BUSY, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE) == -1);
+
+ g_assert (tp_connection_presence_type_cmp_availability (
+ TP_CONNECTION_PRESENCE_TYPE_UNKNOWN, 100) == 0);
+
+ return 0;
+}
--
1.5.6.5
More information about the Telepathy-commits
mailing list