~macslow/notify-osd/gsettings-port

« back to all changes in this revision

Viewing changes to tests/test-stack.c

  • Committer: Mirco Müller
  • Date: 2008-11-26 12:29:04 UTC
  • Revision ID: mirco.mueller@ubuntu.com-20081126122904-gxmj7itk6bj1xz09
added glib-based unit-tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
**3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
 
3
**      10        20        30        40        50        60        70        80
 
4
**
 
5
** project:
 
6
**    alsdorf
 
7
**
 
8
** file:
 
9
**    test-stack.c
 
10
**
 
11
** author(s):
 
12
**    Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
 
13
**    David Barth <david.barth@canonical.com>
 
14
**
 
15
** copyright (C) Canonical, oct. 2008
 
16
**
 
17
*******************************************************************************/
 
18
 
 
19
#include <glib.h>
 
20
 
 
21
#include "stack.h"
 
22
 
 
23
void
 
24
test_stack_new ()
 
25
{
 
26
        Stack* stack = NULL;
 
27
 
 
28
        stack = stack_new ();
 
29
        g_assert (stack != NULL);
 
30
        stack_del (stack);
 
31
}
 
32
 
 
33
void
 
34
test_stack_del ()
 
35
{
 
36
        Stack* stack = NULL;
 
37
 
 
38
        stack = stack_new ();
 
39
        stack_del (stack);
 
40
        /*g_assert (stack == NULL);*/
 
41
}
 
42
 
 
43
void
 
44
test_stack_get_next_id ()
 
45
{
 
46
        Stack* stack = NULL;
 
47
        guint  id;
 
48
 
 
49
        stack = stack_new ();
 
50
        id = stack_get_next_id (stack);
 
51
        g_assert_cmpint (id, ==, 1);
 
52
        id = stack_get_next_id (stack);
 
53
        g_assert_cmpint (id, ==, 2);
 
54
        id = stack_get_next_id (stack);
 
55
        g_assert_cmpint (id, ==, 3);
 
56
        stack_del (stack);
 
57
}
 
58