diff -r 9f5ae1728557 -r db3f5fa34ec7 messagingfw/msgurlhandler/test/basic/inc/SmsSchemeHandlerTransitionValidation.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingfw/msgurlhandler/test/basic/inc/SmsSchemeHandlerTransitionValidation.inl Wed Nov 03 22:41:46 2010 +0530 @@ -0,0 +1,115 @@ +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// The implementation of the transition validation classes upon the CSmsSchemeHandler class methods. +// +// + +/** + @file + @SYMCreationDate Created : 01/06/01 14:07:24 +*/ + +// ______________________________________________________________________________ +// +inline TSmsSchemeHandler_Ctor_TransitionValidator::TSmsSchemeHandler_Ctor_TransitionValidator(CUnitTestContext& aUTContext) +:TTransitionValidator(aUTContext) + { + // Do nothing + } + +inline TBool TSmsSchemeHandler_Ctor_TransitionValidator::ValidatePreConditions() + { + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CSmsSchemeHandler_UnitTestContext&,iUTContext).iSmsSchemeHandler)) + return EFalse; + return ETrue; + } + +inline TBool TSmsSchemeHandler_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) + { + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CSmsSchemeHandler_UnitTestContext&,iUTContext).iSmsSchemeHandler)) + return EFalse; + return ETrue; + } + +// ______________________________________________________________________________ +// +inline TSmsSchemeHandler_Dtor_TransitionValidator::TSmsSchemeHandler_Dtor_TransitionValidator(CUnitTestContext& aUTContext) +:TTransitionValidator(aUTContext) + { + // Do nothing + } + +inline TBool TSmsSchemeHandler_Dtor_TransitionValidator::ValidatePreConditions() + { + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CSmsSchemeHandler_UnitTestContext&,iUTContext).iSmsSchemeHandler)) + return EFalse; + return ETrue; + } + +inline TBool TSmsSchemeHandler_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) + { + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CSmsSchemeHandler_UnitTestContext&,iUTContext).iSmsSchemeHandler)) + return EFalse; + return ETrue; + } + + +// ______________________________________________________________________________ +// +inline TSmsSchemeHandler_ParseUrlL_TransitionValidator::TSmsSchemeHandler_ParseUrlL_TransitionValidator(CUnitTestContext& aUTContext) +:TTransitionValidator(aUTContext) + { + // Do nothing + } + +inline TBool TSmsSchemeHandler_ParseUrlL_TransitionValidator::ValidatePreConditions() + { + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CSmsSchemeHandler_UnitTestContext&,iUTContext).iSmsSchemeHandler)) + return EFalse; + return ETrue; + } + +inline TBool TSmsSchemeHandler_ParseUrlL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) + { + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CSmsSchemeHandler_UnitTestContext&,iUTContext).iSmsSchemeHandler)) + return EFalse; + + CSmsSchemeHandler* schemeHandler = REINTERPRET_CAST(CSmsSchemeHandler_UnitTestContext&,iUTContext).iSmsSchemeHandler; + TSmsSchemeHandler_StateAccessor* stateAccessor = &REINTERPRET_CAST(TSmsSchemeHandler_StateAccessor&, iUTContext.StateAccessor()); + RArray smsArray = stateAccessor->GetSmsArray(*schemeHandler); + const TInt smsCount = smsArray.Count(); + + RArray postCheck = REINTERPRET_CAST(CSmsSchemeHandler_UnitTestContext&,iUTContext).iPostCheck; + + for (TInt i=0; i