Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The windows implementation of simgrid use now the portable snprintf so, enable the...
[simgrid.git] / src / xbt / swag.c
index 17b2c89..873724b 100644 (file)
@@ -29,10 +29,7 @@ xbt_swag_t xbt_swag_new(size_t offset)
 {
   xbt_swag_t swag = xbt_new0(s_xbt_swag_t, 1);
 
-  swag->tail = NULL;
-  swag->head = NULL;
-  swag->offset = offset;
-  swag->count = 0;
+  xbt_swag_init(swag, offset);
 
   return swag;
 }
@@ -286,6 +283,9 @@ XBT_TEST_UNIT("basic",test_swag_basic,"Basic usage") {
 
   xbt_test_assert(xbt_swag_size(setA) == 2);
   xbt_test_assert(xbt_swag_size(setB) == 1);
+   
+  xbt_swag_free(setA);
+  xbt_swag_free(setB);
 }
 
 #endif /* SIMGRID_TEST */