equal
deleted
inserted
replaced
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 |
|
263 delete [] buf; |
235 delete [] buf; |
264 delete cbInt; |
236 delete cbInt; |
265 } |
237 } |
266 |
238 |
267 LOCAL_C void TestRemove() |
239 LOCAL_C void TestRemove() |