Alistair Leslie-Hughes : wintab32/tests: Add WTInfoA tests.

Alexandre Julliard julliard at winehq.org
Thu Apr 11 13:10:31 CDT 2019


Module: wine
Branch: master
Commit: 9b7b9fa0f53ebaf7bcb96e4af276b2b6a632f013
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9b7b9fa0f53ebaf7bcb96e4af276b2b6a632f013

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Thu Apr 11 08:23:32 2019 +0000

wintab32/tests: Add WTInfoA tests.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wintab32/tests/context.c | 64 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/dlls/wintab32/tests/context.c b/dlls/wintab32/tests/context.c
index 5f05912..3eb1315 100644
--- a/dlls/wintab32/tests/context.c
+++ b/dlls/wintab32/tests/context.c
@@ -32,8 +32,11 @@ static const UINT Y = 0;
 static const UINT WIDTH = 200;
 static const UINT HEIGHT = 200;
 
+static LOGCONTEXTA glogContext;
+
 static HCTX (WINAPI *pWTOpenA)(HWND, LPLOGCONTEXTA, BOOL);
 static BOOL (WINAPI *pWTClose)(HCTX);
+static UINT (WINAPI *pWTInfoA)(UINT, UINT, void*);
 
 static HMODULE load_functions(void)
 {
@@ -50,6 +53,7 @@ static HMODULE load_functions(void)
     }
 
     if (GET_PROC(WTOpenA) &&
+        GET_PROC(WTInfoA) &&
         GET_PROC(WTClose) )
     {
         return hWintab;
@@ -135,6 +139,65 @@ static void test_WTOpenContextValidation(void)
     wintab_destroy_window(defaultWindow);
 }
 
+static void test_WTInfoA(void)
+{
+    char name[LCNAMELEN];
+    UINT ret;
+    AXIS value;
+    AXIS orientation[3];
+
+    glogContext.lcOptions |= CXO_SYSTEM;
+
+    ret = pWTInfoA(WTI_DEFSYSCTX, 0, &glogContext);
+    if(!ret)
+    {
+        skip("No tablet connected\n");
+        return;
+    }
+    ok(ret == sizeof( LOGCONTEXTA ), "incorrect size\n" );
+    ok(glogContext.lcOptions & CXO_SYSTEM, "Wrong options 0x%08x\n", glogContext.lcOptions);
+
+    ret = pWTInfoA( WTI_DEVICES, DVC_NAME, name );
+    trace("DVC_NAME %s\n", name);
+
+    ret = pWTInfoA( WTI_DEVICES, DVC_X, &value );
+    ok(ret == sizeof( AXIS ), "Wrong DVC_X size %d\n", ret);
+    trace("DVC_X %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+
+    ret = pWTInfoA( WTI_DEVICES, DVC_Y, &value );
+    ok(ret == sizeof( AXIS ), "Wrong DVC_Y size %d\n", ret);
+    trace("DVC_Y %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+
+    ret = pWTInfoA( WTI_DEVICES, DVC_Z, &value );
+    todo_wine ok(ret == sizeof( AXIS ), "Wrong DVC_Z size %d\n", ret);
+    trace("DVC_Z %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+
+    ret = pWTInfoA( WTI_DEVICES, DVC_NPRESSURE, &value );
+    ok(ret == sizeof( AXIS ), "Wrong DVC_NPRESSURE, size %d\n", ret);
+    trace("DVC_NPRESSURE %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+
+    ret = pWTInfoA( WTI_DEVICES, DVC_TPRESSURE, &value );
+    todo_wine ok(ret == sizeof( AXIS ), "Wrong DVC_TPRESSURE, size %d\n", ret);
+    trace("DVC_TPRESSURE %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+
+    ret = pWTInfoA( WTI_DEVICES, DVC_ORIENTATION, &orientation );
+    ok(ret == sizeof( AXIS )*3, "Wrong DVC_ORIENTATION, size %d\n", ret);
+    trace("DVC_ORIENTATION0 %d, %d, %d\n", orientation[0].axMin, orientation[0].axMax, orientation[0].axUnits);
+    trace("DVC_ORIENTATION1 %d, %d, %d\n", orientation[1].axMin, orientation[1].axMax, orientation[1].axUnits);
+    trace("DVC_ORIENTATION2 %d, %d, %d\n", orientation[2].axMin, orientation[2].axMax, orientation[2].axUnits);
+
+    ret = pWTInfoA( WTI_DEVICES, DVC_ROTATION, &orientation );
+    if(ret)
+    {
+        trace("DVC_ROTATION0 %d, %d, %d\n", orientation[0].axMin, orientation[0].axMax, orientation[0].axUnits);
+        trace("DVC_ROTATION1 %d, %d, %d\n", orientation[1].axMin, orientation[1].axMax, orientation[1].axUnits);
+        trace("DVC_ROTATION2 %d, %d, %d\n", orientation[2].axMin, orientation[2].axMax, orientation[2].axUnits);
+    }
+    else
+        trace("DVC_ROTATION not supported\n");
+
+}
+
 START_TEST(context)
 {
     HMODULE hWintab = load_functions();
@@ -146,6 +209,7 @@ START_TEST(context)
     }
 
     test_WTOpenContextValidation();
+    test_WTInfoA();
 
     FreeLibrary(hWintab);
 }




More information about the wine-cvs mailing list