/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to tests/to_string.c

  • Committer: Gustav Hartvigsson
  • Date: 2016-02-01 14:11:35 UTC
  • mto: This revision was merged to the branch mainline in revision 122.
  • Revision ID: gustav.hartvigsson@gmail.com-20160201141135-pcl4m4gcf8r7t11e
* Made the GC switchable at rutime (once) when compiled with S_USE_GC set.
* replaced:
  * malloc ->   s_malloc
  * free ->     s_free
  * realloc ->  s_realloc
  * calloc ->   s_calloc

* Made s_[malloc, calloc, free, realloc] functions and moved them to their own file.
  This can be used os basis for other memory stuffs in the future, if we want to use
  a Slab allocator or something else.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
  setup_unit();
6
6
  char * m_str = NULL;
7
7
  SObject * obj = NULL;
8
 
  
 
8
 
9
9
  obj = s_object_new ();
10
10
  m_str = s_object_to_string (obj);
11
 
  
 
11
 
12
12
  test_case (m_str != NULL, "String is not NULL.");
13
 
  
 
13
 
14
14
  test_case (strcmp (m_str, "(SObject, References: 1)") == 0, "string has as the correct value.");
15
 
  
 
15
 
16
16
  s_print ("The string is: \"%s\"\n", m_str);
17
 
  
 
17
 
18
18
  s_object_unref (obj);
19
 
  free (m_str);
20
 
  
 
19
  s_free (m_str);
 
20
 
21
21
  end_unit();
22
22
}
23
23