/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
104 by Gustav Hartvigsson
* Passing arguments can not be initialised from within a function...
1
#include "../libssts/SimpleTypeSystem.h"
39 by Gustav Hartvigsson
* Added "check" target for testing.
2
#include "error.h"
3
#include "test_macros.h"
4
104 by Gustav Hartvigsson
* Passing arguments can not be initialised from within a function...
5
void
6
_internal_print_error (SDynamicArray * arr, schar * str, spointer data) {
7
    s_print ("YO!");
8
  s_print ("(Error Test): %s\n", str);
9
  s_print ("YO!");
10
}
11
39 by Gustav Hartvigsson
* Added "check" target for testing.
12
int test_error () {
13
  setup_unit ();
104 by Gustav Hartvigsson
* Passing arguments can not be initialised from within a function...
14
15
  SDynamicArray * arr = NULL;
16
39 by Gustav Hartvigsson
* Added "check" target for testing.
17
  SError * e = NULL;
104 by Gustav Hartvigsson
* Passing arguments can not be initialised from within a function...
18
  schar * s = NULL;
19
20
  schar * expected_string = NULL;
21
22
  e =s_error_new ();
23
  test_case (e != NULL, "Error is not NULL");
24
25
  s_error_append (e, S_ERROR_NONE, "Nothing!", S_ERROR_GET_DEFAULT_DOMAIN);
26
27
  arr = s_error_to_string_array (e);
28
29
  s_dynamic_array_for_each (arr, FOREACHFUNC(_internal_print_error), NULL);
30
31
  s_print ("Hello!");
32
33
  s_error_teardown ();
39 by Gustav Hartvigsson
* Added "check" target for testing.
34
  end_unit ();
5.2.5 by Gustav Hartvigsson
Woops, foregot the test of the Error Objects...
35
}