Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Check for emptyness, and populate dynar before testing xbt_dynar_foreach_ptr.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 31 Jan 2019 15:16:37 +0000 (16:16 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 1 Feb 2019 13:30:44 +0000 (14:30 +0100)
src/xbt/dynar_test.cpp

index 808f9d0..1c02aa7 100644 (file)
@@ -79,7 +79,11 @@ TEST_CASE("xbt::dynar: generic C vector", "dynar")
       xbt_dynar_shift(d, &i);
       REQUIRE(i == cpt); // The retrieved value is not the same than the injected one
     }
+    REQUIRE(xbt_dynar_is_empty(d));
 
+    for (int cpt = 0; cpt < NB_ELEM; cpt++) {
+      xbt_dynar_push_as(d, int, -1);
+    }
     int* pi;
     xbt_dynar_foreach_ptr(d, cursor, pi) { *pi = 0; }
     xbt_dynar_foreach (d, cursor, i) {