sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This file contains the definition of the sl@0: // class CAllTransitionsUnitTest sl@0: // Note : All the REComSession references from this file sl@0: // These are simple fudges for early development tests sl@0: // before the true server migration of the code. sl@0: // sl@0: // sl@0: sl@0: #include sl@0: sl@0: #include "TestUtilities.h" // For __FILE__LINE__ sl@0: #include "Interface.h" sl@0: #include sl@0: sl@0: #include "MagicUnitTests.h" sl@0: #include "MagicTransitions.h" sl@0: #include "MagicTransitionValidation.h" sl@0: sl@0: #include "TlsData.h" // For GlobalData sl@0: sl@0: #define UNUSED_VAR(a) a = a sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KInterfaceCreateAndDestroyUnitTest,"CExampleInterfaceCreateAndDestroyUnitTest"); sl@0: sl@0: CExampleInterfaceCreateAndDestroyUnitTest* CExampleInterfaceCreateAndDestroyUnitTest::NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: { sl@0: CExampleInterfaceCreateAndDestroyUnitTest* self = sl@0: new(ELeave) CExampleInterfaceCreateAndDestroyUnitTest(aDataLogger, sl@0: aObserver); sl@0: CleanupStack::PushL(self); sl@0: // Chain to the base which calls the ConstructL sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: TInt CExampleInterfaceCreateAndDestroyUnitTest::RunError(TInt aError) sl@0: { sl@0: // The RunL left so chain to the base first and then cleanup sl@0: TInt error = CUnitTest::RunError(aError); // Chain to base sl@0: delete iUTContext; sl@0: iUTContext = NULL; sl@0: delete iStateAccessor; sl@0: iStateAccessor = NULL; sl@0: delete iCtorValidator; sl@0: delete iDtorValidator; sl@0: iCtorValidator = 0; sl@0: iDtorValidator = 0; sl@0: sl@0: return error; sl@0: } sl@0: sl@0: CExampleInterfaceCreateAndDestroyUnitTest::~CExampleInterfaceCreateAndDestroyUnitTest() sl@0: { sl@0: // Simply delete our test class instance sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: delete iCtorValidator; sl@0: delete iDtorValidator; sl@0: sl@0: } sl@0: sl@0: CExampleInterfaceCreateAndDestroyUnitTest::CExampleInterfaceCreateAndDestroyUnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: : CUnitTest(KInterfaceCreateAndDestroyUnitTest, aDataLogger, aObserver) sl@0: { sl@0: //Do nothing sl@0: } sl@0: sl@0: // Now the Individual transitions need to be added. sl@0: void CExampleInterfaceCreateAndDestroyUnitTest::ConstructL() sl@0: { sl@0: // Perform the base class initialization sl@0: UnitTestConstructL(); sl@0: sl@0: // Create the Unit test state accessor sl@0: iStateAccessor = new(ELeave) TExampleInterface_StateAccessor(); sl@0: sl@0: // context sl@0: iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this); sl@0: sl@0: // Add the Transitions in the order they are to run sl@0: // C'tor first, D'tor last... sl@0: iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceNewLTransition(*iUTContext,*iCtorValidator)); sl@0: sl@0: iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext,*iDtorValidator)); sl@0: } sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KExampleInterfaceAltCreateAndDestroyUnitTest,"CExampleInterfaceAltCreateAndDestroyUnitTest"); sl@0: sl@0: CExampleInterfaceAltCreateAndDestroyUnitTest* CExampleInterfaceAltCreateAndDestroyUnitTest::NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: { sl@0: CExampleInterfaceAltCreateAndDestroyUnitTest* self = sl@0: new(ELeave) CExampleInterfaceAltCreateAndDestroyUnitTest(aDataLogger, sl@0: aObserver); sl@0: CleanupStack::PushL(self); sl@0: // Chain to the base which calls the ConstructL sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: TInt CExampleInterfaceAltCreateAndDestroyUnitTest::RunError(TInt aError) sl@0: { sl@0: // The RunL left so chain to the base first and then cleanup sl@0: TInt error = CUnitTest::RunError(aError); // Chain to base sl@0: delete iUTContext; sl@0: iUTContext = NULL; sl@0: delete iStateAccessor; sl@0: iStateAccessor = NULL; sl@0: delete iCtorValidator; sl@0: iCtorValidator = NULL; sl@0: delete iDtorValidator; sl@0: iDtorValidator = NULL; sl@0: sl@0: return error; sl@0: } sl@0: sl@0: CExampleInterfaceAltCreateAndDestroyUnitTest::~CExampleInterfaceAltCreateAndDestroyUnitTest() sl@0: { sl@0: // Simply delete our test class instance sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: delete iCtorValidator; sl@0: delete iDtorValidator; sl@0: sl@0: } sl@0: sl@0: CExampleInterfaceAltCreateAndDestroyUnitTest::CExampleInterfaceAltCreateAndDestroyUnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: : CUnitTest(KExampleInterfaceAltCreateAndDestroyUnitTest, aDataLogger, aObserver) sl@0: { sl@0: //Do nothing sl@0: } sl@0: sl@0: // Now the Individual transitions need to be added. sl@0: void CExampleInterfaceAltCreateAndDestroyUnitTest::ConstructL() sl@0: { sl@0: // Perform the base class initialization sl@0: UnitTestConstructL(); sl@0: sl@0: // Create the Unit test state accessor sl@0: iStateAccessor = new(ELeave) TExampleInterface_StateAccessor(); sl@0: // context sl@0: iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this); sl@0: sl@0: // Create the required validators sl@0: iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext); sl@0: iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext); sl@0: sl@0: // Add the transitions in the order they are to run sl@0: AddTransitionL(new(ELeave)CExampleInterfaceNewWPLTransition(*iUTContext, *iCtorValidator)); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext, *iDtorValidator)); sl@0: sl@0: AddTransitionL(new(ELeave)CExampleInterfaceNewResolveLTransition(*iUTContext, *iCtorValidator)); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext, *iDtorValidator)); sl@0: sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KExampleInterfaceListAllImplementationsUnitTest,"CExampleInterface_ListImplementations_UnitTest"); sl@0: sl@0: CExampleInterface_ListImplementations_UnitTest* CExampleInterface_ListImplementations_UnitTest::NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: { sl@0: CExampleInterface_ListImplementations_UnitTest* self = sl@0: new(ELeave) CExampleInterface_ListImplementations_UnitTest(aDataLogger, sl@0: aObserver); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: inline TInt CExampleInterface_ListImplementations_UnitTest::RunError(TInt aError) sl@0: { sl@0: // The RunL left so chain to the base first and then cleanup sl@0: TInt error = CUnitTest::RunError(aError); // Chain to base sl@0: delete iUTContext; sl@0: iUTContext = NULL; sl@0: delete iStateAccessor; sl@0: // delete any validators used sl@0: delete iCtorValidator; sl@0: iCtorValidator = NULL; sl@0: delete iListImplementationsValidator; sl@0: iListImplementationsValidator = NULL; sl@0: delete iDtorValidator; sl@0: iDtorValidator = NULL; sl@0: sl@0: return error; sl@0: } sl@0: sl@0: inline CExampleInterface_ListImplementations_UnitTest::~CExampleInterface_ListImplementations_UnitTest() sl@0: { sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: // delete any validators used sl@0: delete iCtorValidator; sl@0: delete iListImplementationsValidator; sl@0: delete iDtorValidator; sl@0: } sl@0: sl@0: inline CExampleInterface_ListImplementations_UnitTest::CExampleInterface_ListImplementations_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: : CUnitTest(KExampleInterfaceListAllImplementationsUnitTest, aDataLogger, aObserver) sl@0: { sl@0: //Do nothing sl@0: } sl@0: sl@0: // Now the Individual transitions need to be added. sl@0: inline void CExampleInterface_ListImplementations_UnitTest::ConstructL() sl@0: { sl@0: // Perform the base class initialization sl@0: UnitTestConstructL(); sl@0: sl@0: // Create the Unit test state accessor sl@0: iStateAccessor = new(ELeave) TExampleInterface_StateAccessor; sl@0: // Construct the Unit test context. sl@0: iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this); sl@0: // Add the Transitions in the order they are to run sl@0: // C'tor first, D'tor last... sl@0: // Examples of C'tor and D'tor transitions on CExampleInterface class. sl@0: // using ctor and dtor validators sl@0: iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceNewLTransition(*iUTContext,*iCtorValidator)); sl@0: sl@0: iListImplementationsValidator = new(ELeave) TExampleInterface_ListImplementations_TransitionValidator(*iUTContext); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceListAllImplementationsLTransition(*iUTContext,*iListImplementationsValidator)); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceListImplementationsLTransition(*iUTContext,*iListImplementationsValidator)); sl@0: sl@0: iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext,*iDtorValidator)); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KExampleInterfaceDefectHAN4WZHSYUnitTest,"CExampleInterface_DefectHAN4WZHSY_UnitTest"); sl@0: sl@0: CExampleInterface_DefectHAN4WZHSY_UnitTest* CExampleInterface_DefectHAN4WZHSY_UnitTest::NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: { sl@0: CExampleInterface_DefectHAN4WZHSY_UnitTest* self = sl@0: new(ELeave) CExampleInterface_DefectHAN4WZHSY_UnitTest(aDataLogger, sl@0: aObserver); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: inline TInt CExampleInterface_DefectHAN4WZHSY_UnitTest::RunError(TInt aError) sl@0: { sl@0: // The RunL left so chain to the base first and then cleanup sl@0: TInt error = CUnitTest::RunError(aError); // Chain to base sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: sl@0: iUTContext = 0; sl@0: iStateAccessor = 0; sl@0: sl@0: delete iCtorValidator; sl@0: delete iDtorValidator; sl@0: sl@0: iCtorValidator = 0; sl@0: iDtorValidator = 0; sl@0: sl@0: return error; sl@0: } sl@0: sl@0: inline CExampleInterface_DefectHAN4WZHSY_UnitTest::~CExampleInterface_DefectHAN4WZHSY_UnitTest() sl@0: { sl@0: // Simply delete our test class instance sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: sl@0: delete iCtorValidator; sl@0: delete iDtorValidator; sl@0: } sl@0: sl@0: inline CExampleInterface_DefectHAN4WZHSY_UnitTest::CExampleInterface_DefectHAN4WZHSY_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: : CUnitTest(KExampleInterfaceDefectHAN4WZHSYUnitTest, aDataLogger, aObserver) sl@0: { sl@0: //Do nothing sl@0: } sl@0: sl@0: // Now the Individual transitions need to be added. sl@0: inline void CExampleInterface_DefectHAN4WZHSY_UnitTest::ConstructL() sl@0: { sl@0: // Perform the base class initialization sl@0: UnitTestConstructL(); sl@0: sl@0: // Create the Unit test state accessor sl@0: iStateAccessor = new(ELeave) TExampleInterface_StateAccessor; sl@0: // Construct the Unit test context. sl@0: iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this); sl@0: sl@0: iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext); sl@0: iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext); sl@0: sl@0: AddTransitionL(new(ELeave)CExampleInterfaceNewLTransition(*iUTContext,*iCtorValidator)); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext,*iDtorValidator)); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KExampleInterfaceDefectCUO4YCEUEUnitTest,"CExampleInterface_DefectCUO4YCEUE_UnitTest"); sl@0: sl@0: CExampleInterface_DefectCUO4YCEUE_UnitTest* CExampleInterface_DefectCUO4YCEUE_UnitTest::NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: { sl@0: CExampleInterface_DefectCUO4YCEUE_UnitTest* self = sl@0: new(ELeave) CExampleInterface_DefectCUO4YCEUE_UnitTest(aDataLogger, sl@0: aObserver); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: inline TInt CExampleInterface_DefectCUO4YCEUE_UnitTest::RunError(TInt aError) sl@0: { sl@0: // The RunL left so chain to the base first and then cleanup sl@0: TInt error = CUnitTest::RunError(aError); // Chain to base sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: sl@0: delete iCtorValidator; sl@0: delete iDtorValidator; sl@0: sl@0: iUTContext = 0; sl@0: iStateAccessor = 0; sl@0: sl@0: iCtorValidator = 0; sl@0: iDtorValidator = 0; sl@0: sl@0: return error; sl@0: } sl@0: sl@0: inline CExampleInterface_DefectCUO4YCEUE_UnitTest::~CExampleInterface_DefectCUO4YCEUE_UnitTest() sl@0: { sl@0: // Simply delete our test class instance sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: sl@0: delete iCtorValidator; sl@0: delete iDtorValidator; sl@0: } sl@0: sl@0: inline CExampleInterface_DefectCUO4YCEUE_UnitTest::CExampleInterface_DefectCUO4YCEUE_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: : CUnitTest(KExampleInterfaceDefectCUO4YCEUEUnitTest, aDataLogger, aObserver) sl@0: { sl@0: //Do nothing sl@0: } sl@0: sl@0: // Now the Individual transitions need to be added. sl@0: inline void CExampleInterface_DefectCUO4YCEUE_UnitTest::ConstructL() sl@0: { sl@0: // Perform the base class initialization sl@0: UnitTestConstructL(); sl@0: sl@0: // Create the Unit test state accessor sl@0: iStateAccessor = new(ELeave) TExampleInterface_StateAccessor; sl@0: // Construct the Unit test context. sl@0: iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this); sl@0: sl@0: iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext); sl@0: iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext); sl@0: sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDoubleNewLTransition(*iUTContext,*iCtorValidator)); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDoubleDtorTransition(*iUTContext,*iDtorValidator)); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KExampleInterfaceDefectEVS4Z9BPGUnitTest,"CExampleInterface_DefectEVS4Z9BPG_UnitTest"); sl@0: sl@0: CExampleInterface_DefectEVS4Z9BPG_UnitTest* CExampleInterface_DefectEVS4Z9BPG_UnitTest::NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: { sl@0: CExampleInterface_DefectEVS4Z9BPG_UnitTest* self = sl@0: new(ELeave) CExampleInterface_DefectEVS4Z9BPG_UnitTest(aDataLogger, sl@0: aObserver); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: inline TInt CExampleInterface_DefectEVS4Z9BPG_UnitTest::RunError(TInt aError) sl@0: { sl@0: // The RunL left so chain to the base first and then cleanup sl@0: TInt error = CUnitTest::RunError(aError); // Chain to base sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: sl@0: delete iCtorValidator; sl@0: delete iDefaultValidator; sl@0: delete iDtorValidator; sl@0: sl@0: iUTContext = 0; sl@0: iStateAccessor = 0; sl@0: sl@0: iCtorValidator = 0; sl@0: iDefaultValidator = 0; sl@0: iDtorValidator = 0; sl@0: sl@0: return error; sl@0: } sl@0: sl@0: inline CExampleInterface_DefectEVS4Z9BPG_UnitTest::~CExampleInterface_DefectEVS4Z9BPG_UnitTest() sl@0: { sl@0: // Simply delete our test class instance sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: sl@0: delete iCtorValidator; sl@0: delete iDefaultValidator; sl@0: delete iDtorValidator; sl@0: } sl@0: sl@0: inline CExampleInterface_DefectEVS4Z9BPG_UnitTest::CExampleInterface_DefectEVS4Z9BPG_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: : CUnitTest(KExampleInterfaceDefectEVS4Z9BPGUnitTest, aDataLogger, aObserver) sl@0: { sl@0: //Do nothing sl@0: } sl@0: sl@0: // Now the Individual transitions need to be added. sl@0: inline void CExampleInterface_DefectEVS4Z9BPG_UnitTest::ConstructL() sl@0: { sl@0: // Perform the base class initialization sl@0: UnitTestConstructL(); sl@0: sl@0: // Create the Unit test state accessor sl@0: iStateAccessor = new(ELeave) TExampleInterface_StateAccessor; sl@0: // Construct the Unit test context. sl@0: iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this); sl@0: sl@0: iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext); sl@0: iDefaultValidator = new(ELeave) TExampleInterface_Default_TransitionValidator(*iUTContext); sl@0: iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext); sl@0: sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDoubleNewLTransition(*iUTContext,*iCtorValidator)); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDoMethodLTransition(*iUTContext,*iDefaultValidator)); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceDoubleDtorTransition(*iUTContext,*iDtorValidator)); sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KExampleInterfaceDefectKRN53SL4QUnitTest,"CExampleInterface_DefectKRN53SL4Q_UnitTest"); sl@0: sl@0: CExampleInterface_DefectKRN53SL4Q_UnitTest* CExampleInterface_DefectKRN53SL4Q_UnitTest::NewL(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: { sl@0: CExampleInterface_DefectKRN53SL4Q_UnitTest* self = sl@0: new(ELeave) CExampleInterface_DefectKRN53SL4Q_UnitTest(aDataLogger, sl@0: aObserver); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: inline TInt CExampleInterface_DefectKRN53SL4Q_UnitTest::RunError(TInt aError) sl@0: { sl@0: // The RunL left so chain to the base first and then cleanup sl@0: TInt error = CUnitTest::RunError(aError); // Chain to base sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: sl@0: delete iCtorValidator; sl@0: delete iDefaultValidator; sl@0: delete iDtorValidator; sl@0: sl@0: iUTContext = 0; sl@0: iStateAccessor = 0; sl@0: sl@0: iCtorValidator = 0; sl@0: iDefaultValidator = 0; sl@0: iDtorValidator = 0; sl@0: sl@0: return error; sl@0: } sl@0: sl@0: inline CExampleInterface_DefectKRN53SL4Q_UnitTest::~CExampleInterface_DefectKRN53SL4Q_UnitTest() sl@0: { sl@0: // Simply delete our test class instance sl@0: delete iUTContext; sl@0: delete iStateAccessor; sl@0: sl@0: delete iCtorValidator; sl@0: delete iDefaultValidator; sl@0: delete iDtorValidator; sl@0: } sl@0: sl@0: inline CExampleInterface_DefectKRN53SL4Q_UnitTest::CExampleInterface_DefectKRN53SL4Q_UnitTest(CDataLogger& aDataLogger, sl@0: MUnitTestObserver& aObserver) sl@0: : CUnitTest(KExampleInterfaceDefectKRN53SL4QUnitTest, aDataLogger, aObserver) sl@0: { sl@0: //Do nothing sl@0: } sl@0: sl@0: TInt ThreadFunc(TAny* aTrapHandler) sl@0: { sl@0: User::SetTrapHandler(REINTERPRET_CAST(TCleanupTrapHandler*, aTrapHandler)); sl@0: sl@0: RImplInfoPtrArray implementations; sl@0: TRAPD(error, CExampleInterface::ListImplementationsL(implementations)); sl@0: UNUSED_VAR(error); sl@0: return KErrNone; sl@0: } sl@0: sl@0: // Now the Individual transitions need to be added. sl@0: inline void CExampleInterface_DefectKRN53SL4Q_UnitTest::ConstructL() sl@0: { sl@0: // Perform the base class initialization sl@0: UnitTestConstructL(); sl@0: sl@0: // Create the Unit test state accessor sl@0: iStateAccessor = new(ELeave) TExampleInterface_StateAccessor; sl@0: // Construct the Unit test context. sl@0: iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this); sl@0: sl@0: _LIT(KNewThreadName, "ListImpl"); sl@0: User::Leave (KErrNone != iUTContext->iListImplThread.Create(KNewThreadName(), // The name of the thread sl@0: ThreadFunc, //CExampleInterface_UnitTestContext::ListImplementationsThreadFunction, // The function to be called when this thread resumes sl@0: 2048, // The stacksize for this thread sl@0: 2048, // min heap size sl@0: 2048, // max heap size sl@0: User::TrapHandler())); // Parameter to be passed to function sl@0: sl@0: sl@0: iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext); sl@0: iDefaultValidator = new(ELeave) TExampleInterface_Default_TransitionValidator(*iUTContext); sl@0: iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext); sl@0: sl@0: AddTransitionL(new(ELeave)CExampleInterfaceNewLTransition(*iUTContext,*iCtorValidator)); sl@0: AddTransitionL(new(ELeave)CExampleInterfaceListImplementationsLNewThreadTransition(*iUTContext,*iDefaultValidator)); sl@0: AddBlockingTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext,*iDtorValidator)); sl@0: } sl@0: