summaryrefslogtreecommitdiff
path: root/tests/test-tpl-conf.c
diff options
context:
space:
mode:
authorCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-02-01 15:38:10 +0000
committerCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-02-01 15:38:10 +0000
commitf08161df2b0e9f46271a5bb3ba5a15694642b169 (patch)
tree47342081c0b14ff6151fa3347335bfbbed5af8b7 /tests/test-tpl-conf.c
parentf9e7d06dfb68dceb66fa7abac603a621e02198d9 (diff)
imported tests from telepathy-gabble
* test folder imported from telepathy-gabble, twisted/ still not working but cleaned-up of clearly useless tests. it still needs a further clean-up and adaptation in order to be used. * basic C tests written * autotools (configure and Makefile .au) updated for Python and Twisted checking. * autotools (configure and Makefile .au) updated for DBus and DBus-glib basic requirement
Diffstat (limited to 'tests/test-tpl-conf.c')
-rw-r--r--tests/test-tpl-conf.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test-tpl-conf.c b/tests/test-tpl-conf.c
new file mode 100644
index 0000000..2319c34
--- /dev/null
+++ b/tests/test-tpl-conf.c
@@ -0,0 +1,30 @@
+#include <telepathy-logger/conf.h>
+
+int
+main (int argc, char **argv)
+{
+ TplConf *conf, *conf2;
+
+ g_type_init ();
+
+ conf = tpl_conf_dup ();
+
+ /* TplConf is a singleton, be sure both point to the same memory */
+ conf2 = tpl_conf_dup ();
+ g_assert (conf == conf2);
+
+ /* unref the second singleton pointer and check that the it is still
+ * valid: checking correct object ref-counting after each _dup() call */
+ g_object_unref (conf2);
+ g_assert (TPL_IS_CONF (conf));
+
+ /* it points to the same mem area, it should be still valid */
+ g_assert (TPL_IS_CONF (conf2));
+
+ /* proper disposal for the singleton when no references are present */
+ g_object_unref (conf);
+ g_assert (!TPL_IS_CONF (conf));
+
+ return 0;
+}
+