mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 23:14:53 +00:00
[MSVCRT_APITEST]
Fix tests according to the platform they are run on. This fixes msvcrt_apitest crash on w2k3. svn path=/trunk/; revision=54449
This commit is contained in:
parent
042f97270e
commit
363b460431
|
@ -23,6 +23,9 @@ START_TEST(splitpath)
|
||||||
char dir[64];
|
char dir[64];
|
||||||
char fname[32];
|
char fname[32];
|
||||||
char ext[10];
|
char ext[10];
|
||||||
|
DWORD Major;
|
||||||
|
|
||||||
|
Major = (DWORD)(LOBYTE(LOWORD(GetVersion())));
|
||||||
|
|
||||||
_splitpath("c:\\dir1\\dir2\\file.ext", drive, dir, fname, ext);
|
_splitpath("c:\\dir1\\dir2\\file.ext", drive, dir, fname, ext);
|
||||||
ok_str(drive, "c:");
|
ok_str(drive, "c:");
|
||||||
|
@ -34,17 +37,32 @@ START_TEST(splitpath)
|
||||||
_splitpath("c:\\dir1\\dir2\\file.ext", 0, 0, 0, 0);
|
_splitpath("c:\\dir1\\dir2\\file.ext", 0, 0, 0, 0);
|
||||||
ok_int(*_errno(), 0);
|
ok_int(*_errno(), 0);
|
||||||
|
|
||||||
*_errno() = 0;
|
if (Major >= 6)
|
||||||
_splitpath(0, drive, dir, fname, ext);
|
{
|
||||||
ok_int(*_errno(), EINVAL);
|
*_errno() = 0;
|
||||||
ok_str(drive, "");
|
_splitpath(0, drive, dir, fname, ext);
|
||||||
ok_str(dir, "");
|
ok_int(*_errno(), EINVAL);
|
||||||
ok_str(fname, "");
|
ok_str(drive, "");
|
||||||
ok_str(ext, "");
|
ok_str(dir, "");
|
||||||
|
ok_str(fname, "");
|
||||||
|
ok_str(ext, "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
win_skip("This test only succeed on NT6+\n");
|
||||||
|
}
|
||||||
|
|
||||||
_splitpath("\\\\?\\c:\\dir1\\dir2\\file.ext", drive, dir, fname, ext);
|
_splitpath("\\\\?\\c:\\dir1\\dir2\\file.ext", drive, dir, fname, ext);
|
||||||
ok_str(drive, "c:");
|
if (Major >= 6)
|
||||||
ok_str(dir, "\\dir1\\dir2\\");
|
{
|
||||||
|
ok_str(drive, "c:");
|
||||||
|
ok_str(dir, "\\dir1\\dir2\\");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok_str(drive, "");
|
||||||
|
ok_str(dir, "\\\\?\\c:\\dir1\\dir2\\");
|
||||||
|
}
|
||||||
ok_str(fname, "file");
|
ok_str(fname, "file");
|
||||||
ok_str(ext, ".ext");
|
ok_str(ext, ".ext");
|
||||||
|
|
||||||
|
@ -61,8 +79,16 @@ START_TEST(splitpath)
|
||||||
ok_str(ext, ".ext");
|
ok_str(ext, ".ext");
|
||||||
|
|
||||||
_splitpath("\\\\?\\0:/dir1\\dir2/file.", drive, dir, fname, ext);
|
_splitpath("\\\\?\\0:/dir1\\dir2/file.", drive, dir, fname, ext);
|
||||||
ok_str(drive, "0:");
|
if (Major >= 6)
|
||||||
ok_str(dir, "/dir1\\dir2/");
|
{
|
||||||
|
ok_str(drive, "0:");
|
||||||
|
ok_str(dir, "/dir1\\dir2/");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ok_str(drive, "");
|
||||||
|
ok_str(dir, "\\\\?\\0:/dir1\\dir2/");
|
||||||
|
}
|
||||||
ok_str(fname, "file");
|
ok_str(fname, "file");
|
||||||
ok_str(ext, ".");
|
ok_str(ext, ".");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue