From 76b9de5b8f228f8624f7047dbd74acbfa65397bb Mon Sep 17 00:00:00 2001
From: Jiajin Cui <cuijiajin@uniontech.com>
Date: Tue, 30 Jun 2020 13:52:04 +0800
Subject: [PATCH v2 1/2] kernel32/tests: Add test for ini filename is NULL.

Signed-off-by: Jiajin Cui <cuijiajin@uniontech.com>
---
 dlls/kernel32/tests/profile.c | 46 ++++++++++++++++++++++++++++-------
 1 file changed, 37 insertions(+), 9 deletions(-)

diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c
index ce82a746e7..a28c9aa138 100644
--- a/dlls/kernel32/tests/profile.c
+++ b/dlls/kernel32/tests/profile.c
@@ -45,29 +45,56 @@ static void test_profile_int(void)
 {
     struct _profileInt profileInt[]={
          { NULL,    NULL, NULL,          NULL,     70, 0},           /*  0 */
+         { SECTION, NULL, NULL,          NULL,     -1, 4294967295U},
+         { SECTION, NULL, NULL,          NULL,      1, 1},
+         { NULL,    KEY,  NULL,          NULL,     -1, 0},
+         { NULL,    KEY,  NULL,          NULL,      1, 0},
+         { SECTION, KEY,  NULL,          NULL,     -1, 4294967295U}, /*  5 */
+         { SECTION, KEY,  NULL,          NULL,      1, 1},
          { NULL,    NULL, NULL,          TESTFILE, -1, 4294967295U},
          { NULL,    NULL, NULL,          TESTFILE,  1, 1},
          { SECTION, NULL, NULL,          TESTFILE, -1, 4294967295U},
-         { SECTION, NULL, NULL,          TESTFILE,  1, 1},
-         { NULL,    KEY,  NULL,          TESTFILE, -1, 4294967295U}, /*  5 */
+         { SECTION, NULL, NULL,          TESTFILE,  1, 1},           /* 10 */
+         { NULL,    KEY,  NULL,          TESTFILE, -1, 4294967295U},
          { NULL,    KEY,  NULL,          TESTFILE,  1, 1},
          { SECTION, KEY,  NULL,          TESTFILE, -1, 4294967295U},
          { SECTION, KEY,  NULL,          TESTFILE,  1, 1},
+         { NULL,    NULL, "1",           NULL,     70, 0},           /* 15 */
+         { SECTION, NULL, "-1",          NULL,     -1, 0},
+         { SECTION, NULL, "-1",          NULL,      1, 0},
+         { NULL,    KEY,  "-1",          NULL,     -1, 0},
+         { NULL,    KEY,  "-1",          NULL,      1, 0},
+         { SECTION, KEY,  "-1",          NULL,     -1, 4294967295U}, /* 20 */
+         { SECTION, KEY,  "-1",          NULL,      1, 4294967295U},
+         { SECTION, KEY,  "1",           NULL,     -1, 1},
+         { SECTION, KEY,  "1",           NULL,      1, 1},
+         { SECTION, KEY,  "+1",          NULL,     -1, 1},
+         { SECTION, KEY,  "+1",          NULL,      1, 1},           /* 25 */
+         { SECTION, KEY,  "4294967296",  NULL,     -1, 0},
+         { SECTION, KEY,  "4294967296",  NULL,      1, 0},
+         { SECTION, KEY,  "4294967297",  NULL,     -1, 1},
+         { SECTION, KEY,  "4294967297",  NULL,      1, 1},
+         { SECTION, KEY,  "-4294967297", NULL,     -1, 4294967295U}, /* 30 */
+         { SECTION, KEY,  "-4294967297", NULL,      1, 4294967295U},
+         { SECTION, KEY,  "42A94967297", NULL,     -1, 42},
+         { SECTION, KEY,  "42A94967297", NULL,      1, 42},
+         { SECTION, KEY,  "B4294967297", NULL,     -1, 0},
+         { SECTION, KEY,  "B4294967297", NULL,      1, 0},           /* 35 */
          { SECTION, KEY,  "-1",          TESTFILE, -1, 4294967295U},
-         { SECTION, KEY,  "-1",          TESTFILE,  1, 4294967295U}, /* 10 */
+         { SECTION, KEY,  "-1",          TESTFILE,  1, 4294967295U},
          { SECTION, KEY,  "1",           TESTFILE, -1, 1},
          { SECTION, KEY,  "1",           TESTFILE,  1, 1},
-         { SECTION, KEY,  "+1",          TESTFILE, -1, 1},
+         { SECTION, KEY,  "+1",          TESTFILE, -1, 1},           /* 40 */
          { SECTION, KEY,  "+1",          TESTFILE,  1, 1},
-         { SECTION, KEY,  "4294967296",  TESTFILE, -1, 0},           /* 15 */
+         { SECTION, KEY,  "4294967296",  TESTFILE, -1, 0},
          { SECTION, KEY,  "4294967296",  TESTFILE,  1, 0},
          { SECTION, KEY,  "4294967297",  TESTFILE, -1, 1},
-         { SECTION, KEY,  "4294967297",  TESTFILE,  1, 1},
+         { SECTION, KEY,  "4294967297",  TESTFILE,  1, 1},           /* 45 */
          { SECTION, KEY,  "-4294967297", TESTFILE, -1, 4294967295U},
-         { SECTION, KEY,  "-4294967297", TESTFILE,  1, 4294967295U}, /* 20 */
+         { SECTION, KEY,  "-4294967297", TESTFILE,  1, 4294967295U},
          { SECTION, KEY,  "42A94967297", TESTFILE, -1, 42},
          { SECTION, KEY,  "42A94967297", TESTFILE,  1, 42},
-         { SECTION, KEY,  "B4294967297", TESTFILE, -1, 0},
+         { SECTION, KEY,  "B4294967297", TESTFILE, -1, 0},           /* 50 */
          { SECTION, KEY,  "B4294967297", TESTFILE,  1, 0},
     };
     int i, num_test = ARRAY_SIZE(profileInt);
@@ -81,7 +108,8 @@ static void test_profile_int(void)
                                       profileInt[i].iniFile);
 
        res = GetPrivateProfileIntA(profileInt[i].section, profileInt[i].key, 
-                 profileInt[i].defaultVal, profileInt[i].iniFile); 
+                 profileInt[i].defaultVal, profileInt[i].iniFile);
+       todo_wine_if(i == 0 || i == 3 || i == 4)
        ok((res == profileInt[i].result), "test<%02d>: ret<%010u> exp<%010u>\n",
             i, res, profileInt[i].result);
     }
-- 
2.20.1

