/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
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
#include "../libssts/SimpleTypeSystem.h"
#include "callback.h"
#include "test_macros.h"

int
test_callback_test_func1 (SObject * obj, spointer user_data) {
  return 2;
}

spointer
test_callback_test_func2 (SObject * obj, spointer user_data) {

  return NULL;
}

enum {
  TEST_CALLBACK1,
  TEST_CALLBACK2,
  TEST_CALLBACK_END
};

static SCallbackEntry * callback_entries[] = {NULL,};

int test_callback (void) {
  setup_unit ();

  SObject * obj = s_object_new ();

  callback_entries[TEST_CALLBACK1] =
    s_callback_entry_new ("test1",
                          test_callback_test_func1,
                          S_CALLBACK_CALLBACK);

  callback_entries[TEST_CALLBACK2] =
    s_callback_entry_new ("test2",
                          test_callback_test_func2,
                          S_CALLBACK_CALLBACK);

  s_object_install_callbacks (obj, TEST_CALLBACK_END ,callback_entries);

  s_object_free (obj);

  end_unit ();
}