Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Constify pointer and reference local variables in src/xbt/.
[simgrid.git] / src / xbt / dict_test.cpp
index 8fe2f65..2045fa4 100644 (file)
@@ -192,7 +192,7 @@ TEST_CASE("xbt::dict: dict data container", "dict")
 
     /* RETRIEVE */
     INFO("Search 123");
-    char* data = (char*)xbt_dict_get(head, "123");
+    const char* data = (char*)xbt_dict_get(head, "123");
     REQUIRE((data && strcmp("123", data) == 0));
 
     search_not_found(head, "Can't be found");
@@ -299,7 +299,7 @@ TEST_CASE("xbt::dict: dict data container", "dict")
       INFO("using 1000 elements with " << SIZEOFKEY << " chars long randomized keys.");
       xbt_dict_t head = xbt_dict_new_homogeneous(free);
       for (int j = 0; j < 1000; j++) {
-        char* data = nullptr;
+        const char* data = nullptr;
         char* key  = (char*)xbt_malloc(SIZEOFKEY);
 
         do {