Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the new xbt/str testsuite to the autogenerated
[simgrid.git] / src / xbt_str_unit.c
1 /*******************************/
2 /* GENERATED FILE, DO NOT EDIT */
3 /*******************************/
4
5 #include <stdio.h>
6 #include "xbt.h"
7 /*******************************/
8 /* GENERATED FILE, DO NOT EDIT */
9 /*******************************/
10
11 # 339 "xbt/xbt_str.c" 
12 #define mytest(name, input, expected) \
13   xbt_test_add0(name); \
14   d=xbt_str_split_quoted(input); \
15   s=xbt_str_join(d,"XXX"); \
16   xbt_test_assert3(!strcmp(s,expected),\
17                    "Input (%s) leads to (%s) instead of (%s)", \
18                    input,s,expected);\
19   free(s); \
20   xbt_dynar_free(&d);
21
22 XBT_TEST_UNIT("xbt_str_split_quoted",test_split_quoted, "test the function xbt_str_split_quoted") {
23   xbt_dynar_t d;
24   char *s;
25
26   mytest("Basic test", "toto tutu", "totoXXXtutu");
27   mytest("Useless backslashes", "\\t\\o\\t\\o \\t\\u\\t\\u", "totoXXXtutu");
28   mytest("Protected space", "toto\\ tutu", "toto tutu");
29   mytest("Several spaces", "toto   tutu", "totoXXXtutu");
30   mytest("LTriming", "  toto tatu", "totoXXXtatu");
31   mytest("Triming", "  toto   tutu  ", "totoXXXtutu");
32   mytest("Single quotes", "'toto tutu' tata", "toto tutuXXXtata");
33   mytest("Double quotes", "\"toto tutu\" tata", "toto tutuXXXtata");
34   mytest("Mixed quotes", "\"toto' 'tutu\" tata", "toto' 'tutuXXXtata");
35   mytest("Backslashed quotes", "\\'toto tutu\\' tata", "'totoXXXtutu'XXXtata");
36   mytest("Backslashed quotes + quotes", "'toto \\'tutu' tata", "toto 'tutuXXXtata");
37
38 }
39 /*******************************/
40 /* GENERATED FILE, DO NOT EDIT */
41 /*******************************/
42