mirror of
https://github.com/reactos/reactos.git
synced 2025-06-04 17:00:31 +00:00
[KMTESTS:CC] Add more tests for SetFileSizes
These are covered by Thomas' patch. CORE-11819
This commit is contained in:
parent
ba5d6e977b
commit
f7c0236fc1
2 changed files with 14 additions and 5 deletions
|
@ -171,13 +171,18 @@ PerformTest(
|
|||
Fcb->Header.FileSize.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE;
|
||||
Fcb->Header.ValidDataLength.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE;
|
||||
|
||||
if (TestId > 1 && TestId < 4)
|
||||
{
|
||||
Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE;
|
||||
}
|
||||
|
||||
KmtStartSeh();
|
||||
CcInitializeCacheMap(TestFileObject, (PCC_FILE_SIZES)&Fcb->Header.AllocationSize, TRUE, &Callbacks, NULL);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
||||
if (!skip(CcIsFileCached(TestFileObject) == TRUE, "CcInitializeCacheMap failed\n"))
|
||||
{
|
||||
if (TestId == 0)
|
||||
if (TestId == 0 || TestId == 2)
|
||||
{
|
||||
Offset.QuadPart = 0;
|
||||
KmtStartSeh();
|
||||
|
@ -194,6 +199,7 @@ PerformTest(
|
|||
CcSetFileSizes(TestFileObject, &NewFileSizes);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
||||
Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY;
|
||||
Fcb->Header.FileSize.QuadPart = VACB_MAPPING_GRANULARITY;
|
||||
|
||||
Offset.QuadPart = 0;
|
||||
|
@ -208,7 +214,7 @@ PerformTest(
|
|||
CcUnpinData(Bcb);
|
||||
}
|
||||
}
|
||||
else if (TestId == 1)
|
||||
else if (TestId == 1 || TestId == 3)
|
||||
{
|
||||
Buffer = ExAllocatePool(NonPagedPool, PAGE_SIZE);
|
||||
if (!skip(Buffer != NULL, "ExAllocatePool failed\n"))
|
||||
|
@ -226,6 +232,7 @@ PerformTest(
|
|||
CcSetFileSizes(TestFileObject, &NewFileSizes);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
||||
Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY;
|
||||
Fcb->Header.FileSize.QuadPart = VACB_MAPPING_GRANULARITY;
|
||||
RtlZeroMemory(Buffer, PAGE_SIZE);
|
||||
|
||||
|
|
|
@ -18,10 +18,12 @@ START_TEST(CcSetFileSizes)
|
|||
KmtLoadDriver(L"CcSetFileSizes", FALSE);
|
||||
KmtOpenDriver();
|
||||
|
||||
/* 0: mapped data
|
||||
* 1: copy read
|
||||
/* 0: mapped data - only FS
|
||||
* 1: copy read - only FS
|
||||
* 2: mapped data - FS & AS
|
||||
* 3: copy read - FS & AS
|
||||
*/
|
||||
for (TestId = 0; TestId < 2; ++TestId)
|
||||
for (TestId = 0; TestId < 4; ++TestId)
|
||||
{
|
||||
Ret = KmtSendUlongToDriver(IOCTL_START_TEST, TestId);
|
||||
ok(Ret == ERROR_SUCCESS, "KmtSendUlongToDriver failed: %lx\n", Ret);
|
||||
|
|
Loading…
Reference in a new issue