[APPSHIM_APITEST] Move versionlie tests to a dedicate shim-test binary.
authorMark Jansen <mark.jansen@reactos.org>
Sat, 28 May 2016 21:33:56 +0000 (21:33 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 28 May 2016 21:33:56 +0000 (21:33 +0000)
svn path=/trunk/; revision=71447

rostests/apitests/CMakeLists.txt
rostests/apitests/apphelp/CMakeLists.txt
rostests/apitests/apphelp/testlist.c
rostests/apitests/appshim/CMakeLists.txt [new file with mode: 0644]
rostests/apitests/appshim/testlist.c [new file with mode: 0644]
rostests/apitests/appshim/versionlie.c [moved from rostests/apitests/apphelp/versionlie.c with 97% similarity]

index 7afcb69..d383a12 100644 (file)
@@ -2,6 +2,7 @@ include_directories(include)
 
 add_subdirectory(advapi32)
 add_subdirectory(apphelp)
+add_subdirectory(appshim)
 add_subdirectory(atl)
 add_subdirectory(browseui)
 add_subdirectory(com)
index 69f0bdf..9c5f14b 100644 (file)
@@ -6,7 +6,6 @@ list(APPEND SOURCE
     data.c
     db.c
     layerapi.c
-    versionlie.c
     testlist.c)
 
 add_executable(apphelp_apitest ${SOURCE})
index c69511a..167bbb3 100644 (file)
@@ -6,13 +6,11 @@
 extern void func_apphelp(void);
 extern void func_db(void);
 extern void func_layerapi(void);
-extern void func_versionlie(void);
 
 const struct test winetest_testlist[] =
 {
     { "apphelp", func_apphelp },
     { "db", func_db },
     { "layerapi", func_layerapi },
-    { "versionlie", func_versionlie },
     { 0, 0 }
 };
diff --git a/rostests/apitests/appshim/CMakeLists.txt b/rostests/apitests/appshim/CMakeLists.txt
new file mode 100644 (file)
index 0000000..45f4098
--- /dev/null
@@ -0,0 +1,11 @@
+project(appcompat)
+add_definitions(-D__ROS_LONG64__)
+
+list(APPEND SOURCE
+    versionlie.c
+    testlist.c)
+
+add_executable(appshim_apitest ${SOURCE})
+set_module_type(appshim_apitest win32cui)
+add_importlibs(appshim_apitest msvcrt kernel32 ntdll)
+add_cd_file(TARGET appshim_apitest DESTINATION reactos/bin FOR all)
diff --git a/rostests/apitests/appshim/testlist.c b/rostests/apitests/appshim/testlist.c
new file mode 100644 (file)
index 0000000..68032a7
--- /dev/null
@@ -0,0 +1,12 @@
+/* Automatically generated file; DO NOT EDIT!! */
+
+#define STANDALONE
+#include <wine/test.h>
+
+extern void func_versionlie(void);
+
+const struct test winetest_testlist[] =
+{
+    { "versionlie", func_versionlie },
+    { 0, 0 }
+};
similarity index 97%
rename from rostests/apitests/apphelp/versionlie.c
rename to rostests/apitests/appshim/versionlie.c
index 21fe5e2..6f65947 100644 (file)
@@ -27,9 +27,6 @@
 #include <stdio.h>
 #include "wine/test.h"
 
-/* data.c */
-DWORD get_host_winver(void);
-
 typedef struct tagHOOKAPI {
     PCSTR LibraryName;
     PCSTR FunctionName;
@@ -305,6 +302,16 @@ VersionLieInfo g_WinVistaSP2 = { 0x17720006, 6, 0, 6002, VER_PLATFORM_WIN32_NT,
 
 VersionLieInfo g_Win7RTM = { 0x1db00106, 6, 1, 7600, VER_PLATFORM_WIN32_NT, 0, 0 };
 
+DWORD get_host_winver(void)
+{
+    RTL_OSVERSIONINFOEXW rtlinfo = {0};
+    void (__stdcall* pRtlGetVersion)(RTL_OSVERSIONINFOEXW*);
+    pRtlGetVersion = (void (__stdcall*)(RTL_OSVERSIONINFOEXW*))GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion");
+
+    rtlinfo.dwOSVersionInfoSize = sizeof(rtlinfo);
+    pRtlGetVersion(&rtlinfo);
+    return (rtlinfo.dwMajorVersion << 8) | rtlinfo.dwMinorVersion;
+}
 
 START_TEST(versionlie)
 {