589 test.Printf(_L("iLockedSegmentCount %d...\n"), fileCacheStats.iLockedSegmentCount); |
589 test.Printf(_L("iLockedSegmentCount %d...\n"), fileCacheStats.iLockedSegmentCount); |
590 |
590 |
591 test(fileCacheStats.iLockedSegmentCount >= maxLockedSegmentCount); |
591 test(fileCacheStats.iLockedSegmentCount >= maxLockedSegmentCount); |
592 maxLockedSegmentCount = Max(maxLockedSegmentCount, fileCacheStats.iLockedSegmentCount); |
592 maxLockedSegmentCount = Max(maxLockedSegmentCount, fileCacheStats.iLockedSegmentCount); |
593 // wrap to start of file |
593 // wrap to start of file |
594 if (pos >= gFileCacheConfig.iCacheSize) |
594 if (pos >= gFileCacheConfig.iCacheSize || pos >= KBufSize) |
595 pos = 0; |
595 pos = 0; |
596 } |
596 } |
597 timer.Close(); |
597 timer.Close(); |
598 |
598 |
599 test(fileCacheStats.iLockedSegmentCount > 0); |
599 test(fileCacheStats.iLockedSegmentCount > 0); |
1015 test_Value(r, r==KErrArgument); |
1015 test_Value(r, r==KErrArgument); |
1016 r = f.Open(TheFs, testFile, EFileRead | EFileWriteBuffered | EFileWriteDirectIO); |
1016 r = f.Open(TheFs, testFile, EFileRead | EFileWriteBuffered | EFileWriteDirectIO); |
1017 test_Value(r, r==KErrArgument); |
1017 test_Value(r, r==KErrArgument); |
1018 //********************************** |
1018 //********************************** |
1019 // Test that continuously appending to a file yields the correct size... |
1019 // Test that continuously appending to a file yields the correct size... |
1020 // NB: Must have lock failure more ON in debug mode for this test to pass |
1020 // NB: Must have lock failure mode ON in debug mode for this test to pass |
1021 //********************************** |
1021 //********************************** |
1022 test.Next(_L("Test appending to a file & checking the file size...")); |
1022 test.Next(_L("Test appending to a file & checking the file size...")); |
1023 gBufPtr.SetLength(KBufSize); |
1023 gBufPtr.SetLength(KBufSize); |
1024 |
1024 |
1025 r = f.Replace(TheFs, testFile, EFileWrite | EFileWriteBuffered); |
|
1026 test_KErrNone(r); |
|
1027 |
|
1028 const TInt KWriteLen = KSegmentSize+1; |
1025 const TInt KWriteLen = KSegmentSize+1; |
1029 writePtr.Set(gBuf->Des().Ptr(), KWriteLen); |
1026 writePtr.Set(gBuf->Des().Ptr(), KWriteLen); |
1030 |
1027 |
1031 #if defined(_DEBUG) || defined(_DEBUG_RELEASE) |
1028 #if defined(_DEBUG) || defined(_DEBUG_RELEASE) |
1032 r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats); |
1029 r = controlIo(TheFs, gDrive, KControlIoFileCacheStats, fileCacheStats); |