kerneltest/e32test/buffer/t_circ.cpp
changeset 247 d8d70de2bd36
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
   230 			Mem::FillZ(buf,arraySize);
   230 			Mem::FillZ(buf,arraySize);
   231 			test(cbInt->Remove(buf,arraySize)==arraySize);
   231 			test(cbInt->Remove(buf,arraySize)==arraySize);
   232 			test(Mem::Compare(buf,arraySize,theCharArray,arraySize)==KErrNone);
   232 			test(Mem::Compare(buf,arraySize,theCharArray,arraySize)==KErrNone);
   233 			}
   233 			}
   234 		}
   234 		}
       
   235 	
       
   236 	// Test Reset, Put and Get
       
   237 	TInt count = cbInt->Count();
       
   238 	test(count>0);
       
   239 	cbInt->Reset();
       
   240 	count = cbInt->Count();
       
   241 	test(count==0);
       
   242 	TUint index = 0;
       
   243 	
       
   244 	// Put 100 integers to the circular buffer.
       
   245 	TUint numberOfObjects= 100;
       
   246 	for(index=1;index<=numberOfObjects; index++)
       
   247 	    {
       
   248 	    TInt result= cbInt->Put(index);
       
   249 	    User::LeaveIfError(result);
       
   250 	    }
       
   251 	count = cbInt->Count();
       
   252 	test(count==100);
       
   253 	
       
   254 	// Get 50 integers from the circular buffer.
       
   255 	for(index=1;index<=(numberOfObjects/2); index++)
       
   256 	    {
       
   257 	    TUint cb = cbInt->Get();
       
   258 	    test(cb==index);
       
   259 	    }
       
   260 	count = cbInt->Count();
       
   261 	test(count==50);
       
   262 		
   235 	delete [] buf;
   263 	delete [] buf;
   236 	delete cbInt;
   264 	delete cbInt;
   237 	}
   265 	}
   238 
   266 
   239 LOCAL_C void TestRemove()
   267 LOCAL_C void TestRemove()