Re: kernel[2/2]: fix path test to pass on 95 and 98
Andrew Ziem <ahziem1(a)mailbolt.com> writes:
--- dlls/kernel/tests/path1.c 2006-05-14 23:32:47.000000000 -0600 +++ dlls/kernel/tests/path.c 2006-05-15 08:08:52.000000000 -0600 @@ -339,14 +339,22 @@ newdir,tmpstr,tmpstr1,id); ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n");
- ok((id=GetTempFileNameA(tmppath,NULL,0,newdir)),"GetTempFileNameA failed\n"); - sprintf(tmpstr,"%.4x.tmp",id & 0xffff); - sprintf(tmpstr1,"%x.tmp",id & 0xffff); - ok(lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr)==0 || - lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr1)==0, - "GetTempFileNameA returned '%s' which doesn't match '%s' or '%s'. id=%x\n", - newdir,tmpstr,tmpstr1,id); - ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n"); + if (GetVersion() & 0x80000000) {
You should never add version checks in tests, simply check for both behaviors. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard wrote:
Andrew Ziem <ahziem1(a)mailbolt.com> writes:
--- dlls/kernel/tests/path1.c 2006-05-14 23:32:47.000000000 -0600 +++ dlls/kernel/tests/path.c 2006-05-15 08:08:52.000000000 -0600 @@ -339,14 +339,22 @@ newdir,tmpstr,tmpstr1,id); ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n");
- ok((id=GetTempFileNameA(tmppath,NULL,0,newdir)),"GetTempFileNameA failed\n"); - sprintf(tmpstr,"%.4x.tmp",id & 0xffff); - sprintf(tmpstr1,"%x.tmp",id & 0xffff); - ok(lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr)==0 || - lstrcmpiA(newdir+lstrlenA(tmppath),tmpstr1)==0, - "GetTempFileNameA returned '%s' which doesn't match '%s' or '%s'. id=%x\n", - newdir,tmpstr,tmpstr1,id); - ok(DeleteFileA(newdir),"Couldn't delete the temporary file we just created\n"); + if (GetVersion() & 0x80000000) {
You should never add version checks in tests, simply check for both behaviors.
Thanks for the reply. Now, since some behavior is mutually exclusive, that implies the wine tests will never see 0 total failures? When writing this patch, I was trying to see what I could I could do to see more green zeros in the reports: http://test.winehq.org/data/200605151000/ Also, I sort of copied the GetVersion() part from existing tests. For example: $ grep GetVersion dlls/*/tests/*.c | wc -l 31 Andrew
Andrew Ziem <ahziem1(a)mailbolt.com> writes:
Thanks for the reply. Now, since some behavior is mutually exclusive, that implies the wine tests will never see 0 total failures?
No, it means that the test should accept both cases, since both are valid behaviors of the Windows API. You can replace the ok() by a simple if(), and continue with testing the buffer in the success case.
Also, I sort of copied the GetVersion() part from existing tests. For example:
$ grep GetVersion dlls/*/tests/*.c | wc -l 31
Most of these aren't actually GetVersion calls. There are a few, mostly in places where real apps do the same checks, so that we need to mimick that behavior. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Andrew Ziem