Francois Gouget : shell32/tests: Test default verb detection for files as well as for URLs.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 21 11:21:10 CDT 2016


Module: wine
Branch: master
Commit: 822e78ee04c60c3d0fbf52cb0d9338f41292dd73
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=822e78ee04c60c3d0fbf52cb0d9338f41292dd73

Author: Francois Gouget <fgouget at free.fr>
Date:   Sun Mar 20 07:32:42 2016 +0100

shell32/tests: Test default verb detection for files as well as for URLs.

When Internet Explorer 6 is installer, Windows XP detects non-standard
verbs just fine for files but not for URLs.

Signed-off-by: Francois Gouget <fgouget at free.fr>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shell32/tests/shlexec.c | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index 1255eec..07c3b48 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -1016,6 +1016,7 @@ static const char* testfiles[]=
     "%s\\test_shortcut_exe.lnk",
     "%s\\test file.shl",
     "%s\\test file.shlfoo",
+    "%s\\test file.sha",
     "%s\\test file.sfe",
     "%s\\test file.shlproto",
     "%s\\masked file.shlexec",
@@ -1066,6 +1067,8 @@ static filename_tests_t filename_tests[]=
 
     {"notaverb",     "%s\\test file.shlexec",   0x10, SE_ERR_NOASSOC},
 
+    {"averb",        "%s\\test file.sha",       0x10, 33},
+
     /* Test file masked due to space */
     {NULL,           "%s\\masked file.shlexec",   0x0, 33},
     /* Test if quoting prevents the masking */
@@ -1774,6 +1777,14 @@ static void test_filename(void)
         sprintf(filename, "%s\\test file.shlexec", tmpdir);
         okChildPath("argvA4", filename);
     }
+
+    sprintf(filename, "\"%s\\test file.sha\"", tmpdir);
+    rc=shell_execute(NULL, filename, NULL, NULL);
+    todo_wine okShell(rc > 32, "failed: rc=%ld err=%u\n", rc, GetLastError());
+    okChildInt("argcA", 5);
+    todo_wine okChildString("argvA3", "averb");
+    sprintf(filename, "%s\\test file.sha", tmpdir);
+    todo_wine okChildPath("argvA4", filename);
 }
 
 typedef struct
@@ -1940,10 +1951,15 @@ static void test_urls(void)
 
     /* Check default verb detection */
     rc = shell_execute(NULL, "shlpaverb://foo/bar", NULL, NULL);
-    todo_wine ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc);
-    okChildInt("argcA", 5);
-    todo_wine okChildString("argvA3", "PAVerb");
-    todo_wine okChildString("argvA4", "shlpaverb://foo/bar");
+    todo_wine ok(rc > 32 || /* XP+IE7 - Win10 */
+                 broken(rc == SE_ERR_NOASSOC), /* XP+IE6 */
+                 "%s failed: rc=%lu\n", shell_call, rc);
+    if (rc > 32)
+    {
+        okChildInt("argcA", 5);
+        todo_wine okChildString("argvA3", "PAVerb");
+        todo_wine okChildString("argvA4", "shlpaverb://foo/bar");
+    }
 
     /* But alternative verbs are a recent feature! */
     rc = shell_execute("averb", "shlproto://foo/bar", NULL, NULL);
@@ -2802,6 +2818,9 @@ static void init_test(void)
     create_test_verb("shlexec.shlexec", "UpperL", 0, "UpperL %L");
     create_test_verb("shlexec.shlexec", "QuotedUpperL", 0, "QuotedUpperL \"%L\"");
 
+    create_test_association(".sha");
+    create_test_verb("shlexec.sha", "averb", 0, "AVerb \"%1\"");
+
     create_test_class("shlproto", TRUE);
     create_test_verb("shlproto", "open", 0, "URL \"%1\"");
     create_test_verb("shlproto", "averb", 0, "AVerb \"%1\"");
@@ -2830,6 +2849,7 @@ static void cleanup_test(void)
 
     /* Delete the test association */
     delete_test_association(".shlexec");
+    delete_test_association(".sha");
     delete_test_class("shlproto");
 
     CloseHandle(hEvent);




More information about the wine-cvs mailing list