/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: 2015-04-08 18:25:07 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150408182507-094jw13yhmi3bhfu
* Added "check" target for testing.
* Changed SRC to SSTS_SRC for future proofing.
* Removed a few "_" from before some struct names. It is not needed.
* Re-wrote how s_object_to_string () works on SError's. Should be faster now, but less safe...
  * To make this work I added SErrorTypeName string array. (Need to surpress the errer it creats).
* Re-orderd SErrorType enum.
* Use s_string_new_fmt () the default method for s_object_to_string ().
* Changed to strdup in some functions in utils.c.
* Added s_current_time () function to get an ISO time string.
* Added some more documentation to utils.h
* !DEBUG -> DEBUG in utils.h
* Added more tests to the test suite.
* Re-Wrote test_macros.h to display time, making it a lil' bit nicer to look at.

Show diffs side-by-side

added added

removed removed

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