kernel32: tests/path.c: Improve test for GetLongPathNameA

James Hawkins truiken at gmail.com
Thu Jun 5 12:59:35 CDT 2008


On Wed, Jun 4, 2008 at 8:38 PM, Zac Brown <zac at zacbrown.org> wrote:
> Add test to check for GetLongPathNameA on GetModuleFileNameA's returned
> string.
>
> Found via errors existing in shell32/tests/shelllink.c. Checked against
> Windows XP and Windows 2000.
>

+    pGetModuleFileNameA =
+        (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"),
"GetModuleFileNameA" );

GetModuleFileNameA is available on all platforms, and besides, you use
it without checking if it's NULL.

+/* Try getting the long path of your module name */
+  if(pGetLongPathNameA) {
+    ok(pGetModuleFileNameA(NULL,tmpstr,sizeof(tmpstr)),"GetModuleFileNameA
failed %s\n",
+       tmpstr);
+    todo_wine ok(pGetLongPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetLongPathNameA
failed %s\n",
+       tmpstr);
+  }

What is this testing?  Just that GetLongPathName doesn't fail in this
case (I'm not even sure what 'this case' is specifically)?  You should
be checking the return value and the value of the out variable.

-- 
James Hawkins



More information about the wine-devel mailing list