https://git.reactos.org/?p=reactos.git;a=commitdiff;h=396b49436ccbdb3675306…
commit 396b49436ccbdb367530603ddc2683112ef4f62b
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Oct 20 20:23:38 2021 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Oct 20 20:23:38 2021 +0900
[IMM32_APITEST] Fix himc testcase crash (#4036)
- Add NULL checks for pIC.
CORE-11700
---
modules/rostests/apitests/imm32/himc.c | 46 +++++++++++++++++-----------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/modules/rostests/apitests/imm32/himc.c
b/modules/rostests/apitests/imm32/himc.c
index 6383c8865b2..05ba76448ca 100644
--- a/modules/rostests/apitests/imm32/himc.c
+++ b/modules/rostests/apitests/imm32/himc.c
@@ -43,29 +43,29 @@ START_TEST(himc)
ok(hIMC != NULL, "\n");
pIC = ImmLockIMC(hIMC);
ok(pIC != NULL, "\n");
- ok(pIC->hWnd == NULL, "\n");
- ok(!pIC->fOpen, "\n");
- ok(ImmGetIMCCSize(pIC->hCompStr) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hCandInfo) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hGuideLine) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hPrivate) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hMsgBuf) != 0, "\n");
+ ok(pIC && pIC->hWnd == NULL, "\n");
+ ok(pIC && !pIC->fOpen, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hCompStr) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hCandInfo) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hGuideLine) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hPrivate) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hMsgBuf) != 0, "\n");
ImmUnlockIMC(hNewIMC);
SetFocus(hwndEdit);
pIC = ImmLockIMC(hIMC);
ok(pIC != NULL, "\n");
- ok(pIC->hWnd == hwndEdit, "\n");
- ok(!pIC->fOpen, "\n");
+ ok(pIC && pIC->hWnd == hwndEdit, "\n");
+ ok(pIC && !pIC->fOpen, "\n");
ImmUnlockIMC(hNewIMC);
SetFocus(NULL);
pIC = ImmLockIMC(hIMC);
ok(pIC != NULL, "\n");
- ok(pIC->hWnd == hwndEdit, "\n");
+ ok(pIC && pIC->hWnd == hwndEdit, "\n");
ImmUnlockIMC(hNewIMC);
ok(ImmSetOpenStatus(hIMC, TRUE), "\n");
pIC = ImmLockIMC(hIMC);
ok(pIC != NULL, "\n");
- ok(pIC->fOpen, "\n");
+ ok(pIC && pIC->fOpen, "\n");
ImmUnlockIMC(hNewIMC);
ok(ImmReleaseContext(hwndEdit, hIMC), "\n");
@@ -73,12 +73,12 @@ START_TEST(himc)
ok(hIMC != NULL, "\n");
pIC = ImmLockIMC(hIMC);
ok(pIC != NULL, "\n");
- ok(pIC->hWnd == hwndEdit, "\n");
- ok(ImmGetIMCCSize(pIC->hCompStr) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hCandInfo) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hGuideLine) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hPrivate) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hMsgBuf) != 0, "\n");
+ ok(pIC && pIC->hWnd == hwndEdit, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hCompStr) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hCandInfo) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hGuideLine) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hPrivate) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hMsgBuf) != 0, "\n");
ImmUnlockIMC(hNewIMC);
ok(ImmReleaseContext(hwndEdit, hIMC), "\n");
@@ -97,12 +97,12 @@ START_TEST(himc)
ok(hIMC != hOldIMC, "\n");
pIC = ImmLockIMC(hNewIMC);
ok(pIC != NULL, "\n");
- ok(pIC->hWnd == NULL, "\n");
- ok(ImmGetIMCCSize(pIC->hCompStr) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hCandInfo) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hGuideLine) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hPrivate) != 0, "\n");
- ok(ImmGetIMCCSize(pIC->hMsgBuf) != 0, "\n");
+ ok(pIC && pIC->hWnd == NULL, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hCompStr) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hCandInfo) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hGuideLine) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hPrivate) != 0, "\n");
+ ok(pIC && ImmGetIMCCSize(pIC->hMsgBuf) != 0, "\n");
ImmUnlockIMC(hNewIMC);
ok(ImmReleaseContext(hwndEdit, hIMC), "\n");
ok(ImmDestroyContext(hNewIMC), "\n");