File: test-call.c

package info (click to toggle)
phosh 0.53.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,936 kB
  • sloc: ansic: 83,383; xml: 3,981; python: 717; sh: 449; makefile: 34; lisp: 22; javascript: 6
file content (41 lines) | stat: -rw-r--r-- 745 bytes parent folder | download | duplicates (5)
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
#include <call-ui.h>

static void
test_utils (void)
{
  char *duration;

  duration = cui_call_format_duration (0);
  g_assert_cmpstr (duration, ==, "00:00");
  g_free (duration);
  
  duration = cui_call_format_duration (600.03);
  g_assert_cmpstr (duration, ==, "10:00");
  g_free (duration);
    
  duration = cui_call_format_duration (3600.00);
  g_assert_cmpstr (duration, ==, "60:00");
  g_free (duration);
  
  duration = cui_call_format_duration (3601.00);
  g_assert_cmpstr (duration, ==, "1:00:01");
  g_free (duration);
}


int
main (int   argc,
      char *argv[])
{
  int retval;

  g_test_init (&argc, &argv, NULL);

  g_test_add_func ("/CallUI/utils", test_utils);

  retval = g_test_run ();

  cui_uninit ();

  return retval;
}