/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
#include "../libssts/SimpleTypeSystem.h"
#include "error.h"
#include "test_macros.h"

void
_internal_print_error (SDynamicArray * arr, schar * str, spointer data) {
    s_print ("YO!");
  s_print ("(Error Test): %s\n", str);
  s_print ("YO!");
}

int test_error () {
  setup_unit ();

  SDynamicArray * arr = NULL;

  SError * e = NULL;
  schar * s = NULL;

  schar * expected_string = NULL;

  e =s_error_new ();
  test_case (e != NULL, "Error is not NULL");

  s_error_append (e, S_ERROR_NONE, "Nothing!", S_ERROR_GET_DEFAULT_DOMAIN);

  arr = s_error_to_string_array (e);

  s_dynamic_array_for_each (arr, FOREACHFUNC(_internal_print_error), NULL);

  s_print ("Hello!");

  s_error_teardown ();
  end_unit ();
}