diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index f4aafdf7389..8eafbae2b8b 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -68,7 +68,7 @@ static void test_enum_value(void) static const WCHAR xxxW[] = {'x','x','x','x','x','x','x','x',0}; res = RegSetValueExA( hkey_main, "Test", 0, REG_SZ, (BYTE *)"foobar", 7 ); - ok( res == 0, "RegSetValueExA failed error %ld", res ); + ok( res == 0, "RegSetValueExA failed error %ld\n", res ); /* overflow both name and data */ val_count = 2; @@ -77,12 +77,12 @@ static void test_enum_value(void) strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count ); - ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld", res ); - ok( val_count == 2, "val_count set to %ld", val_count ); - ok( data_count == 7, "data_count set to %ld instead of 7", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); - ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'", value ); - ok( !strcmp( data, "xxxxxxxxxx" ), "data set to '%s'", data ); + ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); + ok( val_count == 2, "val_count set to %ld\n", val_count ); + ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); + ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'\n", value ); + ok( !strcmp( data, "xxxxxxxxxx" ), "data set to '%s'\n", data ); /* overflow name */ val_count = 3; @@ -91,15 +91,15 @@ static void test_enum_value(void) strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count ); - ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld", res ); + ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); /* Win9x returns 2 as specified by MSDN but NT returns 3... */ - ok( val_count == 2 || val_count == 3, "val_count set to %ld", val_count ); - ok( data_count == 7, "data_count set to %ld instead of 7", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); + ok( val_count == 2 || val_count == 3, "val_count set to %ld\n", val_count ); + ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); #if 0 /* v5.1.2600.0 (XP Home) does not touch value or data in this case */ - ok( !strcmp( value, "Te" ), "value set to '%s' instead of 'Te'", value ); - ok( !strcmp( data, "foobar" ), "data set to '%s' instead of 'foobar'", data ); + ok( !strcmp( value, "Te" ), "value set to '%s' instead of 'Te'\n", value ); + ok( !strcmp( data, "foobar" ), "data set to '%s' instead of 'foobar'\n", data ); #endif /* overflow empty name */ @@ -109,14 +109,14 @@ static void test_enum_value(void) strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count ); - ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld", res ); - ok( val_count == 0, "val_count set to %ld", val_count ); - ok( data_count == 7, "data_count set to %ld instead of 7", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); - ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'", value ); + ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); + ok( val_count == 0, "val_count set to %ld\n", val_count ); + ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); + ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'\n", value ); #if 0 /* v5.1.2600.0 (XP Home) does not touch data in this case */ - ok( !strcmp( data, "foobar" ), "data set to '%s' instead of 'foobar'", data ); + ok( !strcmp( data, "foobar" ), "data set to '%s' instead of 'foobar'\n", data ); #endif /* overflow data */ @@ -126,12 +126,12 @@ static void test_enum_value(void) strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count ); - ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld", res ); - ok( val_count == 20, "val_count set to %ld", val_count ); - ok( data_count == 7, "data_count set to %ld instead of 7", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); - ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'", value ); - ok( !strcmp( data, "xxxxxxxxxx" ), "data set to '%s'", data ); + ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); + ok( val_count == 20, "val_count set to %ld\n", val_count ); + ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); + ok( !strcmp( value, "xxxxxxxxxx" ), "value set to '%s'\n", value ); + ok( !strcmp( data, "xxxxxxxxxx" ), "data set to '%s'\n", data ); /* no overflow */ val_count = 20; @@ -140,12 +140,12 @@ static void test_enum_value(void) strcpy( value, "xxxxxxxxxx" ); strcpy( data, "xxxxxxxxxx" ); res = RegEnumValueA( hkey_main, 0, value, &val_count, NULL, &type, data, &data_count ); - ok( res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld", res ); - ok( val_count == 4, "val_count set to %ld instead of 4", val_count ); - ok( data_count == 7, "data_count set to %ld instead of 7", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); - ok( !strcmp( value, "Test" ), "value is '%s' instead of Test", value ); - ok( !strcmp( data, "foobar" ), "data is '%s' instead of foobar", data ); + ok( res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", res ); + ok( val_count == 4, "val_count set to %ld instead of 4\n", val_count ); + ok( data_count == 7, "data_count set to %ld instead of 7\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); + ok( !strcmp( value, "Test" ), "value is '%s' instead of Test\n", value ); + ok( !strcmp( data, "foobar" ), "data is '%s' instead of foobar\n", data ); /* Unicode tests */ @@ -153,7 +153,7 @@ static void test_enum_value(void) res = RegSetValueExW( hkey_main, testW, 0, REG_SZ, (BYTE *)foobarW, 7*sizeof(WCHAR) ); if (res==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) goto CLEANUP; - ok( res == 0, "RegSetValueExW failed error %ld", res ); + ok( res == 0, "RegSetValueExW failed error %ld\n", res ); /* overflow both name and data */ val_count = 2; @@ -162,12 +162,12 @@ static void test_enum_value(void) memcpy( valueW, xxxW, sizeof(xxxW) ); memcpy( dataW, xxxW, sizeof(xxxW) ); res = RegEnumValueW( hkey_main, 0, valueW, &val_count, NULL, &type, (BYTE*)dataW, &data_count ); - ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld", res ); - ok( val_count == 2, "val_count set to %ld", val_count ); - ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); - ok( !memcmp( valueW, xxxW, sizeof(xxxW) ), "value modified" ); - ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified" ); + ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); + ok( val_count == 2, "val_count set to %ld\n", val_count ); + ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); + ok( !memcmp( valueW, xxxW, sizeof(xxxW) ), "value modified\n" ); + ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified\n" ); /* overflow name */ val_count = 3; @@ -176,12 +176,12 @@ static void test_enum_value(void) memcpy( valueW, xxxW, sizeof(xxxW) ); memcpy( dataW, xxxW, sizeof(xxxW) ); res = RegEnumValueW( hkey_main, 0, valueW, &val_count, NULL, &type, (BYTE*)dataW, &data_count ); - ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld", res ); - ok( val_count == 3, "val_count set to %ld", val_count ); - ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); - ok( !memcmp( valueW, xxxW, sizeof(xxxW) ), "value modified" ); - ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified" ); + ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); + ok( val_count == 3, "val_count set to %ld\n", val_count ); + ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); + ok( !memcmp( valueW, xxxW, sizeof(xxxW) ), "value modified\n" ); + ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified\n" ); /* overflow data */ val_count = 20; @@ -190,12 +190,12 @@ static void test_enum_value(void) memcpy( valueW, xxxW, sizeof(xxxW) ); memcpy( dataW, xxxW, sizeof(xxxW) ); res = RegEnumValueW( hkey_main, 0, valueW, &val_count, NULL, &type, (BYTE*)dataW, &data_count ); - ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld", res ); - ok( val_count == 4, "val_count set to %ld instead of 4", val_count ); - ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); - ok( !memcmp( valueW, testW, sizeof(testW) ), "value is not 'Test'" ); - ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified" ); + ok( res == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %ld\n", res ); + ok( val_count == 4, "val_count set to %ld instead of 4\n", val_count ); + ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); + ok( !memcmp( valueW, testW, sizeof(testW) ), "value is not 'Test'\n" ); + ok( !memcmp( dataW, xxxW, sizeof(xxxW) ), "data modified\n" ); /* no overflow */ val_count = 20; @@ -204,12 +204,12 @@ static void test_enum_value(void) memcpy( valueW, xxxW, sizeof(xxxW) ); memcpy( dataW, xxxW, sizeof(xxxW) ); res = RegEnumValueW( hkey_main, 0, valueW, &val_count, NULL, &type, (BYTE*)dataW, &data_count ); - ok( res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld", res ); - ok( val_count == 4, "val_count set to %ld instead of 4", val_count ); - ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)", data_count ); - ok( type == REG_SZ, "type %ld is not REG_SZ", type ); - ok( !memcmp( valueW, testW, sizeof(testW) ), "value is not 'Test'" ); - ok( !memcmp( dataW, foobarW, sizeof(foobarW) ), "data is not 'foobar'" ); + ok( res == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", res ); + ok( val_count == 4, "val_count set to %ld instead of 4\n", val_count ); + ok( data_count == 7*sizeof(WCHAR), "data_count set to %ld instead of 7*sizeof(WCHAR)\n", data_count ); + ok( type == REG_SZ, "type %ld is not REG_SZ\n", type ); + ok( !memcmp( valueW, testW, sizeof(testW) ), "value is not 'Test'\n" ); + ok( !memcmp( dataW, foobarW, sizeof(foobarW) ), "data is not 'foobar'\n" ); CLEANUP: /* cleanup */ diff --git a/dlls/kernel/tests/alloc.c b/dlls/kernel/tests/alloc.c index 4a58eb5f57c..ae02789506d 100644 --- a/dlls/kernel/tests/alloc.c +++ b/dlls/kernel/tests/alloc.c @@ -57,7 +57,7 @@ static void test_Heap(void) /* Retrieve the page size for this system */ sysInfo.dwPageSize=0; GetSystemInfo(&sysInfo); - ok(sysInfo.dwPageSize>0,"GetSystemInfo should return a valid page size"); + ok(sysInfo.dwPageSize>0,"GetSystemInfo should return a valid page size\n"); /* Create a Heap with a minimum and maximum size */ /* Note that Windows and Wine seem to behave a bit differently with respect @@ -76,7 +76,7 @@ static void test_Heap(void) nearest page boundary */ mem1=HeapAlloc(heap,0,5*memchunk+1); - ok(mem1==NULL,"HeapCreate allocated more Ram than it should have"); + ok(mem1==NULL,"HeapCreate allocated more Ram than it should have\n"); if(mem1) { HeapFree(heap,0,mem1); } @@ -84,44 +84,44 @@ static void test_Heap(void) /* Check that a normal alloc works */ mem1=HeapAlloc(heap,0,memchunk); - ok(mem1!=NULL,"HeapAlloc failed"); + ok(mem1!=NULL,"HeapAlloc failed\n"); if(mem1) { - ok(HeapSize(heap,0,mem1)>=memchunk, "HeapAlloc should return a big enough memory block"); + ok(HeapSize(heap,0,mem1)>=memchunk, "HeapAlloc should return a big enough memory block\n"); } /* Check that a 'zeroing' alloc works */ mem2=HeapAlloc(heap,HEAP_ZERO_MEMORY,memchunk); - ok(mem2!=NULL,"HeapAlloc failed"); + ok(mem2!=NULL,"HeapAlloc failed\n"); if(mem2) { - ok(HeapSize(heap,0,mem2)>=memchunk,"HeapAlloc should return a big enough memory block"); + ok(HeapSize(heap,0,mem2)>=memchunk,"HeapAlloc should return a big enough memory block\n"); error=0; for(i=0;i=memchunk+5*sysInfo.dwPageSize,"HeapReAlloc failed"); + ok(HeapSize(heap,0,mem2a)>=memchunk+5*sysInfo.dwPageSize,"HeapReAlloc failed\n"); error=0; for(i=0;i<5*sysInfo.dwPageSize;i++) { if(mem2a[memchunk+i]!=0) { error=1; } } - ok(!error,"HeapReAlloc should have zeroed out it's allocated memory"); + ok(!error,"HeapReAlloc should have zeroed out it's allocated memory\n"); } /* Check that HeapRealloc honours HEAP_REALLOC_IN_PLACE_ONLY */ @@ -132,32 +132,32 @@ static void test_Heap(void) error=1; } } - ok(mem1a==NULL || error==0,"HeapReAlloc didn't honour HEAP_REALLOC_IN_PLACE_ONLY"); + ok(mem1a==NULL || error==0,"HeapReAlloc didn't honour HEAP_REALLOC_IN_PLACE_ONLY\n"); /* Check that HeapFree works correctly */ if(mem1a) { - ok(HeapFree(heap,0,mem1a),"HeapFree failed"); + ok(HeapFree(heap,0,mem1a),"HeapFree failed\n"); } else { - ok(HeapFree(heap,0,mem1),"HeapFree failed"); + ok(HeapFree(heap,0,mem1),"HeapFree failed\n"); } if(mem2a) { - ok(HeapFree(heap,0,mem2a),"HeapFree failed"); + ok(HeapFree(heap,0,mem2a),"HeapFree failed\n"); } else { - ok(HeapFree(heap,0,mem2),"HeapFree failed"); + ok(HeapFree(heap,0,mem2),"HeapFree failed\n"); } /* 0-length buffer */ mem1 = HeapAlloc(heap, 0, 0); - ok(mem1 != NULL, "Reserved memory"); + ok(mem1 != NULL, "Reserved memory\n"); dwSize = HeapSize(heap, 0, mem1); /* should work with 0-length buffer */ ok((dwSize >= 0) && (dwSize < 0xFFFFFFFF), - "The size of the 0-length buffer"); - ok(HeapFree(heap, 0, mem1), "Freed the 0-length buffer"); + "The size of the 0-length buffer\n"); + ok(HeapFree(heap, 0, mem1), "Freed the 0-length buffer\n"); /* Check that HeapDestry works */ - ok(HeapDestroy(heap),"HeapDestroy failed"); + ok(HeapDestroy(heap),"HeapDestroy failed\n"); } /* The following functions don't have tests, because either I don't know how @@ -183,18 +183,18 @@ static void test_Global(void) SetLastError(NO_ERROR); /* Check that a normal alloc works */ mem1=GlobalAlloc(0,memchunk); - ok(mem1!=NULL,"GlobalAlloc failed"); + ok(mem1!=NULL,"GlobalAlloc failed\n"); if(mem1) { - ok(GlobalSize(mem1)>=memchunk, "GlobalAlloc should return a big enough memory block"); + ok(GlobalSize(mem1)>=memchunk, "GlobalAlloc should return a big enough memory block\n"); } /* Check that a 'zeroing' alloc works */ mem2=GlobalAlloc(GMEM_ZEROINIT,memchunk); - ok(mem2!=NULL,"GlobalAlloc failed: error=%ld",GetLastError()); + ok(mem2!=NULL,"GlobalAlloc failed: error=%ld\n",GetLastError()); if(mem2) { - ok(GlobalSize(mem2)>=memchunk,"GlobalAlloc should return a big enough memory block"); + ok(GlobalSize(mem2)>=memchunk,"GlobalAlloc should return a big enough memory block\n"); mem2ptr=GlobalLock(mem2); - ok(mem2ptr==mem2,"GlobalLock should have returned the same memory as was allocated"); + ok(mem2ptr==mem2,"GlobalLock should have returned the same memory as was allocated\n"); if(mem2ptr) { error=0; for(i=0;i=2*memchunk,"GlobalReAlloc failed"); + ok(GlobalSize(mem2a)>=2*memchunk,"GlobalReAlloc failed\n"); mem2ptr=GlobalLock(mem2a); - ok(mem2ptr!=NULL,"GlobalLock Failed."); + ok(mem2ptr!=NULL,"GlobalLock Failed\n"); if(mem2ptr) { error=0; for(i=0;i=memchunk, "LocalAlloc should return a big enough memory block"); + ok(LocalSize(mem1)>=memchunk, "LocalAlloc should return a big enough memory block\n"); } /* Check that a 'zeroing' and lock alloc works */ mem2=LocalAlloc(LMEM_ZEROINIT|LMEM_MOVEABLE,memchunk); - ok(mem2!=NULL,"LocalAlloc failed: error=%ld",GetLastError()); + ok(mem2!=NULL,"LocalAlloc failed: error=%ld\n",GetLastError()); if(mem2) { - ok(LocalSize(mem2)>=memchunk,"LocalAlloc should return a big enough memory block"); + ok(LocalSize(mem2)>=memchunk,"LocalAlloc should return a big enough memory block\n"); mem2ptr=LocalLock(mem2); - ok(mem2ptr!=NULL,"LocalLock: error=%ld",GetLastError()); + ok(mem2ptr!=NULL,"LocalLock: error=%ld\n",GetLastError()); if(mem2ptr) { error=0; for(i=0;i=2*memchunk,"LocalReAlloc failed"); + ok(LocalSize(mem2a)>=2*memchunk,"LocalReAlloc failed\n"); mem2ptr=LocalLock(mem2a); - ok(mem2ptr!=NULL,"LocalLock Failed."); + ok(mem2ptr!=NULL,"LocalLock Failed\n"); if(mem2ptr) { error=0; for(i=0;i0,"GetSystemInfo should return a valid page size"); + ok(sysInfo.dwPageSize>0,"GetSystemInfo should return a valid page size\n"); /* Choose a reasonable allocation size */ memchunk=10*sysInfo.dwPageSize; /* Check that a normal alloc works */ mem1=VirtualAlloc(NULL,memchunk,MEM_COMMIT,PAGE_READWRITE); - ok(mem1!=NULL,"VirtualAlloc failed"); + ok(mem1!=NULL,"VirtualAlloc failed\n"); if(mem1) { /* check that memory is initialized to 0 */ error=0; @@ -386,7 +386,7 @@ static void test_Virtual(void) error=1; } } - ok(!error,"VirtualAlloc did not initialize memory to '0's"); + ok(!error,"VirtualAlloc did not initialize memory to '0's\n"); /* Check that we can read/write to memory */ error=0; for(i=0;iString copy" ); - ok( (UuidFromStringA(str, &Uuid2) == RPC_S_OK), "Simple String->UUID copy from generated UUID String" ); - ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> String -> Uuid transform" ); + ok( (UuidToStringA(&Uuid1, (unsigned char**)&str) == RPC_S_OK), "Simple UUID->String copy\n" ); + ok( (UuidFromStringA(str, &Uuid2) == RPC_S_OK), "Simple String->UUID copy from generated UUID String\n" ); + ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> String -> Uuid transform\n" ); /* invalid uuid tests -- size of valid UUID string=36 */ for (i2 = 0; i2 < 36; i2++) { x = str[i2]; str[i2] = 'g'; /* whatever, but "g" is a good boundary condition */ - ok( (UuidFromStringA(str, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID String" ); + ok( (UuidFromStringA(str, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID String\n" ); str[i2] = x; /* change it back so remaining tests are interesting. */ } } @@ -109,14 +109,14 @@ void UuidConversionAndComparison(void) { /* Must be Win9x (no Unicode support), skip the tests */ break; } - ok( (rslt == RPC_S_OK), "Simple UUID->WString copy" ); - ok( (UuidFromStringW(wstr, &Uuid2) == RPC_S_OK), "Simple WString->UUID copy from generated UUID String" ); - ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> WString -> Uuid transform" ); + ok( (rslt == RPC_S_OK), "Simple UUID->WString copy\n" ); + ok( (UuidFromStringW(wstr, &Uuid2) == RPC_S_OK), "Simple WString->UUID copy from generated UUID String\n" ); + ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> WString -> Uuid transform\n" ); /* invalid uuid tests -- size of valid UUID string=36 */ for (i2 = 0; i2 < 36; i2++) { wx = wstr[i2]; wstr[i2] = 'g'; /* whatever, but "g" is a good boundary condition */ - ok( (UuidFromStringW(wstr, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID WString" ); + ok( (UuidFromStringW(wstr, &Uuid1) == RPC_S_INVALID_STRING_UUID), "Invalid UUID WString\n" ); wstr[i2] = wx; /* change it back so remaining tests are interesting. */ } } diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index ecd46b4a319..5aae14e4944 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -36,11 +36,9 @@ void createTestFile(CHAR *name) { HANDLE file; DWORD written; - CHAR msg[MAX_PATH]; file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); - sprintf(msg, "Failure to open file %s", name); - ok(file != INVALID_HANDLE_VALUE, msg); + ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name); WriteFile(file, name, strlen(name), &written, NULL); WriteFile(file, "\n", strlen("\n"), &written, NULL); CloseHandle(file); @@ -119,33 +117,33 @@ void test_delete(void) shfo.hNameMappings = NULL; shfo.lpszProgressTitle = NULL; - ok(!SHFileOperationA(&shfo), "Deletion was successful"); - ok(file_exists(".\\test4.txt"), "Directory should not be removed"); - ok(!file_exists(".\\test1.txt"), "File should be removed"); + ok(!SHFileOperationA(&shfo), "Deletion was successful\n"); + ok(file_exists(".\\test4.txt"), "Directory should not be removed\n"); + ok(!file_exists(".\\test1.txt"), "File should be removed\n"); - ok(!SHFileOperationA(&shfo), "Directory exists, but is not removed"); - ok(file_exists(".\\test4.txt"), "Directory should not be removed"); + ok(!SHFileOperationA(&shfo), "Directory exists, but is not removed\n"); + ok(file_exists(".\\test4.txt"), "Directory should not be removed\n"); shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI; - ok(!SHFileOperationA(&shfo), "Directory removed"); - ok(!file_exists(".\\test4.txt"), "Directory should be removed"); + ok(!SHFileOperationA(&shfo), "Directory removed\n"); + ok(!file_exists(".\\test4.txt"), "Directory should be removed\n"); - ok(!SHFileOperationA(&shfo), "The requested file does not exist"); + ok(!SHFileOperationA(&shfo), "The requested file does not exist\n"); init_shfo_tests(); sprintf(buf, "%s\\%s", CURR_DIR, "test4.txt"); buf[strlen(buf) + 1] = '\0'; - ok(MoveFileA(".\\test1.txt", ".\\test4.txt\\test1.txt"), "Fill the subdirectory"); - ok(!SHFileOperationA(&shfo), "Directory removed"); - ok(!file_exists(".\\test4.txt"), "Directory is removed"); + ok(MoveFileA(".\\test1.txt", ".\\test4.txt\\test1.txt"), "Fill the subdirectory\n"); + ok(!SHFileOperationA(&shfo), "Directory removed\n"); + ok(!file_exists(".\\test4.txt"), "Directory is removed\n"); init_shfo_tests(); shfo.pFrom = ".\\test1.txt\0.\\test4.txt\0"; - ok(!SHFileOperationA(&shfo), "Directory and a file removed"); - ok(!file_exists(".\\test1.txt"), "The file should be removed"); - ok(!file_exists(".\\test4.txt"), "Directory should be removed"); - ok(file_exists(".\\test2.txt"), "This file should not be removed"); + ok(!SHFileOperationA(&shfo), "Directory and a file removed\n"); + ok(!file_exists(".\\test1.txt"), "The file should be removed\n"); + ok(!file_exists(".\\test4.txt"), "Directory should be removed\n"); + ok(file_exists(".\\test2.txt"), "This file should not be removed\n"); } /* tests the FO_RENAME action */ @@ -167,19 +165,19 @@ void test_rename() set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "test4.txt\0"); ok(SHFileOperationA(&shfo), "File is not renamed moving to other directory " - "when specifying directory name only"); - ok(file_exists(".\\test1.txt"), "The file is not removed"); + "when specifying directory name only\n"); + ok(file_exists(".\\test1.txt"), "The file is not removed\n"); set_curr_dir_path(from, "test3.txt\0"); set_curr_dir_path(to, "test4.txt\\test1.txt\0"); - ok(!SHFileOperationA(&shfo), "File is renamed moving to other directory"); - ok(file_exists(".\\test4.txt\\test1.txt"), "The file is renamed"); + ok(!SHFileOperationA(&shfo), "File is renamed moving to other directory\n"); + ok(file_exists(".\\test4.txt\\test1.txt"), "The file is renamed\n"); set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); retval = SHFileOperationA(&shfo); /* W98 returns 0, W2K and newer returns ERROR_GEN_FAILURE, both do nothing */ - ok(!retval || retval == ERROR_GEN_FAILURE, "Can't rename many files, retval = %lx", retval); - ok(file_exists(".\\test1.txt"), "The file is not renamed - many files are specified "); + ok(!retval || retval == ERROR_GEN_FAILURE, "Can't rename many files, retval = %lx\n", retval); + ok(file_exists(".\\test1.txt"), "The file is not renamed - many files are specified\n"); memcpy(&shfo2, &shfo, sizeof(SHFILEOPSTRUCTA)); shfo2.fFlags |= FOF_MULTIDESTFILES; @@ -187,26 +185,26 @@ void test_rename() set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); retval = SHFileOperationA(&shfo2); /* W98 returns 0, W2K and newer returns ERROR_GEN_FAILURE, both do nothing */ - ok(!retval || retval == ERROR_GEN_FAILURE, "Can't rename many files, retval = %lx", retval); - ok(file_exists(".\\test1.txt"), "The file is not renamed - many files are specified "); + ok(!retval || retval == ERROR_GEN_FAILURE, "Can't rename many files, retval = %lx\n", retval); + ok(file_exists(".\\test1.txt"), "The file is not renamed - many files are specified\n"); set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "test6.txt\0"); - ok(!SHFileOperationA(&shfo), "Rename file"); - ok(!file_exists(".\\test1.txt"), "The file is renamed"); - ok(file_exists(".\\test6.txt"), "The file is renamed"); + ok(!SHFileOperationA(&shfo), "Rename file\n"); + ok(!file_exists(".\\test1.txt"), "The file is renamed\n"); + ok(file_exists(".\\test6.txt"), "The file is renamed\n"); set_curr_dir_path(from, "test6.txt\0"); set_curr_dir_path(to, "test1.txt\0"); - ok(!SHFileOperationA(&shfo), "Rename file back"); + ok(!SHFileOperationA(&shfo), "Rename file back\n"); set_curr_dir_path(from, "test4.txt\0"); set_curr_dir_path(to, "test6.txt\0"); - ok(!SHFileOperationA(&shfo), "Rename dir"); - ok(!file_exists(".\\test4.txt"), "The dir is renamed"); - ok(file_exists(".\\test6.txt"), "The dir is renamed "); + ok(!SHFileOperationA(&shfo), "Rename dir\n"); + ok(!file_exists(".\\test4.txt"), "The dir is renamed\n"); + ok(file_exists(".\\test6.txt"), "The dir is renamed\n"); set_curr_dir_path(from, "test6.txt\0"); set_curr_dir_path(to, "test4.txt\0"); - ok(!SHFileOperationA(&shfo), "Rename dir back"); + ok(!SHFileOperationA(&shfo), "Rename dir back\n"); } /* tests the FO_COPY action */ @@ -228,18 +226,18 @@ void test_copy(void) set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); - ok(SHFileOperationA(&shfo), "Can't copy many files"); + ok(SHFileOperationA(&shfo), "Can't copy many files\n"); ok(!file_exists(".\\test6.txt"), "The file is not copied - many files are " - "specified as a target"); + "specified as a target\n"); memcpy(&shfo2, &shfo, sizeof(SHFILEOPSTRUCTA)); shfo2.fFlags |= FOF_MULTIDESTFILES; set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); - ok(!SHFileOperationA(&shfo2), "Can't copy many files"); + ok(!SHFileOperationA(&shfo2), "Can't copy many files\n"); ok(file_exists(".\\test6.txt"), "The file is copied - many files are " - "specified as a target"); + "specified as a target\n"); DeleteFileA(".\\test6.txt"); DeleteFileA(".\\test7.txt"); RemoveDirectoryA(".\\test8.txt"); @@ -247,41 +245,41 @@ void test_copy(void) /* number of sources do not correspond to number of targets */ set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0"); - ok(SHFileOperationA(&shfo2), "Can't copy many files"); + ok(SHFileOperationA(&shfo2), "Can't copy many files\n"); ok(!file_exists(".\\test6.txt"), "The file is not copied - many files are " - "specified as a target"); + "specified as a target\n"); set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "test4.txt\0"); - ok(!SHFileOperationA(&shfo), "Prepare test to check how directories are copied recursively"); - ok(file_exists(".\\test4.txt\\test1.txt"), "The file is copied"); + ok(!SHFileOperationA(&shfo), "Prepare test to check how directories are copied recursively\n"); + ok(file_exists(".\\test4.txt\\test1.txt"), "The file is copied\n"); set_curr_dir_path(from, "test?.txt\0"); set_curr_dir_path(to, "testdir2\0"); - ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet"); - ok(!file_exists(".\\testdir2\\test4.txt"), "The directory is not copied yet"); - ok(!SHFileOperationA(&shfo), "Files and directories are copied to directory "); - ok(file_exists(".\\testdir2\\test1.txt"), "The file is copied"); - ok(file_exists(".\\testdir2\\test4.txt"), "The directory is copied"); - ok(file_exists(".\\testdir2\\test4.txt\\test1.txt"), "The file in subdirectory is copied"); + ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet\n"); + ok(!file_exists(".\\testdir2\\test4.txt"), "The directory is not copied yet\n"); + ok(!SHFileOperationA(&shfo), "Files and directories are copied to directory\n"); + ok(file_exists(".\\testdir2\\test1.txt"), "The file is copied\n"); + ok(file_exists(".\\testdir2\\test4.txt"), "The directory is copied\n"); + ok(file_exists(".\\testdir2\\test4.txt\\test1.txt"), "The file in subdirectory is copied\n"); clean_after_shfo_tests(); init_shfo_tests(); shfo.fFlags |= FOF_FILESONLY; - ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet"); - ok(!file_exists(".\\testdir2\\test4.txt"), "The directory is not copied yet"); - ok(!SHFileOperationA(&shfo), "Files are copied to other directory "); - ok(file_exists(".\\testdir2\\test1.txt"), "The file is copied"); - ok(!file_exists(".\\testdir2\\test4.txt"), "The directory is copied"); + ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet\n"); + ok(!file_exists(".\\testdir2\\test4.txt"), "The directory is not copied yet\n"); + ok(!SHFileOperationA(&shfo), "Files are copied to other directory\n"); + ok(file_exists(".\\testdir2\\test1.txt"), "The file is copied\n"); + ok(!file_exists(".\\testdir2\\test4.txt"), "The directory is copied\n"); clean_after_shfo_tests(); init_shfo_tests(); set_curr_dir_path(from, "test1.txt\0test2.txt\0"); - ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet"); - ok(!file_exists(".\\testdir2\\test2.txt"), "The file is not copied yet"); - ok(!SHFileOperationA(&shfo), "Files are copied to other directory "); - ok(file_exists(".\\testdir2\\test1.txt"), "The file is copied"); - ok(file_exists(".\\testdir2\\test2.txt"), "The file is copied"); + ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet\n"); + ok(!file_exists(".\\testdir2\\test2.txt"), "The file is not copied yet\n"); + ok(!SHFileOperationA(&shfo), "Files are copied to other directory \n"); + ok(file_exists(".\\testdir2\\test1.txt"), "The file is copied\n"); + ok(file_exists(".\\testdir2\\test2.txt"), "The file is copied\n"); clean_after_shfo_tests(); /* Copying multiple files with one not existing as source, fails the @@ -289,19 +287,19 @@ void test_copy(void) init_shfo_tests(); tmp_flags = shfo.fFlags; set_curr_dir_path(from, "test1.txt\0test10.txt\0test2.txt\0"); - ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet"); - ok(!file_exists(".\\testdir2\\test2.txt"), "The file is not copied yet"); + ok(!file_exists(".\\testdir2\\test1.txt"), "The file is not copied yet\n"); + ok(!file_exists(".\\testdir2\\test2.txt"), "The file is not copied yet\n"); retval = SHFileOperationA(&shfo); if (!retval) /* Win 95/NT returns success but copies only the files up to the non-existent source */ - ok(file_exists(".\\testdir2\\test1.txt"), "The file is not copied"); + ok(file_exists(".\\testdir2\\test1.txt"), "The file is not copied\n"); else { /* Win 98/ME/2K/XP fail the entire operation with return code 1026 if one source file does not exist */ - ok(retval == 1026, "Files are copied to other directory "); - ok(!file_exists(".\\testdir2\\test1.txt"), "The file is copied"); + ok(retval == 1026, "Files are copied to other directory\n"); + ok(!file_exists(".\\testdir2\\test1.txt"), "The file is copied\n"); } - ok(!file_exists(".\\testdir2\\test2.txt"), "The file is copied"); + ok(!file_exists(".\\testdir2\\test2.txt"), "The file is copied\n"); shfo.fFlags = tmp_flags; } @@ -322,17 +320,17 @@ void test_move(void) set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "test4.txt\0"); - ok(!SHFileOperationA(&shfo), "Prepare test to check how directories are moved recursively"); - ok(file_exists(".\\test4.txt\\test1.txt"), "The file is moved"); + ok(!SHFileOperationA(&shfo), "Prepare test to check how directories are moved recursively\n"); + ok(file_exists(".\\test4.txt\\test1.txt"), "The file is moved\n"); set_curr_dir_path(from, "test?.txt\0"); set_curr_dir_path(to, "testdir2\0"); - ok(!file_exists(".\\testdir2\\test2.txt"), "The file is not moved yet"); - ok(!file_exists(".\\testdir2\\test4.txt"), "The directory is not moved yet"); - ok(!SHFileOperationA(&shfo), "Files and directories are moved to directory "); - ok(file_exists(".\\testdir2\\test2.txt"), "The file is moved"); - ok(file_exists(".\\testdir2\\test4.txt"), "The directory is moved"); - ok(file_exists(".\\testdir2\\test4.txt\\test1.txt"), "The file in subdirectory is moved"); + ok(!file_exists(".\\testdir2\\test2.txt"), "The file is not moved yet\n"); + ok(!file_exists(".\\testdir2\\test4.txt"), "The directory is not moved yet\n"); + ok(!SHFileOperationA(&shfo), "Files and directories are moved to directory\n"); + ok(file_exists(".\\testdir2\\test2.txt"), "The file is moved\n"); + ok(file_exists(".\\testdir2\\test4.txt"), "The directory is moved\n"); + ok(file_exists(".\\testdir2\\test4.txt\\test1.txt"), "The file in subdirectory is moved\n"); clean_after_shfo_tests(); init_shfo_tests(); @@ -342,9 +340,9 @@ void test_move(void) set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); - ok(!SHFileOperationA(&shfo2), "Move many files"); + ok(!SHFileOperationA(&shfo2), "Move many files\n"); ok(file_exists(".\\test6.txt"), "The file is moved - many files are " - "specified as a target"); + "specified as a target\n"); DeleteFileA(".\\test6.txt"); DeleteFileA(".\\test7.txt"); RemoveDirectoryA(".\\test8.txt"); @@ -354,40 +352,40 @@ void test_move(void) /* number of sources do not correspond to number of targets */ set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0"); - ok(SHFileOperationA(&shfo2), "Can't move many files"); + ok(SHFileOperationA(&shfo2), "Can't move many files\n"); ok(!file_exists(".\\test6.txt"), "The file is not moved - many files are " - "specified as a target"); + "specified as a target\n"); init_shfo_tests(); set_curr_dir_path(from, "test3.txt\0"); set_curr_dir_path(to, "test4.txt\\test1.txt\0"); - ok(!SHFileOperationA(&shfo), "File is moved moving to other directory"); - ok(file_exists(".\\test4.txt\\test1.txt"), "The file is moved"); + ok(!SHFileOperationA(&shfo), "File is moved moving to other directory\n"); + ok(file_exists(".\\test4.txt\\test1.txt"), "The file is moved\n"); set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); - ok(SHFileOperationA(&shfo), "Can not move many files"); - ok(file_exists(".\\test1.txt"), "The file is not moved. Many files are specified "); - ok(file_exists(".\\test4.txt"), "The directory not is moved. Many files are specified "); + ok(SHFileOperationA(&shfo), "Can not move many files\n"); + ok(file_exists(".\\test1.txt"), "The file is not moved. Many files are specified\n"); + ok(file_exists(".\\test4.txt"), "The directory not is moved. Many files are specified\n"); set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "test6.txt\0"); - ok(!SHFileOperationA(&shfo), "Move file"); - ok(!file_exists(".\\test1.txt"), "The file is moved"); - ok(file_exists(".\\test6.txt"), "The file is moved "); + ok(!SHFileOperationA(&shfo), "Move file\n"); + ok(!file_exists(".\\test1.txt"), "The file is moved\n"); + ok(file_exists(".\\test6.txt"), "The file is moved\n"); set_curr_dir_path(from, "test6.txt\0"); set_curr_dir_path(to, "test1.txt\0"); - ok(!SHFileOperationA(&shfo), "Move file back"); + ok(!SHFileOperationA(&shfo), "Move file back\n"); set_curr_dir_path(from, "test4.txt\0"); set_curr_dir_path(to, "test6.txt\0"); - ok(!SHFileOperationA(&shfo), "Move dir"); - ok(!file_exists(".\\test4.txt"), "The dir is moved"); - ok(file_exists(".\\test6.txt"), "The dir is moved "); + ok(!SHFileOperationA(&shfo), "Move dir\n"); + ok(!file_exists(".\\test4.txt"), "The dir is moved\n"); + ok(file_exists(".\\test6.txt"), "The dir is moved\n"); set_curr_dir_path(from, "test6.txt\0"); set_curr_dir_path(to, "test4.txt\0"); - ok(!SHFileOperationA(&shfo), "Move dir back"); + ok(!SHFileOperationA(&shfo), "Move dir back\n"); } START_TEST(shlfileop)