From ca4e66d1748dd69c31c77ae2e8e01a25a00824e7 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Wed, 6 Jun 2012 12:54:04 +0300 Subject: [PATCH] Ticket #2804: fixed defect: path_cmp: FTBFS with --enable-tests on [powerpc,s390,s390x] Signed-off-by: Slava Zanko --- tests/lib/vfs/path_cmp.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/lib/vfs/path_cmp.c b/tests/lib/vfs/path_cmp.c index 0ac217b22..08aa4419a 100644 --- a/tests/lib/vfs/path_cmp.c +++ b/tests/lib/vfs/path_cmp.c @@ -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