https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7c3902e57bb1158633da3…
commit 7c3902e57bb1158633da3d0ca29e8947d4c8ec22
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Jan 2 12:54:45 2022 -0500
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Jan 2 12:54:59 2022 -0500
[IMM32_APITEST] Fix failure messages.
---
modules/rostests/apitests/imm32/himc.c | 138 +++++++++++++++++++++------------
1 file changed, 90 insertions(+), 48 deletions(-)
diff --git a/modules/rostests/apitests/imm32/himc.c
b/modules/rostests/apitests/imm32/himc.c
index 05ba76448ca..050bd324e10 100644
--- a/modules/rostests/apitests/imm32/himc.c
+++ b/modules/rostests/apitests/imm32/himc.c
@@ -16,96 +16,138 @@ START_TEST(himc)
/* ImmCreateContext/ImmDestroyContext and ImmLockIMC/ImmUnlockIMC */
hNewIMC = ImmCreateContext();
- ok(hNewIMC != NULL, "\n");
+ ok(hNewIMC != NULL, "ImmCreateContext failed\n");
pIC = ImmLockIMC(hNewIMC);
- ok(pIC == NULL, "\n");
+ ok(pIC == NULL, "ImmLockIMC succeeded unexpectedly\n");
ImmUnlockIMC(hNewIMC);
- ok(ImmDestroyContext(hNewIMC), "\n");
+ ok(ImmDestroyContext(hNewIMC), "ImmDestroyContext failed\n");
/* ImmGetContext against NULL */
hIMC = ImmGetContext(NULL);
- ok(hIMC == NULL, "\n");
+ ok(hIMC == NULL, "ImmGetContext failed\n");
/* Create EDIT control */
style = ES_MULTILINE | ES_LEFT;
hwndEdit = CreateWindowW(L"EDIT", NULL, style, 0, 0, 100, 20, NULL, NULL,
GetModuleHandleW(NULL), NULL);
- ok(hwndEdit != NULL, "\n");
+ ok(hwndEdit != NULL, "CreateWindowW failed\n");
/* Create STATIC control */
style = SS_LEFT;
hwndStatic = CreateWindowW(L"STATIC", NULL, style, 0, 30, 100, 20, NULL,
NULL,
GetModuleHandleW(NULL), NULL);
- ok(hwndStatic != NULL, "\n");
+ ok(hwndStatic != NULL, "CreateWindowW failed\n");
/* ImmGetContext/ImmReleaseContext and ImmLockIMC/ImmUnlockIMC */
hIMC1 = hIMC = ImmGetContext(hwndEdit);
- ok(hIMC != NULL, "\n");
+ ok(hIMC != NULL, "ImmGetContext failed\n");
pIC = ImmLockIMC(hIMC);
- ok(pIC != NULL, "\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");
+ ok(pIC != NULL, "ImmLockIMC failed\n");
+ if (pIC != NULL)
+ {
+ ok(pIC->hWnd == NULL, "pIC->hWnd = %p\n", pIC->hWnd);
+ ok(!pIC->fOpen, "pIC->fOpen = %d\n", pIC->fOpen);
+ ok(ImmGetIMCCSize(pIC->hCompStr) != 0, "hCompStr size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hCandInfo) != 0, "hCandInfo size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hGuideLine) != 0, "hGuideLine size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hPrivate) != 0, "hPrivate size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hMsgBuf) != 0, "hMsgBuf size is 0\n");
+ }
+ else
+ {
+ skip("No pIC\n");
+ }
ImmUnlockIMC(hNewIMC);
SetFocus(hwndEdit);
pIC = ImmLockIMC(hIMC);
- ok(pIC != NULL, "\n");
- ok(pIC && pIC->hWnd == hwndEdit, "\n");
- ok(pIC && !pIC->fOpen, "\n");
+ ok(pIC != NULL, "ImmLockIMC failed\n");
+ if (pIC != NULL)
+ {
+ ok(pIC->hWnd == hwndEdit, "pIC->hWnd = %p, expected %p\n",
pIC->hWnd, hwndEdit);
+ ok(!pIC->fOpen, "pIC->fOpen = %d\n", pIC->fOpen);
+ }
+ else
+ {
+ skip("No pIC\n");
+ }
ImmUnlockIMC(hNewIMC);
SetFocus(NULL);
pIC = ImmLockIMC(hIMC);
- ok(pIC != NULL, "\n");
- ok(pIC && pIC->hWnd == hwndEdit, "\n");
+ ok(pIC != NULL, "ImmLockIMC failed\n");
+ if (pIC != NULL)
+ {
+ ok(pIC->hWnd == hwndEdit, "pIC->hWnd = %p, expected %p\n",
pIC->hWnd, hwndEdit);
+ }
+ else
+ {
+ skip("No pIC\n");
+ }
ImmUnlockIMC(hNewIMC);
- ok(ImmSetOpenStatus(hIMC, TRUE), "\n");
+ ok(ImmSetOpenStatus(hIMC, TRUE), "ImmSetOpenStatus failed\n");
pIC = ImmLockIMC(hIMC);
- ok(pIC != NULL, "\n");
- ok(pIC && pIC->fOpen, "\n");
+ ok(pIC != NULL, "ImmLockIMC failed\n");
+ if (pIC != NULL)
+ {
+ ok(pIC->fOpen, "pIC->fOpen = %d\n", pIC->fOpen);
+ }
+ else
+ {
+ skip("No pIC\n");
+ }
ImmUnlockIMC(hNewIMC);
- ok(ImmReleaseContext(hwndEdit, hIMC), "\n");
+ ok(ImmReleaseContext(hwndEdit, hIMC), "ImmReleaseContext failed\n");
hIMC2 = hIMC = ImmGetContext(hwndStatic);
- ok(hIMC != NULL, "\n");
+ ok(hIMC != NULL, "ImmGetContext failed\n");
pIC = ImmLockIMC(hIMC);
- ok(pIC != NULL, "\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");
+ ok(pIC != NULL, "ImmLockIMC failed\n");
+ if (pIC != NULL)
+ {
+ ok(pIC->hWnd == hwndEdit, "pIC->hWnd = %p, expected %p\n",
pIC->hWnd, hwndEdit);
+ ok(ImmGetIMCCSize(pIC->hCompStr) != 0, "hCompStr size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hCandInfo) != 0, "hCandInfo size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hGuideLine) != 0, "hGuideLine size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hPrivate) != 0, "hPrivate size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hMsgBuf) != 0, "hMsgBuf size is 0\n");
+ }
+ else
+ {
+ skip("No pIC\n");
+ }
ImmUnlockIMC(hNewIMC);
- ok(ImmReleaseContext(hwndEdit, hIMC), "\n");
+ ok(ImmReleaseContext(hwndEdit, hIMC), "ImmReleaseContext failed\n");
- ok(hIMC1 == hIMC2, "\n");
+ ok(hIMC1 == hIMC2, "hIMC1 = %p, expected %p\n", hIMC1, hIMC2);
/* ImmAssociateContext */
hNewIMC = ImmCreateContext();
- ok(hNewIMC != NULL, "\n");
+ ok(hNewIMC != NULL, "ImmCreateContext failed \n");
pIC = ImmLockIMC(hNewIMC);
- ok(pIC != NULL, "\n");
+ ok(pIC != NULL, "ImmLockIMC failed\n");
ImmUnlockIMC(hNewIMC);
hOldIMC = ImmAssociateContext(hwndEdit, hNewIMC);
- ok(hNewIMC != hOldIMC, "\n");
+ ok(hNewIMC != hOldIMC, "hNewIMC = %p, expected not %p\n", hNewIMC,
hOldIMC);
hIMC = ImmGetContext(hwndEdit);
- ok(hIMC == hNewIMC, "\n");
- ok(hIMC != hOldIMC, "\n");
+ ok(hIMC == hNewIMC, "hIMC = %p, expected %p\n", hIMC, hNewIMC);
+ ok(hIMC != hOldIMC, "hIMC = %p, expected not %p\n", hIMC, hOldIMC);
pIC = ImmLockIMC(hNewIMC);
- ok(pIC != NULL, "\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");
+ ok(pIC != NULL, "ImmLockIMC failed\n");
+ if (pIC != NULL)
+ {
+ ok(pIC->hWnd == NULL, "pIC->hWnd = %p\n", pIC->hWnd);
+ ok(ImmGetIMCCSize(pIC->hCompStr) != 0, "hCompStr size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hCandInfo) != 0, "hCandInfo size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hGuideLine) != 0, "hGuideLine size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hPrivate) != 0, "hPrivate size is 0\n");
+ ok(ImmGetIMCCSize(pIC->hMsgBuf) != 0, "hMsgBuf size is 0\n");
+ }
+ else
+ {
+ skip("No pIC\n");
+ }
ImmUnlockIMC(hNewIMC);
- ok(ImmReleaseContext(hwndEdit, hIMC), "\n");
- ok(ImmDestroyContext(hNewIMC), "\n");
+ ok(ImmReleaseContext(hwndEdit, hIMC), "ImmReleaseContext failed\n");
+ ok(ImmDestroyContext(hNewIMC), "ImmDestroyContext failed\n");
DestroyWindow(hwndEdit);
DestroyWindow(hwndStatic);