/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/test_macros.h

  • 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:
32
32
 
33
33
#define setup_suite(sn)                                         \
34
34
  char * current_time () {                                      \
35
 
     char * ret_val = malloc (21);                              \
 
35
     char * ret_val = s_malloc (21);                              \
36
36
     time_t t = time (NULL);                                    \
37
37
     strftime (ret_val, 50,"%F %T", localtime (&t));            \
38
38
     return ret_val;                                            \
41
41
  char * t_str = current_time();                                \
42
42
  fprintf (stdout, YELLOW "[%s]\n[STARTING TEST SUITE] %s\n"    \
43
43
  RESET, t_str, suit_name);                                     \
44
 
  free (t_str);                                                 \
 
44
  s_free (t_str);                                                 \
45
45
  unsigned int total_fails = 0;                                 \
46
46
  unsigned int test_suites_failed = 0;                          \
47
47
  unsigned int tmp_val = 0;
92
92
    fprintf (stdout, GREEN "[%s]\n[TEST UNIT PASS] %s\n" RESET, \
93
93
      t_str, name);                                             \
94
94
  }                                                             \
95
 
  free (t_str);
 
95
  s_free (t_str);
96
96
 
97
97
#endif /* __H_TEST__ */