[KERNEL32_APITESTS]: Add more tests for FindActCtxSectionStringW.
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Fri, 10 Feb 2017 00:00:28 +0000 (00:00 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Fri, 10 Feb 2017 00:00:28 +0000 (00:00 +0000)
svn path=/trunk/; revision=73767

rostests/apitests/kernel32/CMakeLists.txt
rostests/apitests/kernel32/FindActCtxSectionStringW.c
rostests/apitests/kernel32/classtest2.manifest [new file with mode: 0644]

index 7c66775..1cfd0bd 100644 (file)
@@ -33,6 +33,7 @@ add_rostests_file(TARGET kernel32_apitest)
 
 list(APPEND MANIFEST_FILES
     classtest.manifest
+    classtest2.manifest
     comctl32dep.manifest
     dep1.manifest
     deptest.manifest)
index 275bc69..7b2ba3a 100644 (file)
@@ -269,8 +269,8 @@ VOID TestLibDependency(HANDLE h)
 
 START_TEST(FindActCtxSectionStringW)
 {
-    HANDLE h;
-    ULONG_PTR cookie;
+    HANDLE h, h2;
+    ULONG_PTR cookie, cookie2;
 
     /*First run the redirection tests without using our own actctx */
     TestClassRedirection(NULL, L"Button", L"Button", L"comctl32.dll", 27);
@@ -284,6 +284,9 @@ START_TEST(FindActCtxSectionStringW)
     {
         _ActivateCtx(h, &cookie, __LINE__);
         TestClassRedirection(h, L"Button", L"2.2.2.2!Button", L"testlib.dll", 5);
+        _ActivateCtx(NULL, &cookie2, __LINE__);
+        TestClassRedirection(NULL, L"Button", L"Button", L"comctl32.dll", 27);
+        _DeactivateCtx(cookie2, __LINE__);
         _DeactivateCtx(cookie, __LINE__);
     }
     else
@@ -291,6 +294,23 @@ START_TEST(FindActCtxSectionStringW)
         skip("Failed to create context for classtest.manifest\n");
     }
     
+    /* Class redirection tests with multiple contexts in the activation stack */
+    h2 = _CreateActCtxFromFile(L"classtest2.manifest", __LINE__);
+    if (h != INVALID_HANDLE_VALUE && h2 != INVALID_HANDLE_VALUE)
+    {
+        _ActivateCtx(h, &cookie, __LINE__);
+        _ActivateCtx(h2, &cookie2, __LINE__);
+        TestClassRedirection(NULL, L"Button", L"Button", L"comctl32.dll", 27);
+        TestClassRedirection(h2, L"MyClass", L"1.1.1.1!MyClass", L"testlib.dll", 5);
+        _DeactivateCtx(cookie2, __LINE__);
+        TestClassRedirection(h, L"Button", L"2.2.2.2!Button", L"testlib.dll", 5);
+        _DeactivateCtx(cookie, __LINE__);
+    }
+    else
+    {
+        skip("Failed to create context for classtest.manifest\n");
+    }
+
     /* Dependency tests */
     h = _CreateActCtxFromFile(L"deptest.manifest", __LINE__);
     if (h != INVALID_HANDLE_VALUE)
diff --git a/rostests/apitests/kernel32/classtest2.manifest b/rostests/apitests/kernel32/classtest2.manifest
new file mode 100644 (file)
index 0000000..8773d12
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">\r
+  <assemblyIdentity type="win32" name="ReactOS-TestLib" version="1.1.1.1" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df"/>\r
+  <file name="testlib.dll">\r
+    <windowClass>ButtonListBox</windowClass>\r
+    <windowClass>ComboBoxEx32</windowClass>\r
+    <windowClass>ComboLBox</windowClass>\r
+    <windowClass>Combobox</windowClass>\r
+    <windowClass>MyClass</windowClass>\r
+  </file>\r
+</assembly>\r