]> git.0d.be Git - empathy.git/blob - tests/empathy-utils-test.c
port check-empathy-utils.c to GTest
[empathy.git] / tests / empathy-utils-test.c
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4
5 #include <glib.h>
6
7 #include <libempathy/empathy-utils.h>
8
9 static void
10 test_init (int argc,
11     char **argv)
12 {
13   g_test_init (&argc, &argv, NULL);
14   g_type_init ();
15 }
16
17 static void
18 test_deinit (void)
19 {
20   ;
21 }
22
23 static void
24 test_substring (void)
25 {
26   gchar *tmp;
27
28   tmp = empathy_substring ("empathy", 2, 6);
29   g_assert (tmp != NULL);
30   g_assert (strcmp (tmp, "path") == 0);
31
32   g_free (tmp);
33 }
34
35 int
36 main (int argc,
37     char **argv)
38 {
39   int result;
40
41   test_init (argc, argv);
42
43   g_test_add_func ("/utils/substring", test_substring);
44
45   result = g_test_run ();
46   test_deinit ();
47   return result;
48 }