/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
109.1.1 by Gustav Hartvigsson
* SMap seems to be broken... Or could it be SObject's Callback stuff? Or SLinkedList?
1
#include "../libssts/SimpleTypeSystem.h"
2
#include "callback.h"
3
#include "test_macros.h"
4
5
int
6
test_callback_test_func1 (SObject * obj, spointer user_data) {
7
  return 2;
8
}
9
10
spointer
11
test_callback_test_func2 (SObject * obj, spointer user_data) {
12
13
  return NULL;
14
}
15
16
enum {
17
  TEST_CALLBACK1,
18
  TEST_CALLBACK2,
19
  TEST_CALLBACK_END
20
};
21
22
static SCallbackEntry * callback_entries[] = {NULL,};
23
24
int test_callback (void) {
25
  setup_unit ();
26
27
  SObject * obj = s_object_new ();
28
29
  callback_entries[TEST_CALLBACK1] =
30
    s_callback_entry_new ("test1",
31
                          test_callback_test_func1,
32
                          S_CALLBACK_CALLBACK);
33
34
  callback_entries[TEST_CALLBACK2] =
35
    s_callback_entry_new ("test2",
36
                          test_callback_test_func2,
37
                          S_CALLBACK_CALLBACK);
38
39
  s_object_install_callbacks (obj, TEST_CALLBACK_END ,callback_entries);
40
41
  s_object_free (obj);
42
43
  end_unit ();
44
}