aboutsummaryrefslogtreecommitdiffstats
path: root/tests/empathy-utils-test.c
blob: 415526ff3333d9afcb13cbbc7e786b749bb285b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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;
}