/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/map.c

  • Committer: Gustav Hartvigsson
  • Date: 2017-01-25 12:56:36 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20170125125636-t92fdnwtns3e73y3
* Fixed all warnings (exept the depricated warning...)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
void
8
8
for_each_print_map (SLinkedList * self, SMapItem * item, sint * itt) {
9
 
  s_print ("Key: \"%s\" Value: %d on iteration: %d\n", (schar *)item->key,
10
 
                                                       (sint)item->value,
 
9
  s_print ("Key: \"%s\" Value: %ld on iteration: %d\n", (schar *)item->key,
 
10
                                                       (slong)item->value,
11
11
                                                       (*itt));
12
12
  (*itt)++;
13
13
}
25
25
  
26
26
  s_map_add (map, "Hello", (spointer)(sint) 1337);
27
27
  
28
 
  test_case ((s_map_get (map, "Hello") == (sint) 1337), "The got value is the"
 
28
  test_case (((sint)(slong) s_map_get (map, "Hello") == (sint) 1337),
 
29
                                                  "The got value is the"
29
30
                                                  " same as the one added to"
30
31
                                                  " the map");
31
32
  SMapItem * item = s_map_get_item (map, "Hello");
32
 
  s_print ("The key was: %s, the Value was: %d\n", (schar *) item->key,
33
 
                                                   (sint) item->value);
 
33
  s_print ("The key was: %s, the Value was: %ld\n", (schar *) item->key,
 
34
                                                   (slong) item->value);
34
35
  
35
36
  s_print (S_COLOR_BLUE "Replacing value with a new one\n");
36
37
  
37
38
  s_map_add (map, "Hello", (spointer)(sint) 1338);
38
 
  test_case ((s_map_get (map, "Hello") == (sint) 1338), "The got value is the"
 
39
  test_case (((sint)(slong) s_map_get (map, "Hello") == (sint) 1338), "The got value is the"
39
40
                                                  " same as the one added to"
40
41
                                                  " the map");
41
42