/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
39 by Gustav Hartvigsson
* Added "check" target for testing.
1
#include "to_string.h"
2
#include "test_macros.h"
3
#include "SimpleTypeSystem.h"
4
int test_to_string (void) {
5
  setup_unit();
6
  char * m_str = NULL;
7
  SObject * obj = NULL;
121.1.3 by Gustav Hartvigsson
* Made the GC switchable at rutime (once) when compiled with S_USE_GC set.
8
39 by Gustav Hartvigsson
* Added "check" target for testing.
9
  obj = s_object_new ();
10
  m_str = s_object_to_string (obj);
121.1.3 by Gustav Hartvigsson
* Made the GC switchable at rutime (once) when compiled with S_USE_GC set.
11
39 by Gustav Hartvigsson
* Added "check" target for testing.
12
  test_case (m_str != NULL, "String is not NULL.");
121.1.3 by Gustav Hartvigsson
* Made the GC switchable at rutime (once) when compiled with S_USE_GC set.
13
68 by Gustav Hartvigsson
* Hid internals of SDynamicArray.
14
  test_case (strcmp (m_str, "(SObject, References: 1)") == 0, "string has as the correct value.");
121.1.3 by Gustav Hartvigsson
* Made the GC switchable at rutime (once) when compiled with S_USE_GC set.
15
39 by Gustav Hartvigsson
* Added "check" target for testing.
16
  s_print ("The string is: \"%s\"\n", m_str);
121.1.3 by Gustav Hartvigsson
* Made the GC switchable at rutime (once) when compiled with S_USE_GC set.
17
39 by Gustav Hartvigsson
* Added "check" target for testing.
18
  s_object_unref (obj);
121.1.3 by Gustav Hartvigsson
* Made the GC switchable at rutime (once) when compiled with S_USE_GC set.
19
  s_free (m_str);
20
39 by Gustav Hartvigsson
* Added "check" target for testing.
21
  end_unit();
22
}
23