YongHao Hu : msvcp120/tests: Simplify tests by using todo_wine_if.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Feb 19 08:56:20 CST 2016


Module: wine
Branch: master
Commit: 43bcc0d597a4e089d3e211a1a4053521108b8899
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=43bcc0d597a4e089d3e211a1a4053521108b8899

Author: YongHao Hu <christopherwuy at gmail.com>
Date:   Fri Feb 19 00:44:37 2016 +0800

msvcp120/tests: Simplify tests by using todo_wine_if.

Signed-off-by: YongHao Hu <christopherwuy at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcp120/tests/msvcp120.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index 77a6050..1aaa251 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -966,14 +966,9 @@ static void test_tr2_sys__Copy_file(void)
     for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) {
         errno = 0xdeadbeef;
         ret = p_tr2_sys__Copy_file(tests[i].source, tests[i].dest, tests[i].fail_if_exists);
-        if(tests[i].is_todo)
-            todo_wine ok(ret == tests[i].last_error || ret == tests[i].last_error2,
-                    "test_tr2_sys__Copy_file(): test %d expect: %d, got %d\n",
-                    i+1, tests[i].last_error, ret);
-        else
+        todo_wine_if(tests[i].is_todo)
             ok(ret == tests[i].last_error || ret == tests[i].last_error2,
-                    "test_tr2_sys__Copy_file(): test %d expect: %d, got %d\n",
-                    i+1, tests[i].last_error, ret);
+                    "test_tr2_sys__Copy_file(): test %d expect: %d, got %d\n", i+1, tests[i].last_error, ret);
         ok(errno == 0xdeadbeef, "test_tr2_sys__Copy_file(): test %d errno expect 0xdeadbeef, got %d\n", i+1, errno);
         if(ret == ERROR_SUCCESS)
             ok(p_tr2_sys__File_size(tests[i].source) == p_tr2_sys__File_size(tests[i].dest),
@@ -1166,10 +1161,7 @@ static void test_tr2_sys__Stat(void)
     for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) {
         err_code = 0xdeadbeef;
         val = p_tr2_sys__Stat(tests[i].path, &err_code);
-        if(tests[i].is_todo)
-            todo_wine ok(tests[i].ret == val, "tr2_sys__Stat(): test %d expect: %d, got %d\n",
-                    i+1, tests[i].ret, val);
-        else
+        todo_wine_if(tests[i].is_todo)
             ok(tests[i].ret == val, "tr2_sys__Stat(): test %d expect: %d, got %d\n", i+1, tests[i].ret, val);
         ok(tests[i].err_code == err_code, "tr2_sys__Stat(): test %d err_code expect: %d, got %d\n",
                 i+1, tests[i].err_code, err_code);
@@ -1177,12 +1169,8 @@ static void test_tr2_sys__Stat(void)
         /* test tr2_sys__Lstat */
         err_code = 0xdeadbeef;
         val = p_tr2_sys__Lstat(tests[i].path, &err_code);
-        if(tests[i].is_todo)
-            todo_wine ok(tests[i].ret == val, "tr2_sys__Lstat(): test %d expect: %d, got %d\n",
-                    i+1, tests[i].ret, val);
-        else
+        todo_wine_if(tests[i].is_todo)
             ok(tests[i].ret == val, "tr2_sys__Lstat(): test %d expect: %d, got %d\n", i+1, tests[i].ret, val);
-
         ok(tests[i].err_code == err_code, "tr2_sys__Lstat(): test %d err_code expect: %d, got %d\n",
                 i+1, tests[i].err_code, err_code);
     }




More information about the wine-cvs mailing list