MSCMS/tests: asciify tests

Saulius Krasuckas saulius2 at ar.fi.lt
Wed Nov 16 17:55:52 CST 2005


Log message:
	Saulius Krasuckas <saulius.krasuckas at ieee.org>
	Don't call unicode function of file API as they fail on Win9x.


? dlls/mscms/tests/mscms_test.dsp
Index: dlls/mscms/tests/profile.c
===================================================================
RCS file: /home/wine/wine/dlls/mscms/tests/profile.c,v
retrieving revision 1.17
diff -p -u -r1.17 profile.c
--- dlls/mscms/tests/profile.c	18 Jul 2005 09:08:43 -0000	1.17
+++ dlls/mscms/tests/profile.c	16 Nov 2005 22:26:32 -0000
@@ -971,9 +971,11 @@ static void test_UninstallColorProfileW(
     if (testprofileW)
     {
         WCHAR dest[MAX_PATH], base[MAX_PATH];
+        char destA[MAX_PATH];
         DWORD size = sizeof(dest);
         WCHAR slash[] = { '\\', 0 };
         HANDLE handle;
+        int szA, szW;
 
         ret = pInstallColorProfileW( NULL, testprofileW );
         ok( ret, "InstallColorProfileW() failed (%ld)\n", GetLastError() );
@@ -989,8 +991,12 @@ static void test_UninstallColorProfileW(
         ret = pUninstallColorProfileW( NULL, dest, TRUE );
         ok( ret, "UninstallColorProfileW() failed (%ld)\n", GetLastError() );
 
+        WideCharToMultiByte(CP_ACP, 0, dest, -1, destA, MAX_PATH, NULL, NULL);
+        szA = lstrlenA(destA);
+        szW = lstrlenW(dest);
+        ok( szA == szW, "profile name conversion wasn't successfull: %d chars vs %d chars\n", szA, szW);
         /* Check if the profile is really gone */
-        handle = CreateFileW( dest, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
+        handle = CreateFileA( destA, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
         ok( handle == INVALID_HANDLE_VALUE, "Found the profile (%ld)\n", GetLastError() );
         CloseHandle( handle );
     }
@@ -1004,6 +1010,7 @@ START_TEST(profile)
     char profilefile1[MAX_PATH], profilefile2[MAX_PATH];
     WCHAR profilefile1W[MAX_PATH], profilefile2W[MAX_PATH];
     WCHAR fileW[MAX_PATH];
+    UINT ret;
 
     hmscms = LoadLibraryA( "mscms.dll" );
     if (!hmscms) return;
@@ -1015,8 +1022,16 @@ START_TEST(profile)
     }
 
     /* See if we can find the standard color profile */
-    GetSystemDirectoryA( profilefile1, sizeof(profilefile1) );
-    GetSystemDirectoryW( profilefile1W, sizeof(profilefile1W) / sizeof(WCHAR) );
+    ret = GetSystemDirectoryA( profilefile1, sizeof(profilefile1) );
+    ok( ret > 0, "GetSystemDirectoryA() returns %d, LastError = %ld\n", ret, GetLastError());
+    ok( lstrlenA(profilefile1) > 0 && lstrlenA(profilefile1) < MAX_PATH, 
+        "GetSystemDirectoryA() returns %d, LastError = %ld\n", ret, GetLastError());
+    MultiByteToWideChar(CP_ACP, 0, profilefile1, -1, profilefile1W, MAX_PATH);
+    ok( lstrlenW(profilefile1W) > 0 && lstrlenW(profilefile1W) < MAX_PATH, 
+        "GetSystemDirectoryA() returns %d, LastError = %ld\n", ret, GetLastError());
+    lstrcpyA(profilefile2, profilefile1);
+    lstrcpyW(profilefile2W, profilefile1W);
+
     lstrcatA( profilefile1, profile1 );
     lstrcatW( profilefile1W, profile1W );
     handle = CreateFileA( profilefile1, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
@@ -1028,8 +1043,6 @@ START_TEST(profile)
         CloseHandle( handle );
     }
 
-    GetSystemDirectoryA( profilefile2, sizeof(profilefile2) );
-    GetSystemDirectoryW( profilefile2W, sizeof(profilefile2W) / sizeof(WCHAR) );
     lstrcatA( profilefile2, profile2 );
     lstrcatW( profilefile2W, profile2W );
     handle = CreateFileA( profilefile2, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );



More information about the wine-patches mailing list