Paul Millar wrote:
ChangeLog: Replace references to D: (which might not exist) with C: (which we assume does)
Index: dlls/kernel/tests/path.c
RCS file: /home/wine/wine/dlls/kernel/tests/path.c,v retrieving revision 1.6 diff -u -r1.6 path.c --- dlls/kernel/tests/path.c 5 Jul 2002 01:22:28 -0000 1.6 +++ dlls/kernel/tests/path.c 12 Jul 2002 18:03:17 -0000 @@ -673,9 +673,9 @@ ok(lstrcmpiA(SHORTFILE,strptr)==0, "GetLongPathNameA returned part '%s' instead of '%s'",strptr,SHORTFILE); /* Otherwise insert the missing leading slash */
- sprintf(tmpstr,"D:%s\%s",SHORTDIR,SHORTFILE);
- sprintf(tmpstr,"C:%s\%s",SHORTDIR,SHORTFILE); ok(GetFullPathNameA(tmpstr,MAX_PATH,tmpstr1,&strptr),"GetFullPathNameA failed");
- sprintf(tmpstr,"D:\%s\%s",SHORTDIR,SHORTFILE);
- sprintf(tmpstr,"C:\%s\%s",SHORTDIR,SHORTFILE); ok(lstrcmpiA(tmpstr,tmpstr1)==0, "GetLongPathNameA returned '%s' instead of '%s'",tmpstr1,tmpstr); ok(lstrcmpiA(SHORTFILE,strptr)==0,
Actually, the purpose of that particular test was to check the behavior when the supplied path is on a different drive from the current drive. The current drive is presumably C:. But the test should have tested for the existence of drive D: before using it.
On Fri, 12 Jul 2002, Duane Clark wrote:
Paul Millar wrote:
ChangeLog: Replace references to D: (which might not exist) with C: (which we assume does)
[cut: old patch]
Actually, the purpose of that particular test was to check the behavior when the supplied path is on a different drive from the current drive.
Ooops.
The current drive is presumably C:.
In my case, the current drive is F: but C: exists so that bit works fine.
But the test should have tested for the existence of drive D: before using it.
Ok, so if I've understood this correctly, some tests check behaviour with whatever the current drive is (assumed to be C:), and some others check behaviour with some other drive (currently D: is assumed to be valid).
I'll submit another patch that should remove these assumptions. The patch works for me, but you might like to check I've not negated any of the tests: I'm not sure I follow exactly what's being tested ..
Ta,
Paul.
---- Paul Millar
Paul Millar wrote:
On Fri, 12 Jul 2002, Duane Clark wrote:
But the test should have tested for the existence of drive D: before using it.
Ok, so if I've understood this correctly, some tests check behaviour with whatever the current drive is (assumed to be C:), and some others check behaviour with some other drive (currently D: is assumed to be valid).
I'll submit another patch that should remove these assumptions. The patch works for me, but you might like to check I've not negated any of the tests: I'm not sure I follow exactly what's being tested ..
I should have tried a few more things.
First of all, the current directory is $TEMP, not where the test is being run from. The test changes it. But of course, $TEMP might not be on drive C:, so more needs to be done there.
In Windows, if a path "D:somedir\file.c" is supplied, then there are two possibilities. If D: is a drive for which Windows has a current directory (rather than being the current drive), then the returned path should be "D:\currentdir\somedir\file.c". If D: does not have a current directory, then the returned path should be "D:\somedir\file.c".
By the way, it does not matter whether the drive exists or not, so there is no need to test for the existence of it. I see that Wine returns the wrong value when a non-existent drive is supplied. I am not sure that is very important, though. It appears to return the correct value in all other cases.
So when running the test, it appears that Wine has a known "current directory" for the drive that the test is being run from, and for the drive that is part of $TEMP. To do the test properly would require that another configured drive be determined. A mapped CDROM drive would be a good choice, if it were easy to determine what drive that was.
Duane Clark wrote:
... So when running the test, it appears that Wine has a known "current directory" for the drive that the test is being run from, and for the drive that is part of $TEMP. To do the test properly would require that another configured drive be determined. A mapped CDROM drive would be a good choice, if it were easy to determine what drive that was.
s/mapped/configured/ of course.