- mytest("Backslashed quotes", "\\'toto tutu\\' tata", "'totoXXXtutu'XXXtata");
- mytest("Backslashed quotes + quotes", "'toto \\'tutu' tata", "toto 'tutuXXXtata");
+ mytest("Backslashed quotes", "\\'toto tutu\\' tata",
+ "'totoXXXtutu'XXXtata");
+ mytest("Backslashed quotes + quotes", "'toto \\'tutu' tata",
+ "toto 'tutuXXXtata");
+
+}
+
+#define mytest_str(name, input, separator, expected) \
+ xbt_test_add0(name); \
+ d=xbt_str_split_str(input, separator); \
+ s=xbt_str_join(d,"XXX"); \
+ xbt_test_assert3(!strcmp(s,expected),\
+ "Input (%s) leads to (%s) instead of (%s)", \
+ input,s,expected);\
+ free(s); \
+ xbt_dynar_free(&d);
+
+XBT_TEST_UNIT("xbt_str_split_str", test_split_str,"test the function xbt_str_split_str")
+{
+ xbt_dynar_t d;
+ char *s;