xbt_dict_remove_ext(dict, key, strlen(key));
}
+#ifdef XBT_USE_DEPRECATED
/**
* \brief Add data to the dict (arbitrary key)
* \param dict the container
{
xbt_dict_remove_ext(dict, (void *)&key, sizeof key);
}
-
+#endif
/**
* \brief Remove all data from the dict
traverse(head);
}
-XBT_TEST_UNIT("basic (heterogeneous)", test_dict_basic_heterogeneous, "Basic usage: change, retrieve, traverse: heterogeneous dictionary")
+XBT_TEST_UNIT("basic_heterogeneous", test_dict_basic_heterogeneous, "Basic usage: change, retrieve, traverse: heterogeneous dict")
{
basic_test(0);
}
-XBT_TEST_UNIT("basic (homogeneous)", test_dict_basic_homogeneous, "Basic usage: change, retrieve, traverse: homogeneous dictionary")
+XBT_TEST_UNIT("basic_homogeneous", test_dict_basic_homogeneous, "Basic usage: change, retrieve, traverse: homogeneous dict")
{
basic_test(1);
}
xbt_dict_free(&head);
}
-XBT_TEST_UNIT("remove (heterogeneous)", test_dict_remove_heterogeneous, "Removing some values: heterogeneous dictionary")
+XBT_TEST_UNIT("remove_heterogeneous", test_dict_remove_heterogeneous, "Removing some values: heterogeneous dict")
{
remove_test(0);
}
-XBT_TEST_UNIT("remove (homogeneous)", test_dict_remove_homogeneous, "Removing some values: homogeneous dictionary")
+XBT_TEST_UNIT("remove_homogeneous", test_dict_remove_homogeneous, "Removing some values: homogeneous dict")
{
remove_test(1);
}
xbt_dict_free(&head);
}
-static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data)
-{
- uintptr_t stored_data = 0;
- xbt_test_log("Add %zu under %zu", data, key);
-
- xbt_dicti_set(head, key, data);
- if (XBT_LOG_ISENABLED(xbt_dict, xbt_log_priority_debug)) {
- xbt_dict_dump(head, (void (*)(void *)) &printf);
- fflush(stdout);
- }
- stored_data = xbt_dicti_get(head, key);
- xbt_test_assert(stored_data == data,
- "Retrieved data (%zu) is not what I just stored (%zu) under key %zu",
- stored_data, data, key);
-}
-
-XBT_TEST_UNIT("dicti", test_dict_scalar, "Scalar data and key management")
-{
- xbt_test_add("Fill in the dictionnary");
-
- head = xbt_dict_new();
- debuged_addi(head, 12, 12);
- debuged_addi(head, 13, 13);
- debuged_addi(head, 14, 14);
- debuged_addi(head, 15, 15);
- /* Change values */
- debuged_addi(head, 12, 15);
- debuged_addi(head, 15, 2000);
- debuged_addi(head, 15, 3000);
- /* 0 as key */
- debuged_addi(head, 0, 1000);
- debuged_addi(head, 0, 2000);
- debuged_addi(head, 0, 3000);
- /* 0 as value */
- debuged_addi(head, 12, 0);
- debuged_addi(head, 13, 0);
- debuged_addi(head, 12, 0);
- debuged_addi(head, 0, 0);
-
- xbt_dict_free(&head);
-}
-
#define NB_ELM 20000
#define SIZEOFKEY 1024
static int countelems(xbt_dict_t head)
xbt_dynar_free(&keys);
- /* if (verbose>0)
- xbt_dict_dump(mdict,&xbt_dict_print); */
-
xbt_dict_free(&mdict);
xbt_dynar_free(&keys);