+
+#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;
+
+ mytest_str("Empty string and separator", "", "", "");
+ mytest_str("Empty string", "", "##", "");
+ mytest_str("Empty separator", "toto", "", "toto");
+ mytest_str("String with no separator in it", "toto", "##", "toto");
+ mytest_str("Basic test", "toto##tutu", "##", "totoXXXtutu");
+}