aboutsummaryrefslogtreecommitdiffstats
path: root/tests/empathy-utils-test.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-27 23:44:59 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-03 20:25:01 +0800
commitf053694701a9cb6c35fa0250c1a0b3374bd54395 (patch)
treee6279a3a2c8c57b1c9ed5ed505852efd06258f81 /tests/empathy-utils-test.c
parenta97016255a79a5b26af59411eab907d2881bc63e (diff)
downloadgsoc2013-empathy-f053694701a9cb6c35fa0250c1a0b3374bd54395.tar
gsoc2013-empathy-f053694701a9cb6c35fa0250c1a0b3374bd54395.tar.gz
gsoc2013-empathy-f053694701a9cb6c35fa0250c1a0b3374bd54395.tar.bz2
gsoc2013-empathy-f053694701a9cb6c35fa0250c1a0b3374bd54395.tar.lz
gsoc2013-empathy-f053694701a9cb6c35fa0250c1a0b3374bd54395.tar.xz
gsoc2013-empathy-f053694701a9cb6c35fa0250c1a0b3374bd54395.tar.zst
gsoc2013-empathy-f053694701a9cb6c35fa0250c1a0b3374bd54395.zip
port check-empathy-utils.c to GTest
Diffstat (limited to 'tests/empathy-utils-test.c')
-rw-r--r--tests/empathy-utils-test.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/empathy-utils-test.c b/tests/empathy-utils-test.c
new file mode 100644
index 000000000..415526ff3
--- /dev/null
+++ b/tests/empathy-utils-test.c
@@ -0,0 +1,48 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <glib.h>
+
+#include <libempathy/empathy-utils.h>
+
+static void
+test_init (int argc,
+ char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+ g_type_init ();
+}
+
+static void
+test_deinit (void)
+{
+ ;
+}
+
+static void
+test_substring (void)
+{
+ gchar *tmp;
+
+ tmp = empathy_substring ("empathy", 2, 6);
+ g_assert (tmp != NULL);
+ g_assert (strcmp (tmp, "path") == 0);
+
+ g_free (tmp);
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ int result;
+
+ test_init (argc, argv);
+
+ g_test_add_func ("/utils/substring", test_substring);
+
+ result = g_test_run ();
+ test_deinit ();
+ return result;
+}