diff -r 2bb96f4ecad8 -r 8e7494275d3a contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtn.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentctrl_plat/ds_contactsdatastoreextension_api/tsrc/src/TestCntDataStoreExtn.cpp Tue Aug 31 15:05:37 2010 +0300 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2002 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: definition of dm constants/exported methods +* This is part of remotemgmt_plat. +* +*/ + + + +// INCLUDE FILES +#include +#include +#include "TestCntDataStoreExtn.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTestCntDataStoreExtn::CTestCntDataStoreExtn +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTestCntDataStoreExtn::CTestCntDataStoreExtn( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CTestCntDataStoreExtn::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTestCntDataStoreExtn::ConstructL() + { + iLog = CStifLogger::NewL( KTestCntDataStoreExtnLogPath, + KTestCntDataStoreExtnLogFile, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + iCntDataStoreExtension = CNsmlContactsDataStoreExtension::NewL( _L("symbian") ); + iEntryArray = new(ELeave) CArrayFixFlat(4); + } + +// ----------------------------------------------------------------------------- +// CTestCntDataStoreExtn::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTestCntDataStoreExtn* CTestCntDataStoreExtn::NewL( + CTestModuleIf& aTestModuleIf ) + { + CTestCntDataStoreExtn* self = new (ELeave) CTestCntDataStoreExtn( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + + } + +// Destructor +CTestCntDataStoreExtn::~CTestCntDataStoreExtn() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + if( iEntryArray ) + { + delete iEntryArray; + iEntryArray = NULL; + } + + if(iCntDataStoreExtension) + { + delete iCntDataStoreExtension; + iCntDataStoreExtension = NULL; + } + + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CTestCntDataStoreExtn::NewL( aTestModuleIf ); + + } + + +// End of File