kerneltest/f32test/server/t_wcache.cpp
changeset 189 a5496987b1da
parent 0 a41df078684a
child 243 c7a0ce20c48c
equal deleted inserted replaced
177:a232af6b0b1f 189:a5496987b1da
   808 	RFile fileWrite;
   808 	RFile fileWrite;
   809 	HBufC8* dummy = NULL;
   809 	HBufC8* dummy = NULL;
   810 	TPtr8 dummyPtr(NULL, 0);	
   810 	TPtr8 dummyPtr(NULL, 0);	
   811 
   811 
   812 	TRAPD(res,dummy = HBufC8::NewL(4));
   812 	TRAPD(res,dummy = HBufC8::NewL(4));
   813 	test(res == KErrNone && dummy != NULL);
   813 	test_Value(res, res == KErrNone && dummy != NULL);
   814 		
   814 		
   815 	dummyPtr.Set(dummy->Des());
   815 	dummyPtr.Set(dummy->Des());
   816 	FillBuffer(dummyPtr, 4, '1');
   816 	FillBuffer(dummyPtr, 4, '1');
   817 
   817 
   818 	r = fileWrite.Open(gTheFs,gSecondFile,EFileShareAny|EFileWrite|EFileWriteBuffered);
   818 	r = fileWrite.Open(gTheFs,gSecondFile,EFileShareAny|EFileWrite|EFileWriteBuffered);
   891 	// create a big buffer to speed things up
   891 	// create a big buffer to speed things up
   892 	HBufC8* bigBuf = NULL;
   892 	HBufC8* bigBuf = NULL;
   893 	TInt KBigBifferSize = 32 * KOneK;
   893 	TInt KBigBifferSize = 32 * KOneK;
   894 	
   894 	
   895 	TRAPD(res,bigBuf = HBufC8::NewL(KBigBifferSize));
   895 	TRAPD(res,bigBuf = HBufC8::NewL(KBigBifferSize));
   896 	test(res == KErrNone && bigBuf != NULL);
   896 	test_Value(res, res == KErrNone && bigBuf != NULL);
   897 		
   897 		
   898 	TPtr8 bigBufWritePtr(NULL, 0);	
   898 	TPtr8 bigBufWritePtr(NULL, 0);	
   899 	bigBufWritePtr.Set(bigBuf->Des());
   899 	bigBufWritePtr.Set(bigBuf->Des());
   900 	FillBuffer(bigBufWritePtr, KBigBifferSize, 'A');
   900 	FillBuffer(bigBufWritePtr, KBigBifferSize, 'A');
   901 	
   901 	
   957 
   957 
   958 	// create a big buffer to speed things up
   958 	// create a big buffer to speed things up
   959 	HBufC8* bigBuf = NULL;
   959 	HBufC8* bigBuf = NULL;
   960 	const TInt KBigBifferSize = 32 * 1024;
   960 	const TInt KBigBifferSize = 32 * 1024;
   961 	TRAPD(res,bigBuf = HBufC8::NewL(KBigBifferSize));
   961 	TRAPD(res,bigBuf = HBufC8::NewL(KBigBifferSize));
   962 	test(res == KErrNone && bigBuf != NULL);
   962 	test_Value(res, res == KErrNone && bigBuf != NULL);
   963 		
   963 		
   964 	TPtr8 bigBufWritePtr(NULL, 0);	
   964 	TPtr8 bigBufWritePtr(NULL, 0);	
   965 	bigBufWritePtr.Set(bigBuf->Des());
   965 	bigBufWritePtr.Set(bigBuf->Des());
   966 	FillBuffer(bigBufWritePtr, KBigBifferSize, 'A');
   966 	FillBuffer(bigBufWritePtr, KBigBifferSize, 'A');
   967 	
   967 	
  1014 	TBuf16<50> buffer(50); 	
  1014 	TBuf16<50> buffer(50); 	
  1015 	HBufC8* buf = NULL;
  1015 	HBufC8* buf = NULL;
  1016 	TPtr8 bufPtr(NULL, 0);	
  1016 	TPtr8 bufPtr(NULL, 0);	
  1017 	
  1017 	
  1018 	TRAPD(res,buf = HBufC8::NewL(2));
  1018 	TRAPD(res,buf = HBufC8::NewL(2));
  1019 	test(res == KErrNone && buf != NULL);
  1019 	test_Value(res, res == KErrNone && buf != NULL);
  1020 	bufPtr.Set(buf->Des());
  1020 	bufPtr.Set(buf->Des());
  1021 	
  1021 	
  1022 	directory = gSessionPath;
  1022 	directory = gSessionPath;
  1023 	
  1023 	
  1024 	i = 0;		
  1024 	i = 0;		
  1212 	dir.Append(gSecondFile);
  1212 	dir.Append(gSecondFile);
  1213 	gSecondFile = dir;
  1213 	gSecondFile = dir;
  1214 
  1214 
  1215 
  1215 
  1216 	TRAPD(res,gBuf = HBufC8::NewL(KBlockSize+1));
  1216 	TRAPD(res,gBuf = HBufC8::NewL(KBlockSize+1));
  1217 	test(res == KErrNone && gBuf != NULL);
  1217 	test_Value(res, res == KErrNone && gBuf != NULL);
  1218 		
  1218 		
  1219 	gBufWritePtr.Set(gBuf->Des());
  1219 	gBufWritePtr.Set(gBuf->Des());
  1220 	FillBuffer(gBufWritePtr, KBlockSize, 'A');
  1220 	FillBuffer(gBufWritePtr, KBlockSize, 'A');
  1221 	
  1221 	
  1222 	TRAPD(res2,gBufSec = HBufC8::NewL(KBlockSize+1));
  1222 	TRAPD(res2,gBufSec = HBufC8::NewL(KBlockSize+1));
  1297 	dir.Append(gSecondFile);
  1297 	dir.Append(gSecondFile);
  1298 	gSecondFile = dir;
  1298 	gSecondFile = dir;
  1299 
  1299 
  1300 
  1300 
  1301 	TRAPD(res,gBuf = HBufC8::NewL(KBlockSize+1));
  1301 	TRAPD(res,gBuf = HBufC8::NewL(KBlockSize+1));
  1302 	test(res == KErrNone && gBuf != NULL);
  1302 	test_Value(res, res == KErrNone && gBuf != NULL);
  1303 		
  1303 		
  1304 	gBufWritePtr.Set(gBuf->Des());
  1304 	gBufWritePtr.Set(gBuf->Des());
  1305 	FillBuffer(gBufWritePtr, KBlockSize, 'A');
  1305 	FillBuffer(gBufWritePtr, KBlockSize, 'A');
  1306 	
  1306 	
  1307 	TRAPD(res2,gBufSec = HBufC8::NewL(KBlockSize+1));
  1307 	TRAPD(res2,gBufSec = HBufC8::NewL(KBlockSize+1));