/* GENERATED FILE, DO NOT EDIT */
/*******************************/
-#line 754 "xbt/dynar.c"
+#line 753 "xbt/dynar.c"
#define NB_ELEM 5000
XBT_TEST_UNIT("insert",test_dynar_insert,"Using the xbt_dynar_insert and xbt_dynar_remove functions")
{
xbt_dynar_t d = xbt_dynar_new(sizeof(int), NULL);
- int cursor,cpt;
+ unsigned int cursor,cpt;
xbt_test_add1("==== Insert %d int, traverse them, remove them",NB_ELEM);
/* Populate_ints [doxygen cruft] */
}
/* end_of_traversal */
+ /* Re-fill with the same values using set_as (and re-verify) */
+ for (cpt = 0; cpt < NB_ELEM; cpt++)
+ xbt_dynar_set_as(d, cpt, int, cpt);
+ xbt_dynar_foreach(d, cursor, cpt)
+ xbt_test_assert2(cursor == cpt,
+ "The retrieved value is not the same than the injected one (%d!=%d)",
+ cursor, cpt);
+
for (cpt = 0; cpt < NB_ELEM; cpt++) {
int val;
xbt_dynar_remove_at(d,0,&val);
cursor, cpt);
}
xbt_test_assert1(xbt_dynar_length(d) == 0,
- "There is still %d elements in the dynar after removing everything",
+ "There is still %lu elements in the dynar after removing everything",
xbt_dynar_length(d));
xbt_dynar_free(&d);
cursor, cpt);
}
xbt_test_assert1(xbt_dynar_length(d) == 0,
- "There is still %d elements in the dynar after removing everything",
+ "There is still %lu elements in the dynar after removing everything",
xbt_dynar_length(d));
xbt_dynar_free(&d);
}