* structure creation (of type void_f_ppvoid_t or void_f_pvoid_t).
*
* \section XBT_dynar_exscal Example with scalar
- * \dontinclude dynar_int.c
+ * \dontinclude dynar.c
*
* \skip Vars_decl
* \skip dyn
* \until xbt_dynar_free
*
* \section XBT_dynar_exptr Example with pointed data
- * \dontinclude dynar_string.c
*
- * \skip doxygen_first_cruft
- * \skip f
- * \until xbt_init
+ * \skip doxygen_string_cruft
+ * \skip function
+ * \until s2
* \skip Populate_str
* \skip dyn
* \until }
* \skip macro
* \until dynar_free
- * \skip xbt_exit
+ * \skip end_of_doxygen
* \until }
*
*/
dyn = xbt_cfg_get_dynar(myset,"user");
if (xbt_dynar_length(dyn) != 3)
- xbt_test_fail1("Dynar length = %d, I expected 3",
- (int)xbt_dynar_length(dyn));
+ xbt_test_fail1("Dynar length = %d, I expected 3", (int)xbt_dynar_length(dyn));
if (strcmp(xbt_dynar_get_as(dyn,0,char*),"foo"))
- xbt_test_fail1("Dynar[0] = %s, I expected foo",
- xbt_dynar_get_as(dyn,0,char*));
+ xbt_test_fail1("Dynar[0] = %s, I expected foo", xbt_dynar_get_as(dyn,0,char*));
if (strcmp(xbt_dynar_get_as(dyn,1,char*),"bar"))
- xbt_test_fail1("Dynar[1] = %s, I expected bar",
- xbt_dynar_get_as(dyn,1,char*));
+ xbt_test_fail1("Dynar[1] = %s, I expected bar", xbt_dynar_get_as(dyn,1,char*));
if (strcmp(xbt_dynar_get_as(dyn,2,char*),"toto"))
- xbt_test_fail1("Dynar[2] = %s, I expected toto",
- xbt_dynar_get_as(dyn,2,char*));
+ xbt_test_fail1("Dynar[2] = %s, I expected toto", xbt_dynar_get_as(dyn,2,char*));
+ xbt_cfg_free(&myset);
+ }
+
+ xbt_test_add0("Access to a non-existant entry");
+ {
+ /* non-existant_entry */
+ xbt_cfg_t myset=make_set();
+ TRY {
+ xbt_cfg_set_parse(myset, "color:blue");
+ } CATCH(e) {
+ if (e.category != mismatch_error)
+ xbt_test_exception(e);
+ xbt_ex_free(e);
+ }
+ xbt_cfg_free(&myset);
}
}
#endif /* SIMGRID_TEST */