persistentstorage/centralrepository/test/t_cenrep_defects.cpp
changeset 1 c084286672be
parent 0 08ec8eefde2f
equal deleted inserted replaced
0:08ec8eefde2f 1:c084286672be
  2735     newRom.Close();
  2735     newRom.Close();
  2736     
  2736     
  2737     __UHEAP_MARKEND;
  2737     __UHEAP_MARKEND;
  2738     } 
  2738     } 
  2739 
  2739 
       
  2740 LOCAL_C void ConnectStartSuicideTransL(void)
       
  2741     {
       
  2742     const TUid KLargeReposUid1 ={0xcccccc00};   
       
  2743     CRepository* repository=CRepository::NewL(KLargeReposUid1);
       
  2744     repository->StartTransaction(CRepository::EConcurrentReadWriteTransaction);
       
  2745     }
       
  2746 
       
  2747 LOCAL_C TInt SuicidalTransThread(TAny*)
       
  2748     {
       
  2749     CTrapCleanup* cleanup = CTrapCleanup::New();
       
  2750     if(!cleanup)
       
  2751         return KErrNoMemory;
       
  2752 
       
  2753     TRAP_IGNORE(ConnectStartSuicideTransL());
       
  2754     //purposely waiting to be killed
       
  2755     User::WaitForAnyRequest();
       
  2756     return 0;
       
  2757     }
       
  2758 
       
  2759 LOCAL_C void DEF143352L()
       
  2760     {
       
  2761     CleanupCDriveL();    
       
  2762     __UHEAP_MARK;
       
  2763 
       
  2764     const TUid KLargeReposUid1 ={0xcccccc00};
       
  2765     //create on in this thread and start transaction too
       
  2766     CRepository* rep1=CRepository::NewL(KLargeReposUid1);
       
  2767     User::LeaveIfError(rep1->StartTransaction(CRepository::EConcurrentReadWriteTransaction));
       
  2768     
       
  2769     //create thread to connect, start transaction on the same repository as previous
       
  2770     RThread testThread;
       
  2771     _LIT(KThreadName1, "Martin");
       
  2772     testThread.Create(KThreadName1, SuicidalTransThread, KDefaultStackSize, KMinHeapSize, 0x100000, NULL);
       
  2773 
       
  2774     TRequestStatus requestStatus;
       
  2775     testThread.Logon(requestStatus);
       
  2776     testThread.Resume();
       
  2777 
       
  2778     //wait for the first client to complete the start transaction
       
  2779     User::After(1000000);
       
  2780     
       
  2781     //opening another big keyspace to force the eviction(cache size is 100K) both repository is about 78K in the heap
       
  2782     //cccccc03 is exactly the same as cccccc00
       
  2783     const TUid KLargeReposUid2 ={0xcccccc04};
       
  2784     CRepository* rep2=CRepository::NewL(KLargeReposUid2);
       
  2785    
       
  2786     //now kill the thread we have created
       
  2787     testThread.Kill(KErrDied);
       
  2788     User::WaitForRequest(requestStatus);
       
  2789     TEST2(requestStatus.Int(), KErrDied);
       
  2790     
       
  2791     //Wait for the session to be cleaned up
       
  2792     User::After(1000000);
       
  2793     
       
  2794     //now current test thread will retry the same connection
       
  2795     //at this stage server will panic with kern-exec 3
       
  2796     CRepository* rep4=CRepository::NewL(KLargeReposUid1);
       
  2797     
       
  2798     delete rep1;
       
  2799     delete rep2;
       
  2800     delete rep4;
       
  2801     
       
  2802     __UHEAP_MARKEND;
       
  2803     }
  2740 	
  2804 	
  2741 LOCAL_C void FuncTestsL()
  2805 LOCAL_C void FuncTestsL()
  2742 	{
  2806 	{
  2743 
       
  2744 	TheTest.Start(_L("DEF053500 - Central repository integer type key entries cannot handle hex values"));
  2807 	TheTest.Start(_L("DEF053500 - Central repository integer type key entries cannot handle hex values"));
  2745 
  2808 
  2746 	DEF053500L();
  2809 	DEF053500L();
  2747 
  2810 
  2748 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-CENTRALREPOSITORY-CT-4015 DEF111734 - Central repository crashes when accessing a closed repository with active transaction "));
  2811 	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-CENTRALREPOSITORY-CT-4015 DEF111734 - Central repository crashes when accessing a closed repository with active transaction "));
  2854 	TheTest.Next(_L("@SYMTestCaseID:PDS-CENTRALREPOSITORY-UT-4085 PDEF139979: Central Repository: Trying to configure Central Repository cache with centrep.in  "));
  2917 	TheTest.Next(_L("@SYMTestCaseID:PDS-CENTRALREPOSITORY-UT-4085 PDEF139979: Central Repository: Trying to configure Central Repository cache with centrep.in  "));
  2855   PDEF139979L();
  2918   PDEF139979L();
  2856 
  2919 
  2857 	TheTest.Next(_L("@SYMTestCaseID:PDS-CENTRALREPOSITORY-UT-4086 PDEF141518: centralrepositorysrv.exe crashes and phone doesn't boot up "));
  2920 	TheTest.Next(_L("@SYMTestCaseID:PDS-CENTRALREPOSITORY-UT-4086 PDEF141518: centralrepositorysrv.exe crashes and phone doesn't boot up "));
  2858 	PDEF141519L(); 
  2921 	PDEF141519L(); 
       
  2922 
       
  2923 	TheTest.Next(_L("@SYMTestCaseID:PDS-CENTRALREPOSITORY-CT-XXXX DEF143352: CentralRepository server crash in CObservable::RefreshTransactorAccessPolicies "));
       
  2924 	DEF143352L();
  2859 
  2925 
  2860 	TheTest.End();
  2926 	TheTest.End();
  2861 	}
  2927 	}
  2862 
  2928 
  2863 LOCAL_C void MainL()
  2929 LOCAL_C void MainL()