Ticket #2804: fixed defect: path_cmp: FTBFS with --enable-tests on [powerpc,s390,s390x]

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2012-06-06 12:54:04 +03:00
parent 48b4320f7d
commit ca4e66d174
1 changed files with 16 additions and 16 deletions

View File

@ -62,14 +62,14 @@ teardown (void)
}
/* --------------------------------------------------------------------------------------------- */
#define path_cmp_one_check(input1, input2, etalon) {\
#define path_cmp_one_check(input1, input2, etalon_condition) {\
vpath1 = vfs_path_from_str (input1);\
vpath2 = vfs_path_from_str (input2);\
result = vfs_path_cmp (vpath1, vpath2);\
vfs_path_free (vpath1); \
vfs_path_free (vpath2); \
fail_unless ( result == etalon, "\ninput1: %s\ninput2: %s\nexpected: %d\nactual: %d\n",\
input1, input2, etalon, result); \
fail_unless ( result etalon_condition, "\ninput1: %s\ninput2: %s\nexpected: %d\nactual: %d\n",\
input1, input2, #etalon_condition, result); \
}
START_TEST (test_path_compare)
@ -77,11 +77,11 @@ START_TEST (test_path_compare)
vfs_path_t *vpath1, *vpath2;
int result;
path_cmp_one_check ("/тестовый/путь", "/тестовый/путь", 0);
path_cmp_one_check ("/тестовый/путь", "/тестовый/путь", ==0);
path_cmp_one_check ("/#enc:KOI8-R/тестовый/путь", "/тестовый/путь", -174);
path_cmp_one_check ("/#enc:KOI8-R/тестовый/путь", "/тестовый/путь", <0);
path_cmp_one_check ("/тестовый/путь", "/#enc:KOI8-R/тестовый/путь", 174);
path_cmp_one_check ("/тестовый/путь", "/#enc:KOI8-R/тестовый/путь", >0);
path_cmp_one_check (NULL, "/тестовый/путь", -1);
path_cmp_one_check ("/тестовый/путь", NULL, -1);
@ -92,14 +92,14 @@ END_TEST
/* --------------------------------------------------------------------------------------------- */
#undef path_cmp_one_check
#define path_cmp_one_check(input1, input2, len, etalon) {\
#define path_cmp_one_check(input1, input2, len, etalon_condition) {\
vpath1 = vfs_path_from_str (input1);\
vpath2 = vfs_path_from_str (input2);\
result = vfs_path_ncmp (vpath1, vpath2, len);\
vfs_path_free (vpath1); \
vfs_path_free (vpath2); \
fail_unless ( result == etalon, "\ninput1: %s\ninput2: %s\nexpected: %d\nactual: %d\n",\
input1, input2, etalon, result); \
fail_unless ( result etalon_condition, "\ninput1: %s\ninput2: %s\nexpected: %d\nactual: %d\n",\
input1, input2, #etalon_condition, result); \
}
START_TEST (test_path_compare_len)
@ -107,17 +107,17 @@ START_TEST (test_path_compare_len)
vfs_path_t *vpath1, *vpath2;
int result;
path_cmp_one_check ("/тестовый/путь", "/тестовый/путь", 10, 0);
path_cmp_one_check ("/тестовый/путь", "/тестовый/путь", 10, ==0);
path_cmp_one_check ("/тест/овый/путь", "/тестовый/путь", 10, -161);
path_cmp_one_check ("/тест/овый/путь", "/тестовый/путь", 10, <0);
path_cmp_one_check ("/тестовый/путь", "/тест/овый/путь", 10, 161);
path_cmp_one_check ("/тестовый/путь", "/тест/овый/путь", 10, >0);
path_cmp_one_check ("/тест/овый/путь", "/тестовый/путь", 9, 0);
path_cmp_one_check ("/тест/овый/путь", "/тестовый/путь", 9, ==0);
path_cmp_one_check (NULL, "/тестовый/путь", 0, -1);
path_cmp_one_check ("/тестовый/путь", NULL, 0, -1);
path_cmp_one_check (NULL, NULL, 0, -1);
path_cmp_one_check (NULL, "/тестовый/путь", 0, <0);
path_cmp_one_check ("/тестовый/путь", NULL, 0, <0);
path_cmp_one_check (NULL, NULL, 0, <0);
}
END_TEST