[2/3] shell32/tests: Merge shlexec's test_exes_long() with the other parameter passing tests.

Francois Gouget fgouget at codeweavers.com
Fri Oct 5 03:43:13 CDT 2012


Also remove the pointless noassoc test (duplicated from test_exes()).
---

Pointless because the goal here is to make sure that long parameters 
don't cause trouble, not that files with no association are not being 
run. We still have that latter check in test_exes() which is probably 
where it was copy/pasted from.


 dlls/shell32/tests/shlexec.c |   52 ++++++++++--------------------------------
 1 file changed, 12 insertions(+), 40 deletions(-)

diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index 6c0ff6c..cd5b578 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -1197,7 +1197,7 @@ static void test_commandline2argv(void)
 
 static void test_argify(void)
 {
-    char fileA[MAX_PATH];
+    char fileA[MAX_PATH], params[1024];
     INT_PTR rc;
 
     sprintf(fileA, "%s\\test file.shlexec", tmpdir);
@@ -1294,6 +1294,17 @@ static void test_argify(void)
         }
     }
 
+    /* Test with a long parameter */
+    for (rc = 0; rc < MAX_PATH; rc++)
+        fileA[rc] = 'a' + rc % 26;
+    fileA[MAX_PATH-1] = '\0';
+    sprintf(params, "shlexec \"%s\" %s", child_file, fileA);
+
+    /* We need NOZONECHECKS on Win2003 to block a dialog */
+    rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, argv0, params, NULL, NULL);
+    ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc);
+    okChildInt("argcA", 4);
+    okChildString("argvA3", fileA);
 }
 
 static void test_filename(void)
@@ -1901,44 +1912,6 @@ static void test_exes(void)
     }
 }
 
-static void test_exes_long(void)
-{
-    char filename[MAX_PATH];
-    char params[2024];
-    char longparam[MAX_PATH];
-    INT_PTR rc;
-
-    for (rc = 0; rc < MAX_PATH; rc++)
-        longparam[rc]='a'+rc%26;
-    longparam[MAX_PATH-1]=0;
-
-
-    sprintf(params, "shlexec \"%s\" %s", child_file,longparam);
-
-    /* We need NOZONECHECKS on Win2003 to block a dialog */
-    rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, argv0, params,
-                        NULL, NULL);
-    ok(rc > 32, "%s returned %lu\n", shell_call, rc);
-    okChildInt("argcA", 4);
-    okChildString("argvA3", longparam);
-
-    if (! skip_noassoc_tests)
-    {
-        sprintf(filename, "%s\\test file.noassoc", tmpdir);
-        if (CopyFile(argv0, filename, FALSE))
-        {
-            rc=shell_execute(NULL, filename, params, NULL);
-            todo_wine {
-                ok(rc==SE_ERR_NOASSOC, "%s succeeded: rc=%lu\n", shell_call, rc);
-            }
-        }
-    }
-    else
-    {
-        win_skip("Skipping shellexecute of file with unassociated extension\n");
-    }
-}
-
 typedef struct
 {
     const char* command;
@@ -2517,7 +2490,6 @@ START_TEST(shlexec)
     test_find_executable();
     test_lnks();
     test_exes();
-    test_exes_long();
     test_dde();
     test_dde_default_app();
     test_directory();
-- 
1.7.10.4




More information about the wine-patches mailing list