summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-04-16 13:28:14 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-04-16 13:28:14 +0100
commit886da3f151dec0b28dd90f5ed97d6578ff3e2bea (patch)
tree2d484af6a0135e228d5e3ccc4966d6b7e9a2f727
parenteea9fecdc168f7372b97cde462c0ade7cdbb17cc (diff)
Test _tp_capabilities_new (NULL, ?)
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/capabilities.c15
2 files changed, 9 insertions, 10 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cb0cb0d4c..0197dd329 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -47,8 +47,12 @@ EXTRA_DIST = README \
test_asv_SOURCES = \
asv.c
+# this one uses internal ABI
test_capabilities_SOURCES = \
capabilities.c
+test_capabilities_LDADD = \
+ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \
+ $(GLIB_LIBS)
test_heap_SOURCES = \
heap.c
diff --git a/tests/capabilities.c b/tests/capabilities.c
index 74765acb0..55008cd25 100644
--- a/tests/capabilities.c
+++ b/tests/capabilities.c
@@ -2,7 +2,7 @@
#include <glib.h>
-#include "telepathy-glib/capabilities.h"
+#include "telepathy-glib/capabilities-internal.h"
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/debug.h>
@@ -216,20 +216,15 @@ test_supports (Test *test,
g_object_unref (caps);
/* TpCapabilities containing no caps */
- classes = g_ptr_array_sized_new (0);
-
- caps = g_object_new (TP_TYPE_CAPABILITIES,
- "channel-classes", classes,
- "contact-specific", TRUE,
- NULL);
-
- g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST,
- classes);
+ caps = _tp_capabilities_new (NULL, TRUE);
g_assert (tp_capabilities_is_specific_to_contact (caps));
g_assert (!tp_capabilities_supports_text_chats (caps));
g_assert (!tp_capabilities_supports_text_chatrooms (caps));
+ classes = tp_capabilities_get_channel_classes (caps);
+ g_assert_cmpuint (classes->len, ==, 0);
+
g_object_unref (caps);
}