equal
deleted
inserted
replaced
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
25 |
25 |
26 using namespace NCentralRepositoryConstants; |
26 using namespace NCentralRepositoryConstants; |
27 |
27 |
28 RTest TheTest(_L("Central Repository Defect Tests")); |
28 RTest TheTest(_L("Central Repository Defect Tests")); |
29 |
29 |
|
30 //Burst rate for __UHEAP_SETBURSTFAIL |
|
31 #ifdef _DEBUG |
|
32 const TInt KBurstRate = 20; |
|
33 #endif |
30 |
34 |
31 /////////////////////////////////////////////////////////////////////////////////////// |
35 /////////////////////////////////////////////////////////////////////////////////////// |
32 /////////////////////////////////////////////////////////////////////////////////////// |
36 /////////////////////////////////////////////////////////////////////////////////////// |
33 //Test macroses and functions |
37 //Test macroses and functions |
34 LOCAL_C void CheckL(TInt aValue, TInt aLine) |
38 LOCAL_C void CheckL(TInt aValue, TInt aLine) |
268 TInt startProcessHandleCount; |
272 TInt startProcessHandleCount; |
269 TInt startThreadHandleCount; |
273 TInt startThreadHandleCount; |
270 RThread().HandleCount(startProcessHandleCount, startThreadHandleCount); |
274 RThread().HandleCount(startProcessHandleCount, startThreadHandleCount); |
271 |
275 |
272 if (aOOMMode) |
276 if (aOOMMode) |
273 __UHEAP_SETFAIL(RHeap::EDeterministic, ++tryCount); |
277 __UHEAP_SETBURSTFAIL(RAllocator::EBurstFailNext, ++tryCount, KBurstRate); |
274 |
278 |
275 TRAP(err, TServerResources::iObserver->ProcessMultiRofsListL(*fileList)); |
279 TRAP(err, TServerResources::iObserver->ProcessMultiRofsListL(*fileList)); |
276 if (err!=KErrNoMemory) |
280 if (err!=KErrNoMemory) |
277 TEST(err==KErrNone); |
281 TEST(err==KErrNone); |
278 |
282 |
279 if (aOOMMode) |
283 if (aOOMMode) |
280 __UHEAP_SETFAIL(RHeap::ENone, 0); |
284 __UHEAP_RESET; |
281 |
285 |
282 // check that no handles have leaked |
286 // check that no handles have leaked |
283 TInt endProcessHandleCount; |
287 TInt endProcessHandleCount; |
284 TInt endThreadHandleCount; |
288 TInt endThreadHandleCount; |
285 RThread().HandleCount(endProcessHandleCount, endThreadHandleCount); |
289 RThread().HandleCount(endProcessHandleCount, endThreadHandleCount); |