# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272884954 -10800 # Node ID 55f2396f6d254ae9effd2e93bc71cf517e018bbb # Parent 3eacc06230887b06765e3a853a79723ec0c5f3cb Revision: 201018 Kit: 201018 diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/group/featmgr.mmp --- a/featuremgmt/featuremgr/group/featmgr.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/group/featmgr.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -26,6 +26,9 @@ VENDORID 0x70000001 CAPABILITY All -Tcb +//CodeWarrior compilation options - disable the "illegal pragma" warning +OPTION CW -w noillpragmas + SOURCEPATH ../src/clientdll SOURCE featmgrclient.cpp SOURCE featmgr.cpp diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/group/featmgrserver.mmp --- a/featuremgmt/featuremgr/group/featmgrserver.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/group/featmgrserver.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -29,6 +29,9 @@ CAPABILITY ProtServ ReadDeviceData +//CodeWarrior compilation options - disable the "illegal pragma" warning +OPTION CW -w noillpragmas + SOURCEPATH ../src/serverexe SOURCE featmgrpluginhandler.cpp diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/clientdll/featmgrclient.cpp --- a/featuremgmt/featuremgr/src/clientdll/featmgrclient.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/clientdll/featmgrclient.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -613,6 +613,9 @@ // DEBUG only API functions #ifdef EXTENDED_FEATURE_MANAGER_TEST + +#pragma BullseyeCoverage off + /** */ void RFeatMgrClient::ResourceMark() @@ -681,6 +684,8 @@ return sizePckg(); } +#pragma BullseyeCoverage on + #endif // End of File diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/clientdll/featmgrresourcetester.cpp --- a/featuremgmt/featuremgr/src/clientdll/featmgrresourcetester.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/clientdll/featmgrresourcetester.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -22,6 +22,8 @@ //Defined in featurecontrol.cpp extern CFeatMgrTlsData* TlsData(); +#pragma BullseyeCoverage off + /** */ EXPORT_C void TFeatMgrResourceTester::Mark() @@ -66,3 +68,5 @@ UNUSED_ARG(aRate); #endif } + +#pragma BullseyeCoverage on diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/clientdll/featmgrtlsdata.cpp --- a/featuremgmt/featuremgr/src/clientdll/featmgrtlsdata.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/clientdll/featmgrtlsdata.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -301,6 +301,8 @@ // debug only API functions #ifdef EXTENDED_FEATURE_MANAGER_TEST +#pragma BullseyeCoverage off + /** */ void CFeatMgrTlsData::ResourceMark() @@ -345,6 +347,9 @@ { return iFeatMgrClient.CountAllocCells(); } + +#pragma BullseyeCoverage on + #endif // End of File diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/clientdll/featurecontrol.cpp --- a/featuremgmt/featuremgr/src/clientdll/featurecontrol.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/clientdll/featurecontrol.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -75,7 +75,13 @@ if ( err == KErrNone ) { - Dll::SetTls( tlsData ); + err = Dll::SetTls( tlsData ); + if (err != KErrNone) + { + delete tlsData; + ERROR_LOG1( "RFeatureControl::Open SetTls error %d ", err ); + return err; + } } else { diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.cpp --- a/featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -550,9 +550,9 @@ //check that there is at least one DSR if (!iRangeList.Count()) { - _LIT( KPanicCategory, "FeatMgrServer" ); + _LIT(KPanicCategory, "FeatMgrServer"); ERROR_LOG( "CFeatMgrFeatureRegistry::ReadFilesFromDirL() - no DSR found in ROM; this indicates a system integration error - going to panic" ); - User::Panic( KPanicCategory, EPanicNoDSR ); + ::FmgrFatalErrorL(KErrNotFound, KPanicCategory, EPanicNoDSR); } } @@ -562,7 +562,7 @@ // void CFeatMgrFeatureRegistry::ReadFilesFromDirL( const TDesC& aDirName ) { - _LIT( KPanicCategory, "FEATMGR-READFILE" ); + _LIT(KPanicCategory, "FEATMGR-READFILE"); CDir* dir = NULL; TInt err( KErrNone ); @@ -581,7 +581,7 @@ } else if( err == KErrPathNotFound ) { - __ASSERT_ALWAYS( EFalse, User::Panic( KPanicCategory, EPanicNoFeatureFiles) ); + ::FmgrFatalErrorL(err, KPanicCategory, EPanicNoFeatureFiles); } else { @@ -722,7 +722,7 @@ } else //File is not as runtime file. { - err = ValidateFeatureFlag(flags); + ValidateFeatureFlagL(flags); } //If a feature flag defined in system drive (c:) is invalid, it will not be added to Feature Manager @@ -1025,7 +1025,7 @@ for ( TInt i = 0; i < count; i++ ) { //Check for feature flag errors - ValidateFeatureFlag(aList[i].FeatureFlags()) ; + ValidateFeatureFlagL(aList[i].FeatureFlags()) ; const TUid uid( aList[i].FeatureUid() ); TInt index = SearchFeature( uid ); @@ -1063,10 +1063,9 @@ // ----------------------------------------------------------------------------- // -TInt CFeatMgrFeatureRegistry::ValidateFeatureFlag(TBitFlags32 aFlags) +void CFeatMgrFeatureRegistry::ValidateFeatureFlagL(TBitFlags32 aFlags) { - _LIT( KPanicCategory, "FEATMGR-FLAGS" ); - + _LIT(KPanicCategory, "FEATMGR-FLAGS"); if(!aFlags.IsSet(EFeatureRuntime)) //ROM defined feature flag error check { @@ -1076,8 +1075,7 @@ if(aFlags.IsSet(EFeatureModifiable) || aFlags.IsSet(EFeaturePersisted) || aFlags.IsSet(EFeatureUninitialized) ) { //error - __ASSERT_ALWAYS(EFalse, User::Panic( KPanicCategory, EFmpInvalidFeatureBitFlagsRule1)); - return KErrArgument; + ::FmgrFatalErrorL(KErrArgument, KPanicCategory, EFmpInvalidFeatureBitFlagsRule1); } } @@ -1087,17 +1085,14 @@ if (aFlags.IsSet(EFeaturePersisted) || aFlags.IsSet(EFeatureUninitialized) ) { //error - __ASSERT_ALWAYS(EFalse, User::Panic( KPanicCategory, EFmpInvalidFeatureBitFlagsRule2)); - return KErrArgument; + ::FmgrFatalErrorL(KErrArgument, KPanicCategory, EFmpInvalidFeatureBitFlagsRule2); } } } else // Runtime feature this should not be in the rom { - __ASSERT_ALWAYS(EFalse, User::Panic( KPanicCategory, EPanicInvalidFeatureInfo)); - return KErrArgument; + ::FmgrFatalErrorL(KErrArgument, KPanicCategory, EPanicInvalidFeatureInfo); } - return KErrNone; } /** diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.h --- a/featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.h Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.h Mon May 03 14:09:14 2010 +0300 @@ -242,7 +242,7 @@ const TFeatureServerEntry& aItem ); void ValidateHeaderL( RFileReadStream& stream, TUint32& count, TUint32& countDSRs ); void WriteHeaderAndEntriesL( RFileWriteStream &aStream, RFeatureServerArray& aArray ); - TInt ValidateFeatureFlag(TBitFlags32 aFlags); + void ValidateFeatureFlagL(TBitFlags32 aFlags); void ValidateRuntimeFeatureFlagL(TBitFlags32 aFlags); private: diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/serverexe/featmgrpluginhandler.cpp --- a/featuremgmt/featuremgr/src/serverexe/featmgrpluginhandler.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/serverexe/featmgrpluginhandler.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -24,7 +24,7 @@ #include "featmgrserver.h" // LOCAL CONSTANTS -_LIT( KPanicCategory, "FeatMgrPluginHandler" ); +_LIT(KPanicCategory, "FeatMgrPluginHandler"); // ============================= LOCAL FUNCTIONS =============================== @@ -192,7 +192,7 @@ ERROR_LOG2( "CFeatMgrPluginHandler::ProcessFeatureInfoL - pluginhandler %x, error %d - going to panic", this, aResponse().iErrorCode ); // This is considered fatal enough reason to panic - User::Panic( KPanicCategory, EPanicInvalidFeatureInfo ); + ::FmgrFatalErrorL(aResponse().iErrorCode, KPanicCategory, EPanicInvalidFeatureInfo); } } @@ -243,7 +243,7 @@ ERROR_LOG2( "CFeatMgrPluginHandler::ProcessFeatureInfoL - pluginhandler %x, error %d - going to panic", this, aResponse().iErrorCode ); // This is considered fatal enough reason to panic - User::Panic( KPanicCategory, EPanicInvalidFeatureInfo ); + ::FmgrFatalErrorL(aResponse().iErrorCode, KPanicCategory, EPanicInvalidFeatureInfo); } } diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/serverexe/featmgrserver.cpp --- a/featuremgmt/featuremgr/src/serverexe/featmgrserver.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/serverexe/featmgrserver.cpp Mon May 03 14:09:14 2010 +0300 @@ -28,12 +28,7 @@ #include #include -// LOCAL CONSTANTS AND MACROS -#ifdef EXTENDED_FEATURE_MANAGER_TEST -_LIT( KPanicCategory, "EnhancedFeatMgrServer" ); -#else -_LIT( KPanicCategory, "FeatMgrServer" ); -#endif // EXTENDED_FEATURE_MANAGER_TEST +_LIT(KPanicCategory, "FeatMgrServer"); // ============================ MEMBER FUNCTIONS =============================== @@ -98,11 +93,11 @@ { case KErrNotFound: ERROR_LOG( "CFeatMgrServer::ConstructL() - no feature files found in ROM - going to panic"); - User::Panic( KPanicCategory, EPanicNoFeatureFiles ); + ::FmgrFatalErrorL(err, KPanicCategory, EPanicNoFeatureFiles); break; case KErrCorrupt: ERROR_LOG( "CFeatMgrServer::ConstructL() - feature information in ROM is invalid - going to panic"); - User::Panic( KPanicCategory, EPanicInvalidFeatureInfo ); + ::FmgrFatalErrorL(err, KPanicCategory, EPanicInvalidFeatureInfo); break; default: User::LeaveIfError(err); @@ -342,86 +337,47 @@ // Check if any plugin was found. TInt count = implInfoArray.Count(); - - if ( count > 0 ) + if(count == 0) { - - for(TInt i = 0; i < count; i ++) + iPluginsReady = ETrue; // Plugins not found. + INFO_LOG1("CFeatMgrServer::LoadPluginsL - interfaceUid.iUid == 0x%x, return plugins not found", KFeatureInfoPluginInterfaceUid); + ret = EFalse; + } + else + { + for(TInt i=0;iImplementationUid(), *this) ); - - LOG_IF_ERROR1( err, "CFeatMgrServer::LoadPluginsL() - pluginHandler creation err %d", err ); - - // Apply first request for plugin to process - if ( err == KErrNone ) - { - TRAP( err, pluginHandler->SendCommandL( - FeatureInfoCommand::ELoadFeatureInfoCmdId ) ); - } - - // Panic if error sth else than not supported - if ( err != KErrNone && err != KErrNotSupported ) + TRAPD(err, pluginHandler = CFeatMgrPluginHandler::NewL(implInfoArray[i]->ImplementationUid(), *this)); + if(err == KErrNone) { - ERROR_LOG2( "CFeatMgrServer::LoadPluginsL() - implementationUid: 0x%x, error: %d - going to panic", - implInfoArray[i]->ImplementationUid(), err ); - User::Panic( KPanicCategory, EPanicLoadPluginError ); - } - // If simple features are not supported by the plugin search for enhanced ones - else if ( err == KErrNotSupported ) - { - // Reset error code - err = KErrNone; - TRAP( err, pluginHandler->SendCommandL( - FeatureInfoCommand::ELoadEnhancedFeatureInfoCmdId ) ); - - // Panic if error since in this case the plugin does not support any feature - if ( err != KErrNone ) - { - ERROR_LOG2( "CFeatMgrServer::LoadPluginsL() - implementationUid: 0x%x, error: %d - going to panic", - implInfoArray[i]->ImplementationUid(), err ); - User::Panic( KPanicCategory, EPanicLoadPluginError ); - } - } - // If a simple or enhanced feature is supported by the plugin then append the plugin to the list - if ( err == KErrNone ) - { - INFO_LOG1( "CFeatMgrServer::LoadPluginsL() - Add info of implementationUid: 0x%x", - implInfoArray[i]->ImplementationUid() ); - - // Add information of the plugin to the plugin list - SFeatMgrPluginInfo plugin; - plugin.iPluginHandler = pluginHandler; - // Set all plugins as not ready initially - plugin.iPluginReady = EFalse; - - TInt err = iPluginList.Append(plugin); - - if ( err != KErrNone ) + CleanupStack::PushL(pluginHandler); + TRAP(err, pluginHandler->SendCommandL(FeatureInfoCommand::ELoadFeatureInfoCmdId)); + if(err == KErrNotSupported) { - ERROR_LOG2( "CFeatMgrServer::LoadPluginsL() - Saving plugin info of implementationUid: 0x%x, err %d", - implInfoArray[i]->ImplementationUid(), err ); - User::Leave( err ); + TRAP(err, pluginHandler->SendCommandL(FeatureInfoCommand::ELoadEnhancedFeatureInfoCmdId)); } } + if(err == KErrNoMemory) + { + User::Leave(err); + } + else if(err != KErrNone) + { + ERROR_LOG2("CFeatMgrServer::LoadPluginsL() - implementationUid: 0x%x, error: %d - going to panic", implInfoArray[i]->ImplementationUid(), err); + ::FmgrFatalErrorL(err, KPanicCategory, EPanicLoadPluginError); + } + // Add information of the plugin to the plugin list. Set all plugins as not ready initially. + SFeatMgrPluginInfo plugin; + plugin.iPluginHandler = pluginHandler; + plugin.iPluginReady = EFalse; + User::LeaveIfError(iPluginList.Append(plugin)); + CleanupStack::Pop(pluginHandler); } - INFO_LOG1( "CFeatMgrServer::LoadPluginsL - interfaceUid.iUid == 0x%x, return plugins found", - KFeatureInfoPluginInterfaceUid ); + INFO_LOG1("CFeatMgrServer::LoadPluginsL - interfaceUid.iUid == 0x%x, return plugins found", KFeatureInfoPluginInterfaceUid); ret = ETrue; } - else - { - iPluginsReady = ETrue; // Plugins not found. - INFO_LOG1( "CFeatMgrServer::LoadPluginsL - interfaceUid.iUid == 0x%x, return plugins not found", - KFeatureInfoPluginInterfaceUid ); - ret = EFalse; - } - CleanupStack::PopAndDestroy(&implInfoArray); return ret; @@ -536,7 +492,7 @@ if ( err != KErrNone && err != KErrNotSupported ) { ERROR_LOG1( "CFeatMgrServer::FeatureInfoL() - panicing due error %d", err ); - User::Panic( KPanicCategory, EPanicLoadPluginError ); + ::FmgrFatalErrorL(err, KPanicCategory, EPanicLoadPluginError); } // At this point we have simple feature supported by the plugin. // If no enhanced feature is supported, but a simple one is, then @@ -781,7 +737,7 @@ if( KErrNotFound == err) { ERROR_LOG( "CFeatMgrServer::ConstructL() & CallReadFeatureFilesL() - no feature files found in ROM - going to panic"); - User::Panic( KPanicCategory, EPanicNoFeatureFiles ); + ::FmgrFatalErrorL(err, KPanicCategory, EPanicNoFeatureFiles); } else { @@ -802,7 +758,7 @@ TRAPD( err, iRegistry->ReadRuntimeFeaturesL( iFeaturesReady ) ); if( KErrNotFound == err) { - User::Panic( KPanicCategory, EPanicNoFeatureFiles ); + ::FmgrFatalErrorL(err, KPanicCategory, EPanicNoFeatureFiles); } else { diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/serverexe/featmgrserver.h --- a/featuremgmt/featuremgr/src/serverexe/featmgrserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/serverexe/featmgrserver.h Mon May 03 14:09:14 2010 +0300 @@ -31,6 +31,18 @@ #include "featmgrfeatureregistry.h" #include "burstate.h" +#ifdef FEATURE_MANAGER_STARTUP_TEST + inline void FmgrFatalErrorL(TInt err, const TDesC&, TInt) + { + User::Leave(err); + } +#else + inline void FmgrFatalErrorL(TInt, const TDesC& aPanicCategory, TInt aPanicCode) + { + User::Panic(aPanicCategory, aPanicCode); + } +#endif + // FORWARD DECLARATIONS class CFeatMgrPluginHandler; class CFeatMgrFeatureRegistry; diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/src/serverexe/featmgrsession.cpp --- a/featuremgmt/featuremgr/src/serverexe/featmgrsession.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/src/serverexe/featmgrsession.cpp Mon May 03 14:09:14 2010 +0300 @@ -548,6 +548,8 @@ #ifdef EXTENDED_FEATURE_MANAGER_TEST +#pragma BullseyeCoverage off + case EFeatMgrResourceMark: ResourceCountMarkStart(); break; @@ -597,7 +599,10 @@ aMessage.WriteL( 0, resPckg ); break; - } + } + +#pragma BullseyeCoverage on + #endif // Cannot identify the message. diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/group/bld.inf --- a/featuremgmt/featuremgr/test/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -18,11 +18,11 @@ #include "../helper/test_plugins/group/bld.inf" #include "../helper/pluginhelper/group/bld.inf" #include "../helper/dummyswi/group/bld.inf" -#include "../helper/helping_exe/group/bld.inf" +#include "../helper/helping_exe/group/bld.inf" PRJ_TESTMMPFILES //Rtest project files -// These backup and restore tests are techview tests, therefore need to be marked as manual for ONB purpose. +// These backup and restore tests are techview tests, therefore need to be marked as manual for ONB purpose. ../rtest/group/t_fmgrbackupresponse.mmp manual ../rtest/group/t_fmgrrestoreresponse.mmp manual @@ -31,7 +31,7 @@ ../rtest/group/t_fmgroom.mmp ../rtest/group/t_fmgrstartup.mmp ../rtest/group/t_fmgrpanic.mmp -../rtest/group/t_fmgrbadclient.mmp manual +../rtest/group/t_fmgrbadclient.mmp ../rtest/group/t_fmgrsecurity1.mmp ../rtest/group/t_fmgrnotify.mmp ../rtest/group/t_fmgrperformance.mmp @@ -47,24 +47,24 @@ PRJ_TESTEXPORTS //TEF script files -../tef/group/tef_featmgr.script z:/test/efm/scripts/tef_featmgr.script -../tef/tef_efm_normal/scripts/tef_efm_normal.script z:/test/efm/scripts/tef_efm_normal.script -../tef/tef_efm_normal/scripts/tef_efm_normal.ini z:/test/efm/scripts/tef_efm_normal.ini -../tef/tef_efm_normal/scripts/tef_efm_normal_hardware.ini z:/test/efm/scripts/tef_efm_normal_hardware.ini -../tef/tef_efm_normal/scripts/tef_efm_fullcap.script z:/test/efm/scripts/tef_efm_fullcap.script -../tef/tef_efm_normal/scripts/tef_efm_lowcap.script z:/test/efm/scripts/tef_efm_lowcap.script -../tef/tef_efm_configured/scripts/tef_efm_configured.script z:/test/efm/scripts/tef_efm_configured.script -../tef/tef_efm_configured/scripts/tef_efm_performance.script z:/test/efm/scripts/tef_efm_performance.script -../tef/tef_efm_unit/scripts/tef_efm_unit.script z:/test/efm/scripts/tef_efm_unit.script -../tef/tef_efm_unit/scripts/tef_efm_unit.ini z:/test/efm/scripts/tef_efm_unit.ini -../tef/tef_efm_bursuite/scripts/tef_efm_bursuite.script z:/test/efm/scripts/tef_efm_bursuite.script +../tef/group/tef_featmgr.script z:/test/efm/scripts/tef_featmgr.script +../tef/tef_efm_normal/scripts/tef_efm_normal.script z:/test/efm/scripts/tef_efm_normal.script +../tef/tef_efm_normal/scripts/tef_efm_normal.ini z:/test/efm/scripts/tef_efm_normal.ini +../tef/tef_efm_normal/scripts/tef_efm_normal_hardware.ini z:/test/efm/scripts/tef_efm_normal_hardware.ini +../tef/tef_efm_normal/scripts/tef_efm_fullcap.script z:/test/efm/scripts/tef_efm_fullcap.script +../tef/tef_efm_normal/scripts/tef_efm_lowcap.script z:/test/efm/scripts/tef_efm_lowcap.script +../tef/tef_efm_configured/scripts/tef_efm_configured.script z:/test/efm/scripts/tef_efm_configured.script +../tef/tef_efm_configured/scripts/tef_efm_performance.script z:/test/efm/scripts/tef_efm_performance.script +../tef/tef_efm_unit/scripts/tef_efm_unit.script z:/test/efm/scripts/tef_efm_unit.script +../tef/tef_efm_unit/scripts/tef_efm_unit.ini z:/test/efm/scripts/tef_efm_unit.ini +../tef/tef_efm_bursuite/scripts/tef_efm_bursuite.script z:/test/efm/scripts/tef_efm_bursuite.script // .ini file for characterisation testing. -../tef/tef_efm_configured/scripts/characterise.ini z:/test/efm/scripts/characterise.ini +../tef/tef_efm_configured/scripts/characterise.ini z:/test/efm/scripts/characterise.ini //feature definition files for TEF feature generator ../tef/tef_feature_generator/config/reconciliation_features.ini z:/test/efm/scripts/reconciliation_features.ini -../tef/tef_feature_generator/config/persistence_features.ini z:/test/efm/scripts/persistence_features.ini +../tef/tef_feature_generator/config/persistence_features.ini z:/test/efm/scripts/persistence_features.ini ../tef/tef_feature_generator/config/dsr_features.ini z:/test/efm/scripts/dsr_features.ini ../tef/tef_feature_generator/config/plugin_features.ini z:/test/efm/scripts/plugin_features.ini ../tef/tef_feature_generator/config/unit_features.ini z:/test/efm/scripts/unit_features.ini @@ -72,24 +72,25 @@ ../tef/tef_feature_generator/config/corruptdat.ini z:/test/efm/scripts/corruptdat.ini // TestExecute additional files (urel & udeb) -../tef/tef_efm_bursuite/scripts/tef_efm_bursuite.ini z:/test/efm/scripts/tef_efm_bursuite.ini +../tef/tef_efm_bursuite/scripts/tef_efm_bursuite.ini z:/test/efm/scripts/tef_efm_bursuite.ini // 1200 feature data file for characterisation testing. -../tef/tef_efm_configured/data/fs_1200.dat z:/test/efm/scripts/fs_1200.dat +../tef/tef_efm_configured/data/fs_1200.dat z:/test/efm/scripts/fs_1200.dat //corrupt features file -../tef/tef_efm_configured/data/noheader.dat z:/test/efm/scripts/noheader.dat -../tef/tef_efm_configured/data/partial.dat z:/test/efm/scripts/partial.dat +../tef/tef_efm_configured/data/noheader.dat z:/test/efm/scripts/noheader.dat +../tef/tef_efm_configured/data/partial.dat z:/test/efm/scripts/partial.dat //iby files for the test components -featmgr_textshell_test.iby /epoc32/rom/include/featmgr_textshell_test.iby -featmgr_techview_test.iby /epoc32/rom/include/featmgr_techview_test.iby - -../tef/tef_efm_configured/group/efm_configured_testserver.iby /epoc32/rom/include/efm_configured_testserver.iby -../tef/tef_efm_normal/group/efm_normal_testserver.iby /epoc32/rom/include/efm_normal_testserver.iby -../tef/tef_efm_unit/group/efm_unit_testserver.iby /epoc32/rom/include/efm_unit_testserver.iby +featmgr_techview_test.iby /epoc32/rom/include/featmgr_techview_test.iby +featmgr_textshell_test.iby /epoc32/rom/include/featmgr_textshell_test.iby +../tef/tef_efm_configured/group/efm_configured_testserver.iby /epoc32/rom/include/efm_configured_testserver.iby +../tef/tef_efm_normal/group/efm_normal_testserver.iby /epoc32/rom/include/efm_normal_testserver.iby +../tef/tef_efm_unit/group/efm_unit_testserver.iby /epoc32/rom/include/efm_unit_testserver.iby ../tef/tef_feature_generator/group/tef_feature_generator.iby /epoc32/rom/include/tef_feature_generator.iby -../tef/tef_efm_bursuite/group/tef_efm_bursuite.iby /epoc32/rom/include/tef_efm_bursuite.iby +../tef/tef_efm_bursuite/group/tef_efm_bursuite.iby /epoc32/rom/include/tef_efm_bursuite.iby //iby file for manual patchable data test -patch_featmgr_timeout_constant.iby /epoc32/rom/include/patch_featmgr_timeout_constant.iby +patch_featmgr_timeout_constant.iby /epoc32/rom/include/patch_featmgr_timeout_constant.iby + + diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/rtest/group/t_fmgroom.mmp --- a/featuremgmt/featuremgr/test/rtest/group/t_fmgroom.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/rtest/group/t_fmgroom.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2010 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" @@ -13,7 +13,6 @@ // Description: // - TARGET t_fmgroom.exe TARGETTYPE exe @@ -28,7 +27,7 @@ LIBRARY euser.lib LIBRARY efsrv.lib -LIBRARY bafl.lib +LIBRARY bafl.lib LIBRARY featmgr.lib LIBRARY featdiscovery.lib diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/rtest/group/t_fmgrstartup.mmp --- a/featuremgmt/featuremgr/test/rtest/group/t_fmgrstartup.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/rtest/group/t_fmgrstartup.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -17,9 +17,13 @@ TARGETTYPE exe MACRO EXTENDED_FEATURE_MANAGER_TEST +MACRO FEATURE_MANAGER_STARTUP_TEST CAPABILITY ProtServ ReadDeviceData AllFiles +//CodeWarrior compilation options - disable the "illegal pragma" warning +OPTION CW -w noillpragmas + USERINCLUDE . USERINCLUDE ../../../inc USERINCLUDE ../../../src/inc diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/rtest/src/t_fmgrapi.cpp --- a/featuremgmt/featuremgr/test/rtest/src/t_fmgrapi.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgrapi.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -307,7 +307,7 @@ CleanupStack::PopAndDestroy(fdiscovery); } -void DoFeatureDiscoveryTest2(TBool aStaticMethodsUsed) +void DoFeatureDiscoveryTest2L(TBool aStaticMethodsUsed) { CFeatureDiscovery* fdiscovery = NULL; if(!aStaticMethodsUsed) @@ -398,8 +398,8 @@ */ void FeatureDiscoveryTest2L() { - DoFeatureDiscoveryTest2(ETrue); - DoFeatureDiscoveryTest2(EFalse); + DoFeatureDiscoveryTest2L(ETrue); + DoFeatureDiscoveryTest2L(EFalse); } void DoTestsL() diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/rtest/src/t_fmgrbadclient.cpp --- a/featuremgmt/featuremgr/test/rtest/src/t_fmgrbadclient.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgrbadclient.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -85,7 +85,7 @@ } else { - RDebug::Print(_L("*** Expression evaluated to false. Line %d\r\n"), aLine); + TheTest.Printf(_L("*** Expression evaluated to false. Line %d\r\n"), aLine); } TheTest(EFalse, aLine); } @@ -168,6 +168,7 @@ void Close(); TInt SendReceive(TInt aFunction); TInt SendReceive(TInt aFunction, const TIpcArgs& aArgs); + void SendReceive(TInt aFunction, const TIpcArgs& aArgs, TRequestStatus& aStatus); private: TInt DoCreateSession(); @@ -198,6 +199,11 @@ return RSessionBase::SendReceive(aFunction, aArgs); } +void RTestFeatMgrSession::SendReceive(TInt aFunction, const TIpcArgs& aArgs, TRequestStatus& aStatus) + { + RSessionBase::SendReceive(aFunction, aArgs, aStatus); + } + TInt RTestFeatMgrSession::DoCreateSession() { const TInt KRetry( 2 ); @@ -236,7 +242,7 @@ return err; } -void PrintIterationCount(TInt aIteration) +void PrintIterationCount(TInt aIteration, TBool aFromThread = EFalse) { if((aIteration % 100) == 0) { @@ -245,7 +251,14 @@ TDateTime dt = time.DateTime(); TBuf<16> tbuf; tbuf.Format(_L("%02d:%02d:%02d.%06d"), dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond()); - RDebug::Print(_L("-----[%S] Test iterations: %d\r\n"), &tbuf, aIteration); + if(aFromThread) + { + RDebug::Print(_L("-----[%S] Test iterations: %d\r\n"), &tbuf, aIteration); + } + else + { + TheTest.Printf(_L("-----[%S] Test iterations: %d\r\n"), &tbuf, aIteration); + } } } @@ -272,9 +285,7 @@ while(++data.iIteration <= KTestIterCount) { - RDebug::Print(_L("++++ %d\r\n"), data.iIteration); - - PrintIterationCount(data.iIteration); + PrintIterationCount(data.iIteration, ETrue); TIpcArgs args; data.iFunction = Math::Rand(data.iSeed) % (EFeatMgrSWIEnd + 1);//EFeatMgrSWIEnd - the last server message number (without resource checking IPCs)) for(TInt i=0;i), valid feature, server side OOM test")); NotifierNotifyRequestsOomTest(EFeatMgrOomServerTestMode); - - PostTest(); } TInt E32Main() @@ -653,7 +597,6 @@ __UHEAP_MARK; TRAPD(err, DoTestsL()); - DestroyTestEnv(); TEST2(err, KErrNone); __UHEAP_MARKEND; diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/rtest/src/t_fmgrperformance.cpp --- a/featuremgmt/featuremgr/test/rtest/src/t_fmgrperformance.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgrperformance.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -246,7 +246,7 @@ @SYMTestExpectedResults Test must not fail @SYMDEF DEF144262 */ -void FeatureManagerTest() +void FeatureManagerTestL() { TUint32 start = User::FastCounter(); FeatureManager::InitializeLibL(); @@ -271,7 +271,7 @@ FeatureControlTest(); TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4107 FeatureManager performance test")); - FeatureManagerTest(); + FeatureManagerTestL(); } TInt E32Main() diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/rtest/src/t_fmgrstartup.cpp --- a/featuremgmt/featuremgr/test/rtest/src/t_fmgrstartup.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgrstartup.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -22,29 +22,35 @@ static TInt TheThreadHandleCount = 0; static TInt TheAllocatedCellsCount = 0; -#ifdef EXTENDED_FEATURE_MANAGER_TEST #ifdef _DEBUG static const TInt KBurstRate = 20; #endif -#endif /////////////////////////////////////////////////////////////////////////////////////// static RTest TheTest(_L("t_fmgrstartup")); -_LIT( KZOrgFeaturesFile, "Z:\\Private\\10205054\\features.dat" ); + #ifdef EXTENDED_FEATURE_MANAGER_TEST -_LIT( KZFeaturesFile, "C:\\Private\\102836E5\\features.dat" ); -_LIT( KZFeaturesDir, "C:\\Private\\102836E5\\" ); -#else -_LIT( KZFeaturesFile, "Z:\\Private\\10205054\\features.dat" ); -_LIT( KZFeaturesDir, "Z:\\Private\\10205054\\" ); -#endif // EXTENDED_FEATURE_MANAGER_TEST +_LIT( KZOrgFeaturesFile, "Z:\\Private\\10205054\\features.dat" ); +_LIT( KFeaturesFile, "C:\\Private\\102836E5\\features.dat" ); +_LIT( KFeaturesDir, "C:\\Private\\102836E5\\" ); +#endif /////////////////////////////////////////////////////////////////////////////////////// //Deletes all created test files. void DestroyTestEnv() { + //KFeaturesDir is defined only if EXTENDED_FEATURE_MANAGER_TEST is defined +#ifdef EXTENDED_FEATURE_MANAGER_TEST + RFs fs; + TInt err = fs.Connect(); + if(err == KErrNone) + { + (void)fs.Delete(KFeaturesFile); + } + fs.Close(); +#endif } /////////////////////////////////////////////////////////////////////////////////////// @@ -134,7 +140,6 @@ @SYMDEF DEF144262 */ void FeatMgrServerStartupOomTest() -//TODO - panics in CFeatMgrServer::LoadPluginsL() because the error is KErrNoMemory { TInt err = KErrNoMemory; TInt failingAllocationNo = 0; @@ -173,10 +178,10 @@ TheTest.Printf(_L("===Iteration %d. Simulated error:\r\n"), cnt); for (TInt fsError=KErrNotFound;fsError>=KErrBadName;--fsError) { - if(fsError == KErrNotFound || fsError == KErrCorrupt || fsError == KErrPathNotFound || fsError == KErrEof) - { - continue;//TODO: the server code panics - } +// if(fsError == KErrNotFound || fsError == KErrCorrupt || fsError == KErrPathNotFound || fsError == KErrEof) +// { +// continue;//The server code panics +// } TheTest.Printf(_L("%d "), fsError); (void)fs.SetErrorCondition(fsError, cnt); TRAP(err, CreateAndDestroyFeatMgrServerL()); @@ -188,45 +193,23 @@ TheTest.Printf(_L("\r\n===File I/O error simulation test succeeded on iteration %d===\r\n"), cnt); } -void PreTest() +void CreateTestEnv() { - // Connect session - RFs fsSession; - User::LeaveIfError(fsSession.Connect()); + //KFeaturesDir is defined only if EXTENDED_FEATURE_MANAGER_TEST is defined +#ifdef EXTENDED_FEATURE_MANAGER_TEST + RFs fs; + TInt err = fs.Connect(); + TEST2(err, KErrNone); - TEntry entry; - TInt err = fsSession.Entry(KZFeaturesDir, entry); - if (err == KErrNotFound) - { - err = fsSession.MkDir(KZFeaturesDir); - } - TEST2 (err, KErrNone); - err = BaflUtils::CopyFile(fsSession, KZOrgFeaturesFile, KZFeaturesDir); + err = fs.MkDir(KFeaturesDir); + TEST (err == KErrNone || err == KErrAlreadyExists); + + (void)fs.Delete(KFeaturesFile); + err = BaflUtils::CopyFile(fs, KZOrgFeaturesFile, KFeaturesDir); TEST2 (err, KErrNone); - // close file server session - fsSession.Close(); - - } - -void PostTest() - { - // Connect session - RFs fsSession; - User::LeaveIfError(fsSession.Connect()); - - TEntry entry; - TInt err = fsSession.Entry(KZFeaturesDir, entry); - if (err == KErrNone) - { - err = BaflUtils::DeleteFile(fsSession,KZFeaturesFile); - TEST2 (err, KErrNone); - - } - TEST2 (err, KErrNone); - - // close file server session - fsSession.Close(); + fs.Close(); +#endif } void DoTestsL() @@ -236,12 +219,10 @@ CActiveScheduler::Install(scheduler); TheTest.Start(_L("@SYMTestCaseID:PDS-EFM-CT-4109 CFeatMgrServer::NewLC() OOM test")); - PreTest(); FeatMgrServerStartupOomTest(); TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4110 CFeatMgrServer::NewLC() file I/O error simulation test")); FeatMgrServerStartupFileIoTest(); - PostTest(); delete scheduler; } @@ -255,6 +236,7 @@ __UHEAP_MARK; + CreateTestEnv(); TRAPD(err, DoTestsL()); DestroyTestEnv(); TEST2(err, KErrNone); diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/rtest/src/t_fmgrswi.cpp --- a/featuremgmt/featuremgr/test/rtest/src/t_fmgrswi.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgrswi.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -99,9 +99,25 @@ /** @SYMTestCaseID PDS-EFM-CT-4111 -@SYMTestCaseDesc +@SYMTestCaseDesc The test demonstrates that there is a problem in the FeatMgr code that processes SWI events. + Test steps: + 1) The test sets KSAUidSoftwareInstallKeyValue property in order to simulate that SWI has started. + 2) The test calls RFeatureControl::SWIStart() to notify the server that SWI started. + 3) The test adds a new feature. Since this happens during the SWI process the new feature + will be cached by the FeatMgr server. + 4) The test simulates a file I/O error to happen on iteration #4. The failure should occur + at the moment when the server tries to persist the new feature that is in the cache. + 5) The test notifies the server that SWI has completed: KSAUidSoftwareInstallKeyValue value set + and RFeatureControl::SWIEnd() called. + When the server receives the "end of SWI" notification, the server will try to persist + the cached new feature. But because of the simulated file I/O error the server will fail + to store the new feature to the features.dat file. But in accordance with the current + design of the server, no error will be reported back to the client. + 6) The test kills the FeatMgr server. The server cache is gone. + 7) The test restarts the server and attempts to request the new feature. The new feature + is missing. @SYMTestPriority High -@SYMTestActions +@SYMTestActions FeatMgr SWI test with simulated file I/O error during SWI. @SYMTestExpectedResults Test must not fail @SYMDEF DEF144262 */ diff -r 3eacc0623088 -r 55f2396f6d25 featuremgmt/featuremgr/test/tef/tef_efm_configured/src/plugin_test_steps.cpp --- a/featuremgmt/featuremgr/test/tef/tef_efm_configured/src/plugin_test_steps.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/featuremgmt/featuremgr/test/tef/tef_efm_configured/src/plugin_test_steps.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -51,7 +51,7 @@ CRefPluginsTest::CRefPluginsTest() { - SetTestStepName( KPluginCapabilitiesTest ); + SetTestStepName( KRefPluginsTest ); } TVerdict CRefPluginsTest::doTestStepL() diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/LogCli/src/LogCliServerShared.cpp --- a/loggingservices/eventlogger/LogCli/src/LogCliServerShared.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/LogCli/src/LogCliServerShared.cpp Mon May 03 14:09:14 2010 +0300 @@ -250,8 +250,8 @@ @return Format string for this locale. */ EXPORT_C const TDesC& LogUtils::DateFormatForLocale() { - _LIT(KSQLDateFormatColon,"%D%*M%Y%1 %2 %3 %H:%T:%S"); - _LIT(KSQLDateFormatDot,"%D%*M%Y%1 %2 %3 %H.%T.%S"); + _LIT(KSQLDateFormatColon,"%D%*M%Y%1 %2 %3 %H:%T:%S%.%C"); + _LIT(KSQLDateFormatDot,"%D%*M%Y%1 %2 %3 %H.%T.%S%.%C"); TLocale current; TBool dateSeparatorIsColon=EFalse; diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/LogServ/inc/LogServSqlStrings.h --- a/loggingservices/eventlogger/LogServ/inc/LogServSqlStrings.h Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/LogServ/inc/LogServSqlStrings.h Mon May 03 14:09:14 2010 +0300 @@ -52,8 +52,8 @@ CONST_LIT(KLogSqlUpdateTypeString, "UPDATE Type SET Description = '%S', Enabled = %d WHERE UId = %d") ; CONST_LIT(KLogSqlDeleteTypeString, "DELETE FROM Type WHERE UId = %d") ; // -CONST_LIT(KLogSqlSelectOldestString, "SELECT Id FROM Event WHERE ETime <= #%S#") ; -CONST_LIT(KLogSqlDeleteOldestString, "DELETE FROM Event WHERE ETime <= #%S#") ; +CONST_LIT(KLogSqlSelectOldestString, "SELECT Id FROM Event WHERE ETime < #%S#") ; +CONST_LIT(KLogSqlDeleteOldestString, "DELETE FROM Event WHERE ETime < #%S#") ; CONST_LIT(KLogSqlSelectAllRecent, "SELECT Id, Recent, Duplicate FROM Event") ; CONST_LIT(KLogSqlSelectDuplicateString, "SELECT Id, Duplicate FROM EVENT WHERE Recent = %d %S AND NOT Id = %d ORDER BY Id DESC") ; CONST_LIT(KLogSqlGetRecent, "SELECT Id FROM Event WHERE Recent = %d AND Duplicate IS NULL ORDER BY Id DESC") ; diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/Rom/logengtest.iby --- a/loggingservices/eventlogger/Rom/logengtest.iby Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/Rom/logengtest.iby Mon May 03 14:09:14 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 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" @@ -50,8 +50,8 @@ file=ABI_DIR\BUILD_DIR\t_logwrap.exe Test\t_logwrap.exe file=ABI_DIR\BUILD_DIR\t_logcontact.exe Test\t_logcontact.exe file=ABI_DIR\BUILD_DIR\t_logcntmatch.exe Test\t_logcntmatch.exe -file=ABI_DIR\BUILD_DIR\t_maxnumberlength.exe Test\t_maxnumberlength.exe -file=ABI_DIR\BUILD_DIR\t_OrderById.exe Test\t_OrderById.exe +file=ABI_DIR\BUILD_DIR\t_logmaxnumlen.exe Test\t_logmaxnumlen.exe +file=ABI_DIR\BUILD_DIR\t_logorderbyid.exe Test\t_logorderbyid.exe file=ABI_DIR\BUILD_DIR\t_logservercrash.exe Test\t_logservercrash.exe file=ABI_DIR\BUILD_DIR\t_loghicaphelper.exe Test\t_loghicaphelper.exe file=ABI_DIR\BUILD_DIR\t_loghicapability.exe Test\t_loghicapability.exe diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/group/BLD.INF --- a/loggingservices/eventlogger/group/BLD.INF Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/group/BLD.INF Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1999-2010 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" @@ -87,8 +87,8 @@ ../test/t_logwrap.mmp ../test/t_logcontact.mmp ../test/t_logcntmatch.mmp -../test/t_maxnumberlength.MMP -../test/t_OrderById.MMP +../test/t_logmaxnumlen.mmp +../test/t_logorderbyid.mmp ../test/t_logservercrash.mmp ../test/t_loghicaphelper.mmp support ../test/t_loglowcapability.mmp diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/group/logengtests.bat --- a/loggingservices/eventlogger/group/logengtests.bat Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/group/logengtests.bat Mon May 03 14:09:14 2010 +0300 @@ -1,5 +1,5 @@ @rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). @rem All rights reserved. @rem This component and the accompanying materials are made available @rem under the terms of "Eclipse Public License v1.0" @@ -35,8 +35,8 @@ t_logwrap.exe t_logcontact.exe t_logcntmatch.exe -t_maxnumberlength.exe -t_OrderById.exe +t_logmaxnumlen.exe +t_logorderbyid.exe t_logservercrash.exe t_loglowcapability.exe t_loghicapability.exe diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/T_LogSecurity.mmp --- a/loggingservices/eventlogger/test/T_LogSecurity.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/T_LogSecurity.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -15,6 +15,7 @@ TARGET t_logsecurity.exe TARGETTYPE exe + CAPABILITY All -TCB MACRO LOGSERV_CAPABILITY_TEST @@ -30,6 +31,7 @@ SOURCEPATH ../test/src SOURCE T_LogSecurity.cpp +SOURCE t_logutil.cpp SOURCEPATH ../LogServ/src SOURCE logservsecurity.cpp @@ -37,7 +39,12 @@ SOURCE LogServPanic.cpp SOURCE LogServSqlStrings.cpp -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib edbms.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib +LIBRARY edbms.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/inc/SecurityPolicy.h --- a/loggingservices/eventlogger/test/inc/SecurityPolicy.h Fri Apr 16 16:49:27 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -// Copyright (c) 2005-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: -// - -#ifndef __SECURITYPOLICY_H__ -#define __SECURITYPOLICY_H__ - -#include - -/** -TCompiledSecurityPolicy is a test class used for accessing private data members -of TSecurityPolicy class. It uses the fact that TSecurityPolicy class has a friend class, -which name is TCompiledSecurityPolicy. -@internalComponent -*/ -class TCompiledSecurityPolicy - { -public: - TCompiledSecurityPolicy(const TSecurityPolicy& aSecurityPolicy) : - iSecurityPolicy(aSecurityPolicy) - { - } - TSecurityPolicy::TType Type() const - { - return static_cast (iSecurityPolicy.iType); - } - TUint32 SecureId() const - { - return iSecurityPolicy.iSecureId; - } - TUint32 VendorId() const - { - return iSecurityPolicy.iVendorId; - } - TCapability Capability(TInt aIndex) const - { - if(aIndex < 3) - { - return static_cast (iSecurityPolicy.iCaps[aIndex]); - } - else if(aIndex < 7) - { - return static_cast (iSecurityPolicy.iExtraCaps[aIndex - 3]); - } - User::Invariant(); - return ECapability_None; - } - -private: - const TSecurityPolicy& iSecurityPolicy; - - }; - -inline TBool operator==(const TCompiledSecurityPolicy& aLeft, const TCompiledSecurityPolicy& aRight) - { - return aLeft.Type() == aRight.Type() && - aLeft.SecureId() == aRight.SecureId() && - aLeft.VendorId() == aRight.VendorId() && - aLeft.Capability(0) == aRight.Capability(0) && - aLeft.Capability(1) == aRight.Capability(1) && - aLeft.Capability(2) == aRight.Capability(2) && - aLeft.Capability(3) == aRight.Capability(3) && - aLeft.Capability(4) == aRight.Capability(4) && - aLeft.Capability(5) == aRight.Capability(5) && - aLeft.Capability(6) == aRight.Capability(6); - } - -#endif//__SECURITYPOLICY_H__ diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/inc/TEST.H --- a/loggingservices/eventlogger/test/inc/TEST.H Fri Apr 16 16:49:27 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,347 +0,0 @@ -// Copyright (c) 2002-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: -// - -#ifndef __TEST_H__ -#define __TEST_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "LogChangeDefinition.h" -#include "LogServShared.h" -#include "LogCliServShared.h" -#include -#include "t_logservsession.h" -#include "logcntdef.h" - -#ifdef LOGGING_ENABLED - -#include -#include - - - -_LIT(KLogFileName, "LogEng.txt"); -_LIT(KLogFolder, "LogEng"); -_LIT(KTimeFormat, "%02d.%02d:%02d:%06d "); -_LIT(KTextFormat, "%S"); -const TInt KLogEngLogBufferSize = 256; - -class Log : public RFileLogger - { -public: - static void New(); - static void Write(const TDesC& aText); - static void WriteFormat(TRefByValue aFmt, ...); -private: - static void PruneLogFile(); - }; - -#define LOGNEW Log::New() -#define LOGTEXT(AAA) { _LIT(KString, AAA); Log::Write(KString); } -#define LOGTEXT2(AAA, BBB) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB); } -#define LOGTEXT3(AAA, BBB, CCC) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB, CCC); } -#define LOGTEXT4(AAA, BBB, CCC, DDD) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB, CCC, DDD); } - -#else//LOGGING_ENABLED - -#define LOGNEW -#define LOGTEXT(AAA) -#define LOGTEXT2(AAA, BBB) -#define LOGTEXT3(AAA, BBB, CCC) -#define LOGTEXT4(AAA, BBB, CCC, DDD) - -#endif//LOGGING_ENABLED - -//====================================================================================================== - -#define TEST_STRING(s) _S(s) - -//====================================================================================================== - -//TheTest object must be defined in the main test cpp file. -GLREF_D RTest test; - -void LogTestBoolExpr(TBool aRes, const TText* aFile, TInt aLine); -void LogCheck(TInt aValue, TInt aExpected, const TText* aFile, TInt aLine); -void LogCheckU(TUint aValue, TUint aExpected, const TText* aFile, TInt aLine); - -#define TEST(arg) LogTestBoolExpr(arg, TEST_STRING(__FILE__), __LINE__) -#define TEST2(aValue, aExpected) LogCheck(aValue, aExpected, TEST_STRING(__FILE__), __LINE__) -#define TEST2U(aValue, aExpected) LogCheckU(aValue, aExpected, TEST_STRING(__FILE__), __LINE__) - -//====================================================================================================== - -void LogLeave(TInt aErr, const TText* aFile, TInt aLine); - -#define LEAVE(err) LogLeave(err, TEST_STRING(__FILE__), __LINE__) -#define LEAVE_IF_ERROR(err) do {if(err < KErrNone) LogLeave(err, TEST_STRING(__FILE__), __LINE__);} while(0) - -//====================================================================================================== - -void LogPanic(const TDesC& aCategory, TInt aErr, const TText* aFile, TInt aLine); - -#define PANIC(cat, err) LogPanic(cat, err, TEST_STRING(__FILE__), __LINE__) - -//====================================================================================================== - -// Globals -GLREF_D CTrapCleanup* theCleanup; -GLREF_D CActiveScheduler *testScheduler; -GLREF_D RFs theFs; -GLREF_D TFileName theLogName; -GLREF_D RFile theLog; -GLREF_D RLogTestSession theLogServ; - -#define __FILE_FAILNEXT(X) theFs.SetErrorCondition(KErrGeneral, X) -#define __FILE_RESET theFs.SetErrorCondition(KErrNone, 0) - -#if defined(_UNICODE) - _LIT(KLogDatabaseName,"c:\\private\\101f401d\\Logdbu.dat"); -#else - _LIT(KLogDatabaseName,"c:\\private\\101f401d\\Logdb.dat"); -#endif - - -//********************************** -// CTestActive -//********************************** - -class CTestActive : public CActive - { -public: - CTestActive(TInt aPriority = EPriorityIdle-100); - ~CTestActive(); - void StartL(); - void StartL(TInt); -protected: - void DoCancel(); - void RunL(); -private: - TBool iDelayCompletion; - TRequestStatus iStoredStatus; - TInt iDelayTime; - }; - -void doTestsL(); - - -//********************************** -// CTestTimer -//********************************** - -class CTestTimer : public CTimer - { -public: - static CTestTimer* NewL(); -private: - CTestTimer(); - void RunL(); - }; - -//********************************** -// TestUtils -//********************************** - -class TestUtils - { -public: - static void Initialize(const TDesC& aName); - static void DeleteDatabaseL(TBool aCloseBeforeDelete = ETrue); - static HBufC* CreateBufLC(TInt aLength); - static HBufC8* CreateBuf8LC(TInt aLength); - static TBool FiltersEqual(const CLogFilter& aFilter1, const CLogFilter& aFilter2); - static TBool EventsEqual(const CLogEvent& aEvent1, const CLogEvent& aEvent2); - static TBool TypesEqual(const CLogEventType& aType1, const CLogEventType& aType2); - static TBool WaitForKeyL(TTimeIntervalMicroSeconds32 aDelay, TKeyCode& aKeyCode); - static TBool FileExists(const TDesC& aFile); - static void SetLogServHeapFailureL(RHeap::TAllocFail aType, TInt aRate); - static TBool IsDatabaseOpenL(); - static TInt DatabaseSizeL(); - static TInt AddEventL(); - static void AddViewTestEventsL(); - static void AddEventTypeL(); - static void CopyCorruptDbL(); - static void CopyCorruptDamagedDbL(); - static void CopyOldDbL(); - static void TestInvalidSchemaL(); - static TBool MatchingEnabledL(); - -private: - // starts t_HiCapHelper.exe which has sufficient capability - static TInt ExecuteRemoteL(const TDesC& aCommandLineArg); - }; - -#define __LOGSERV_UHEAP_FAILNEXT(X) TestUtils::SetLogServHeapFailureL(RHeap::EFailNext, X) -#define __LOGSERV_UHEAP_RESET TestUtils::SetLogServHeapFailureL(RHeap::ENone, 0) - -//********************************** -// CLogViewChangeObserver -//********************************** - -class CLogViewChangeObserver : public CActive, public MLogViewChangeObserver - { -public: - enum TStopType - { - EStopOnChanges = 0, - EStopOnRunL, - EStopOnBoth, - EStopOnCount, - EDontStopScheduler - }; -public: - static CLogViewChangeObserver* NewLC(); - ~CLogViewChangeObserver(); - -protected: - CLogViewChangeObserver(); - -public: - inline void StartCollectingChanges() - { - Reset(); - iType = EDontStopScheduler; - } - CLogChangeDefinition* WaitForChangesLC(TStopType aType = EStopOnChanges, TInt aCount = 0); - CLogChangeDefinition* WaitForChangesLC(TCallBack aCallBack, TStopType aType, TInt aCount = 0); - inline TBool HaveChanges() const - { - return iChanges != NULL; - } - inline const CLogChangeDefinition& Changes() const - { - __ASSERT_ALWAYS(iChanges, User::Invariant()); - return *iChanges; - } - inline void SetActive() - { - CActive::SetActive(); - iStatus = KRequestPending; - } - inline void ResetChanges() - { - __ASSERT_ALWAYS(iChanges, User::Invariant()); - iChanges->Reset(); - } - -public: - void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); - void HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); - void HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); - -private: - void RunL(); - void DoCancel(); - -private: - void Reset(); - -protected: - void CheckForSchedulerStop(); - void AddChangeL(TLogDatabaseChangeType aType, TLogId aId, TInt aViewIndex); - -private: - TInt iExpectedChangeCount; - TBool iHaveFinishedOperation; - TBool iHaveObtainedChanges; - TBool iSchedulerStarted; - TStopType iType; - CLogChangeDefinition* iChanges; - TBool iHaveCallBack; - TCallBack iCallBack; - }; - -//********************************** -// CLogViewChangeObserverErrorTest -//********************************** - -class CLogViewChangeObserverErrorTest : public CLogViewChangeObserver - { -public: - static CLogViewChangeObserverErrorTest* NewLC(); - -private: - CLogViewChangeObserverErrorTest(); - -public: - void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); - }; - - -//********************************** -// CLogSchedulerTimer -//********************************** - -class CLogSchedulerTimer : public CTimer - { -public: - static CLogSchedulerTimer* NewLC(); - ~CLogSchedulerTimer(); - -private: - CLogSchedulerTimer(); - void ConstructL(); - -public: - void Wait(TTimeIntervalMicroSeconds32 aTime); - -private: - void RunL(); - }; - -//********************************** -// CLogChangeNotifier -//********************************** - -class CLogChangeNotifier : public CActive - { -public: - static CLogChangeNotifier* NewL(); - ~CLogChangeNotifier(); - // -private: - CLogChangeNotifier(); - void ConstructL(); - // - void RunL(); - void DoCancel(); - // -private: - CLogClient* iClient; - TTime iStart; - }; - -//********************************** -// Global -//********************************** - -void SetupSchedulerL(); -void CloseScheduler(); -void doMainL(); -TInt E32Main(); -void DeleteDataFile(const TDesC& aFullName); -void LogCheck(TInt aValue, TInt aExpected, TInt aLine); -void LogCheckU(TUint aValue, TUint aExpected, TInt aLine); - -#endif//__TEST_H__ diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/inc/t_logsecuritypolicy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/inc/t_logsecuritypolicy.h Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,79 @@ +// Copyright (c) 2005-2010 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: +// + +#ifndef t_logsecuritypolicy_h +#define t_logsecuritypolicy_h + +#include + +/** +TCompiledSecurityPolicy is a test class used for accessing private data members +of TSecurityPolicy class. It uses the fact that TSecurityPolicy class has a friend class, +which name is TCompiledSecurityPolicy. +@internalComponent +*/ +class TCompiledSecurityPolicy + { +public: + TCompiledSecurityPolicy(const TSecurityPolicy& aSecurityPolicy) : + iSecurityPolicy(aSecurityPolicy) + { + } + TSecurityPolicy::TType Type() const + { + return static_cast (iSecurityPolicy.iType); + } + TUint32 SecureId() const + { + return iSecurityPolicy.iSecureId; + } + TUint32 VendorId() const + { + return iSecurityPolicy.iVendorId; + } + TCapability Capability(TInt aIndex) const + { + if(aIndex < 3) + { + return static_cast (iSecurityPolicy.iCaps[aIndex]); + } + else if(aIndex < 7) + { + return static_cast (iSecurityPolicy.iExtraCaps[aIndex - 3]); + } + User::Invariant(); + return ECapability_None; + } + +private: + const TSecurityPolicy& iSecurityPolicy; + + }; + +inline TBool operator==(const TCompiledSecurityPolicy& aLeft, const TCompiledSecurityPolicy& aRight) + { + return aLeft.Type() == aRight.Type() && + aLeft.SecureId() == aRight.SecureId() && + aLeft.VendorId() == aRight.VendorId() && + aLeft.Capability(0) == aRight.Capability(0) && + aLeft.Capability(1) == aRight.Capability(1) && + aLeft.Capability(2) == aRight.Capability(2) && + aLeft.Capability(3) == aRight.Capability(3) && + aLeft.Capability(4) == aRight.Capability(4) && + aLeft.Capability(5) == aRight.Capability(5) && + aLeft.Capability(6) == aRight.Capability(6); + } + +#endif//t_logsecuritypolicy_h diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/inc/t_logutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/inc/t_logutil.h Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,47 @@ +// Copyright (c) 2010 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: +// +#ifndef t_logutil_h +#define t_logutil_h + +#include + +void LogTestBoolExpr(TBool aRes, const TText* aFile, TInt aLine, TBool aPrintThreadName = EFalse); +void LogCheck(TInt aValue, TInt aExpected, const TText* aFile, TInt aLine, TBool aPrintThreadName = EFalse); +void LogCheckU(TUint aValue, TUint aExpected, const TText* aFile, TInt aLine, TBool aPrintThreadName = EFalse); + +#define TEST_STRING(s) _S(s) + +#define TEST(arg) LogTestBoolExpr((arg), TEST_STRING(__FILE__), __LINE__) +#define TEST2(aValue, aExpected) LogCheck((aValue), (aExpected), TEST_STRING(__FILE__), __LINE__) +#define TEST2U(aValue, aExpected) LogCheckU((aValue), (aExpected), TEST_STRING(__FILE__), __LINE__) + +#define TTEST(arg) LogTestBoolExpr((arg), TEST_STRING(__FILE__), __LINE__, ETrue) +#define TTEST2(aValue, aExpected) LogCheck((aValue), (aExpected), TEST_STRING(__FILE__), __LINE__, ETrue) +#define TTEST2U(aValue, aExpected) LogCheckU((aValue), (aExpected), TEST_STRING(__FILE__), __LINE__, ETrue) + +void LogLeave(TInt aErr, const TText* aFile, TInt aLine); + +#define LEAVE(err) LogLeave(err, TEST_STRING(__FILE__), __LINE__) +#define LEAVE_IF_ERROR(err) do {if(err < KErrNone) LogLeave(err, TEST_STRING(__FILE__), __LINE__);} while(0) + + +void LogPanic(const TDesC& aCategory, TInt aErr, const TText* aFile, TInt aLine); + +#define PANIC(cat, err) LogPanic(cat, err, TEST_STRING(__FILE__), __LINE__) + +TPtrC FileName(const TText* aFile); +TInt KillProcess(const TDesC& aProcessName); + +#endif//t_logutil_h diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/inc/t_logutil2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/inc/t_logutil2.h Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,314 @@ +// Copyright (c) 2002-2010 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: +// + +#ifndef t_logutil2_h +#define t_logutil2_h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "LogChangeDefinition.h" +#include "LogServShared.h" +#include "LogCliServShared.h" +#include +#include "t_logservsession.h" +#include "logcntdef.h" +#include "t_logutil.h" + +#ifdef LOGGING_ENABLED + +#include +#include + + + +_LIT(KLogFileName, "LogEng.txt"); +_LIT(KLogFolder, "LogEng"); +_LIT(KTimeFormat, "%02d.%02d:%02d:%06d "); +_LIT(KTextFormat, "%S"); +const TInt KLogEngLogBufferSize = 256; + +class Log : public RFileLogger + { +public: + static void New(); + static void Write(const TDesC& aText); + static void WriteFormat(TRefByValue aFmt, ...); +private: + static void PruneLogFile(); + }; + +#define LOGNEW Log::New() +#define LOGTEXT(AAA) { _LIT(KString, AAA); Log::Write(KString); } +#define LOGTEXT2(AAA, BBB) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB); } +#define LOGTEXT3(AAA, BBB, CCC) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB, CCC); } +#define LOGTEXT4(AAA, BBB, CCC, DDD) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB, CCC, DDD); } + +#else//LOGGING_ENABLED + +#define LOGNEW +#define LOGTEXT(AAA) +#define LOGTEXT2(AAA, BBB) +#define LOGTEXT3(AAA, BBB, CCC) +#define LOGTEXT4(AAA, BBB, CCC, DDD) + +#endif//LOGGING_ENABLED + +// Globals +GLREF_D CTrapCleanup* theCleanup; +GLREF_D CActiveScheduler *testScheduler; +GLREF_D RFs theFs; +GLREF_D TFileName theLogName; +GLREF_D RFile theLog; +GLREF_D RLogTestSession theLogServ; + +#define __FILE_FAILNEXT(X) theFs.SetErrorCondition(KErrGeneral, X) +#define __FILE_RESET theFs.SetErrorCondition(KErrNone, 0) + +#if defined(_UNICODE) + _LIT(KLogDatabaseName,"c:\\private\\101f401d\\Logdbu.dat"); +#else + _LIT(KLogDatabaseName,"c:\\private\\101f401d\\Logdb.dat"); +#endif + + +//********************************** +// CTestActive +//********************************** + +class CTestActive : public CActive + { +public: + CTestActive(TInt aPriority = EPriorityIdle-100); + ~CTestActive(); + void StartL(); + void StartL(TInt); +protected: + void DoCancel(); + void RunL(); +private: + TBool iDelayCompletion; + TRequestStatus iStoredStatus; + TInt iDelayTime; + }; + +void doTestsL(); + + +//********************************** +// CTestTimer +//********************************** + +class CTestTimer : public CTimer + { +public: + static CTestTimer* NewL(); +private: + CTestTimer(); + void RunL(); + }; + +//********************************** +// TestUtils +//********************************** + +class TestUtils + { +public: + static void Initialize(const TDesC& aName); + static void DeleteDatabaseL(TBool aCloseBeforeDelete = ETrue); + static HBufC* CreateBufLC(TInt aLength); + static HBufC8* CreateBuf8LC(TInt aLength); + static TBool FiltersEqual(const CLogFilter& aFilter1, const CLogFilter& aFilter2); + static TBool EventsEqual(const CLogEvent& aEvent1, const CLogEvent& aEvent2); + static TBool TypesEqual(const CLogEventType& aType1, const CLogEventType& aType2); + static TBool WaitForKeyL(TTimeIntervalMicroSeconds32 aDelay, TKeyCode& aKeyCode); + static TBool FileExists(const TDesC& aFile); + static void SetLogServHeapFailureL(RHeap::TAllocFail aType, TInt aRate); + static TBool IsDatabaseOpenL(); + static TInt DatabaseSizeL(); + static TInt AddEventL(); + static void AddViewTestEventsL(); + static void AddEventTypeL(); + static void CopyCorruptDbL(); + static void CopyCorruptDamagedDbL(); + static void CopyOldDbL(); + static void TestInvalidSchemaL(); + static TBool MatchingEnabledL(); + +private: + // starts t_HiCapHelper.exe which has sufficient capability + static TInt ExecuteRemoteL(const TDesC& aCommandLineArg); + }; + +#define __LOGSERV_UHEAP_FAILNEXT(X) TestUtils::SetLogServHeapFailureL(RHeap::EFailNext, X) +#define __LOGSERV_UHEAP_RESET TestUtils::SetLogServHeapFailureL(RHeap::ENone, 0) + +//********************************** +// CLogViewChangeObserver +//********************************** + +class CLogViewChangeObserver : public CActive, public MLogViewChangeObserver + { +public: + enum TStopType + { + EStopOnChanges = 0, + EStopOnRunL, + EStopOnBoth, + EStopOnCount, + EDontStopScheduler + }; +public: + static CLogViewChangeObserver* NewLC(); + ~CLogViewChangeObserver(); + +protected: + CLogViewChangeObserver(); + +public: + inline void StartCollectingChanges() + { + Reset(); + iType = EDontStopScheduler; + } + CLogChangeDefinition* WaitForChangesLC(TStopType aType = EStopOnChanges, TInt aCount = 0); + CLogChangeDefinition* WaitForChangesLC(TCallBack aCallBack, TStopType aType, TInt aCount = 0); + inline TBool HaveChanges() const + { + return iChanges != NULL; + } + inline const CLogChangeDefinition& Changes() const + { + __ASSERT_ALWAYS(iChanges, User::Invariant()); + return *iChanges; + } + inline void SetActive() + { + CActive::SetActive(); + iStatus = KRequestPending; + } + inline void ResetChanges() + { + __ASSERT_ALWAYS(iChanges, User::Invariant()); + iChanges->Reset(); + } + +public: + void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); + void HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); + void HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); + +private: + void RunL(); + void DoCancel(); + +private: + void Reset(); + +protected: + void CheckForSchedulerStop(); + void AddChangeL(TLogDatabaseChangeType aType, TLogId aId, TInt aViewIndex); + +private: + TInt iExpectedChangeCount; + TBool iHaveFinishedOperation; + TBool iHaveObtainedChanges; + TBool iSchedulerStarted; + TStopType iType; + CLogChangeDefinition* iChanges; + TBool iHaveCallBack; + TCallBack iCallBack; + }; + +//********************************** +// CLogViewChangeObserverErrorTest +//********************************** + +class CLogViewChangeObserverErrorTest : public CLogViewChangeObserver + { +public: + static CLogViewChangeObserverErrorTest* NewLC(); + +private: + CLogViewChangeObserverErrorTest(); + +public: + void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); + }; + + +//********************************** +// CLogSchedulerTimer +//********************************** + +class CLogSchedulerTimer : public CTimer + { +public: + static CLogSchedulerTimer* NewLC(); + ~CLogSchedulerTimer(); + +private: + CLogSchedulerTimer(); + void ConstructL(); + +public: + void Wait(TTimeIntervalMicroSeconds32 aTime); + +private: + void RunL(); + }; + +//********************************** +// CLogChangeNotifier +//********************************** + +class CLogChangeNotifier : public CActive + { +public: + static CLogChangeNotifier* NewL(); + ~CLogChangeNotifier(); + // +private: + CLogChangeNotifier(); + void ConstructL(); + // + void RunL(); + void DoCancel(); + // +private: + CLogClient* iClient; + TTime iStart; + }; + +//********************************** +// Global +//********************************** + +void SetupSchedulerL(); +void CloseScheduler(); +void doMainL(); +TInt E32Main(); +void DeleteDataFile(const TDesC& aFullName); + +#endif//t_logutil2_h diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/T_LogSecurity.cpp --- a/loggingservices/eventlogger/test/src/T_LogSecurity.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/T_LogSecurity.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -19,34 +19,13 @@ #include "LogServResourceInterpreter.h" #include #include -#include "SecurityPolicy.h" +#include "t_logsecuritypolicy.h" +#include "t_logutil.h" -static RTest TheTest(_L("T_LogSecurity")); +RTest TheTest(_L("t_logsecurity")); static RFs TheFileSess; /////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -//Test macross and functions - -static void Check(TInt aValue, TInt aLine) - { - if(!aValue) - { - TheTest(EFalse, aLine); - } - } -static void Check(TInt aValue, TInt aExpected, TInt aLine) - { - if(aValue != aExpected) - { - RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); - TheTest(EFalse, aLine); - } - } -#define TEST(arg) ::Check((arg), __LINE__) -#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) - -/////////////////////////////////////////////////////////////////////////////////////// // //Check if supplied aPolicy parameter has aCapability capability. @@ -190,7 +169,7 @@ else if(err == KErrNone) { __UHEAP_MARKEND; - RDebug::Print(_L("The test succeeded at heap failure rate=%d.\n"), count); + TheTest.Printf(_L("The test succeeded at heap failure rate=%d.\n"), count); break; } else diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_OrderById.CPP --- a/loggingservices/eventlogger/test/src/t_OrderById.CPP Fri Apr 16 16:49:27 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,223 +0,0 @@ -// Copyright (c) 2004-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: -// test code for INC045441 - Log Engine does not return events in sequence order -// -// - -#include -#include -#include -#include "TEST.H" - -RTest test( _L( "Test sequence order of returned events" ) ); - -_LIT( KTestNumber1, "11111" ); -_LIT( KTestNumber2, "22222" ); -_LIT( KTestNumber3, "33333" ); - -#undef test //there is a "test" macro which hides "RTest test" declaration. - -/** -Add an event to the log engine database. -The event ID assigned by logengine is store in gTheId - -@param aClient -@param aNumber The number that the event should contain -@return The index for the event added. - -*/ -LOCAL_C TInt AddEventL( CLogClient& aClient, CLogEvent& aEvent, CTestActive& aActive, TInt aIndex ) - { - TInt returnId = KLogNullId; - - // Reset - TTime now; - now.UniversalTime(); - - aEvent.SetContact( aIndex ); - - // load the event with test values - switch (aIndex) - { - case 1: - aEvent.SetNumber( KTestNumber1 ); - break; - case 2: - aEvent.SetNumber( KTestNumber2 ); - break; - case 3: - aEvent.SetNumber( KTestNumber3 ); - break; - } - - // add the event to the logeng database - aActive.StartL(); - aClient.AddEvent( aEvent, aActive.iStatus ); - CActiveScheduler::Start(); - TEST2(aActive.iStatus.Int(), KErrNone); - - // check that an ID has been assigned - returnId = aEvent.Id(); - TEST( returnId != KLogNullId ); - TEST( aEvent.Time() >= now ); - - // return the event id which has been assigned by the - // log engine - return returnId; - } - - -/** -Get the event from the log engine database. - -@param aClient -@param aTheId Unique id for the event to be fetch -@param aNumber The number that the event should contain -*/ -LOCAL_C void TestGetEventL( CLogClient& aClient, TInt aTheId, TInt aIndex ) - - { - CTestActive* active = new( ELeave )CTestActive(); - CleanupStack::PushL( active ); - - CLogEvent* event = CLogEvent::NewL(); - CleanupStack::PushL( event ); - - event->SetId( aTheId ); - - active->StartL(); - aClient.GetEvent( *event, active->iStatus ); - CActiveScheduler::Start(); - TEST2(active->iStatus.Int(), KErrNone); - - // check we got the right one back - TEST( event->Contact() == aIndex ); - - TPtrC eventNumber = event->Number(); - - TBuf<30> dateString; - _LIT( KDateString5, "%-B%:0%J%:1%T%:2%S%:3%+B" ); - event->Time().FormatL( dateString, KDateString5 ); - TPtrC eventDate = dateString.Ptr(); - test.Printf( _L( "Id:%d No:%S Time:%S \n" ), event->Id(), &eventNumber, &eventDate ); - - CleanupStack::PopAndDestroy( 2 ); // event, active - } - -/** -Test code for INC045441 - Log Engine does not return events in sequence order - -@SYMTestCaseID SYSLIB-LOGENG-CT-1020 -@SYMTestCaseDesc Tests for checking the sequence order on events returned by log engine -@SYMTestPriority High -@SYMTestActions Test for getting the event in order as they were added to the log - Check for memory and no error -@SYMTestExpectedResults Test must not fail -@SYMREQ REQ0000 -*/ -LOCAL_C void TestRecentViewOrderingL( CLogClient& aClient ) -// -// -// - { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1020 ")); - CLogEvent* event = CLogEvent::NewL(); - CleanupStack::PushL(event); - - CTestActive* active = new( ELeave )CTestActive(); - CleanupStack::PushL( active ); - - CLogViewRecent* view = CLogViewRecent::NewL( aClient ); - CleanupStack::PushL( view ); - - TBuf buf; - aClient.GetString(buf, R_LOG_DIR_MISSED); - - event->SetEventType( KLogCallEventTypeUid ); - event->SetDirection( buf ); - - TEST( !view->SetRecentListL( KLogRecentMissedCalls, active->iStatus ) ); - TEST( view->CountL() == 0 ); - - TTime time; - test.Next( _L( "add new event 1" ) ); - TInt eventId1 = AddEventL( aClient, *event, *active, 1 ); - TestGetEventL( aClient, eventId1, 1 ); - - test.Next( _L( "time plus 10 mins - add new event 2" ) ); - time.HomeTime(); - TTimeIntervalMinutes timeTravelForward( 10 ); - time += timeTravelForward; - User::SetHomeTime( time ); - TInt eventId2 = AddEventL( aClient, *event, *active, 2 ); - TestGetEventL( aClient, eventId2, 2 ); - - test.Next( _L( "time minus 5 mins - add new event 3" ) ); - time.HomeTime(); - TTimeIntervalMinutes timeTravelBackward( 5 ); - time -= timeTravelBackward; - User::SetHomeTime( time ); - TInt eventId3 = AddEventL( aClient, *event, *active, 3 ); - TestGetEventL( aClient, eventId3, 3 ); - - TEST( view->CountL() == 3 ); - - active->StartL(); - // Get most recent - TEST( view->FirstL( active->iStatus ) ); - CActiveScheduler::Start(); - TEST2(active->iStatus.Int(), KErrNone); - - TInt id3 = view->Event().Id(); - // Get the one before that - active->StartL(); - TEST( view->NextL( active->iStatus ) ); - CActiveScheduler::Start(); - TEST2(active->iStatus.Int(), KErrNone); - TInt id2 = view->Event().Id(); - - // Get the one before that - active->StartL(); - TEST( view->NextL( active->iStatus ) ); - CActiveScheduler::Start(); - TEST2(active->iStatus.Int(), KErrNone); - TInt id1 = view->Event().Id(); - - TEST( id1 == eventId1 ); - TEST( id2 == eventId2 ); - TEST( id3 == eventId3 ); - - CleanupStack::PopAndDestroy( 3 ); // view, active, event - theLog.Write( _L8( "Test 1.1 OK\n" ) ); - } - - - -void doTestsL() - { - TestUtils::Initialize( _L( "T_OrderById" ) ); - TestUtils::DeleteDatabaseL(); - - CLogClient* client = CLogClient::NewL( theFs ); - CleanupStack::PushL( client ); - - CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); - CleanupStack::PushL( notifier ); - - test.Start( _L( "Recent view sorts by Id not ETime" ) ); - TestRecentViewOrderingL( *client ); - theLog.Write( _L8( "Test 1 OK\n" ) ); - - CleanupStack::PopAndDestroy( 2 ); // notifier, client; - } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logapi.cpp --- a/loggingservices/eventlogger/test/src/t_logapi.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logapi.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -17,16 +17,14 @@ #include #include #include -#include "TEST.H" +#include "t_logutil2.h" #define UNUSED_VAR(a) a = a -#undef test //there is a "test" macro which hides "RTest test" declaration. - const TLogContactItemId KTestContact = 0x1234; const TInt KTestEventNum = 10; -RTest test(_L("Log Client Basic API Test Harness")); +RTest TheTest(_L("t_logapi")); const TUid KTestEventUid = {0x10005393}; _LIT(KTestEventDesc1, "Event Type Description"); @@ -60,31 +58,6 @@ TInt gTheId; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////// Thread panic macros //////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -static void ThrCheck1(TInt aValue, TInt aLine) - { - if(!aValue) - { - RDebug::Print(_L("*** Line %d. Boolean expression evaluated to false!\r\n"), aLine); - User::Panic(_L("ThrChk1"), 1); - } - } - -static void ThrCheck2(TInt aValue, TInt aExpected, TInt aLine) - { - if(aValue != aExpected) - { - RDebug::Print(_L("*** Line %d. Expected error: %d, got: %d\r\n"), aLine, aExpected, aValue); - User::Panic(_L("ThrChk2"), 2); - } - } - -#define TTEST(arg) ThrCheck1((arg), __LINE__) -#define TTEST2(aValue, aExpected) ThrCheck2(aValue, aExpected, __LINE__) - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// class TClientObserverTestReceiver : public MLogClientChangeObserver { @@ -318,7 +291,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0836 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0836 ")); LOGTEXT("TestChangeEventTypeL()"); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -376,7 +349,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0837 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0837 ")); LOGTEXT("TestChangeEventTypeL()"); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -421,7 +394,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1329 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1329 ")); CLogEventType* type = CLogEventType::NewL(); CleanupStack::PushL(type); @@ -491,7 +464,7 @@ */ LOCAL_C void TestClientFailL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0838 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0838 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -529,7 +502,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0839 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0839 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -619,7 +592,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0840 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0840 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -699,7 +672,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0841 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0841 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -746,7 +719,7 @@ //Note: if this test starts failing, then go and check the CentralRepository private data cage //(c:\\private\\10202be9 or z:\\private\\10202be9) if 101f401d.txt file is there. //If it is then delete it and try the test again. - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-UT-4015 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-UT-4015 ")); //Get the contact match count and contact name format.This should be from resource file. TInt16 contactMatchCount; TInt16 contactNameFormat; @@ -862,7 +835,7 @@ User::After(1000); theLog.Write(_L8("Deleting the Log engine database... \n")); TestUtils::DeleteDatabaseL(); - test.Next(_L("Delay of 2 min, the necessary time to central repository to unload its cache... ")); + TheTest.Next(_L("Delay of 2 min, the necessary time to central repository to unload its cache... ")); User::After(125000000); // Delay to time to cenrep to unload its cache. } #endif @@ -881,7 +854,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0842 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0842 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -923,7 +896,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0843 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0843 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -965,7 +938,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0844 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0844 ")); TBuf str; TInt err = aClient.GetString(str, R_LOG_DIR_IN); @@ -1064,11 +1037,11 @@ */ LOCAL_C void TestClearEventLogL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0845 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0845 ")); TTime now; now.UniversalTime(); TDateTime d = now.DateTime(); - RDebug::Print(_L("TimeNow: Y=%d, M=%d, D=%d, H=%d, M=%d, S=%d\n"), d.Year(), d.Month() + 1, d.Day() + 1, d.Hour(), d.Minute(), d.Second()); + TheTest.Printf(_L("TimeNow: Y=%d, M=%d, D=%d, H=%d, M=%d, S=%d\n"), d.Year(), d.Month() + 1, d.Day() + 1, d.Hour(), d.Minute(), d.Second()); TTime date1(now); date1 -= TTimeIntervalDays(1); @@ -1178,7 +1151,7 @@ ////////////////////////////////////////////////////////////////////////////// //Clear all events before (current date - 1 day). //Then cancel the operation. - RDebug::Print(_L("=.= ClearLog 1\n")); + TheTest.Printf(_L("=.= ClearLog 1\n")); active->StartL(); aClient.ClearLog(date1, active->iStatus); aClient.Cancel(); @@ -1188,7 +1161,7 @@ ////////////////////////////////////////////////////////////////////////////// //Clear all events before (current date - 1 day). //event3 and event4 should be removed. - RDebug::Print(_L("=.= ClearLog 2\n")); + TheTest.Printf(_L("=.= ClearLog 2\n")); active->StartL(); aClient.ClearLog(date1, active->iStatus); CActiveScheduler::Start(); @@ -1196,31 +1169,31 @@ ////////////////////////////////////////////////////////////////////////////// //Get event1. It should be there - its time is (current date - 1 day + 10 seconds). - RDebug::Print(_L("=.= GetEvent 1\n")); + TheTest.Printf(_L("=.= GetEvent 1\n")); active->StartL(); aClient.GetEvent(*event1, active->iStatus); CActiveScheduler::Start(); if(active->iStatus != KErrNone) { - RDebug::Print(_L("=1= error code:%d\n"),active->iStatus.Int()); + TheTest.Printf(_L("=1= error code:%d\n"),active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrNone); ////////////////////////////////////////////////////////////////////////////// //Get event2. It should be there - its time is (current date - 1 day + 10 seconds). - RDebug::Print(_L("=.= GetEvent 2\n")); + TheTest.Printf(_L("=.= GetEvent 2\n")); active->StartL(); aClient.GetEvent(*event2, active->iStatus); CActiveScheduler::Start(); if(active->iStatus != KErrNone) { - RDebug::Print(_L("=2= error code:%d\n"),active->iStatus.Int()); + TheTest.Printf(_L("=2= error code:%d\n"),active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrNone); ////////////////////////////////////////////////////////////////////////////// //Get event3. It should not be there - its time is (current date - 2 days). - RDebug::Print(_L("=.= GetEvent 3\n")); + TheTest.Printf(_L("=.= GetEvent 3\n")); active->StartL(); aClient.GetEvent(*event3, active->iStatus); CActiveScheduler::Start(); @@ -1228,7 +1201,7 @@ ////////////////////////////////////////////////////////////////////////////// //Get event4. It should not be there - its time is (current date - 2 days). - RDebug::Print(_L("=.= GetEvent 4\n")); + TheTest.Printf(_L("=.= GetEvent 4\n")); active->StartL(); aClient.GetEvent(*event4, active->iStatus); CActiveScheduler::Start(); @@ -1237,7 +1210,7 @@ ////////////////////////////////////////////////////////////////////////////// //Clear all events happened before (current date). //event1 and event2 should be removed. - RDebug::Print(_L("=#= ClearLog 1\n")); + TheTest.Printf(_L("=#= ClearLog 1\n")); active->StartL(); aClient.ClearLog(now, active->iStatus); CActiveScheduler::Start(); @@ -1245,7 +1218,7 @@ ////////////////////////////////////////////////////////////////////////////// //Get event1. It should not be there - its time is (current date - 1 day + 10 seconds). - RDebug::Print(_L("=#= GetEvent 1\n")); + TheTest.Printf(_L("=#= GetEvent 1\n")); active->StartL(); aClient.GetEvent(*event1, active->iStatus); CActiveScheduler::Start(); @@ -1253,7 +1226,7 @@ ////////////////////////////////////////////////////////////////////////////// //Get event2. It should not be there - its time is (current date - 1 day + 10 seconds). - RDebug::Print(_L("=#= GetEvent 2\n")); + TheTest.Printf(_L("=#= GetEvent 2\n")); active->StartL(); aClient.GetEvent(*event2, active->iStatus); CActiveScheduler::Start(); @@ -1458,7 +1431,7 @@ TRequestStatus status; TName name; - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0846 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0846 ")); _LIT(KThreadName, "Test thread"); name.Format(KThreadName); @@ -1487,7 +1460,7 @@ */ LOCAL_C void TestMultipleClientAccessL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0847 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0847 ")); RThread threadArray[KTestThreadCount]; TRequestStatus statusArray[KTestThreadCount]; @@ -1509,18 +1482,18 @@ count = KTestThreadCount; while(count--) { - RDebug::Print(_L(" ** Resume thread %d\r\n"), count); + TheTest.Printf(_L(" ** Resume thread %d\r\n"), count); threadArray[count].Resume(); } - RDebug::Print(_L(" ** Waiting threads to complete....\r\n")); + TheTest.Printf(_L(" ** Waiting threads to complete....\r\n")); // Wait for all the threads to complete count = KTestThreadCount; while(count--) { User::WaitForRequest(statusArray[count]); - RDebug::Print(_L(" ** Thread %d completed\r\n"), count); + TheTest.Printf(_L(" ** Thread %d completed\r\n"), count); TEST(threadArray[count].ExitType() != EExitPanic); threadArray[count].Close(); } @@ -1537,8 +1510,8 @@ LOCAL_C void TestNoNotifierL() { TestUtils::DeleteDatabaseL(); - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0848 ")); - RDebug::Print(_L("TestNoNotifierL - begin\n")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0848 ")); + TheTest.Printf(_L("TestNoNotifierL - begin\n")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1546,44 +1519,44 @@ CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); - RDebug::Print(_L("TestAddEventTypeL\n")); + TheTest.Printf(_L("TestAddEventTypeL\n")); TestAddEventTypeL(*client); - RDebug::Print(_L("TestGetEventTypeL\n")); + TheTest.Printf(_L("TestGetEventTypeL\n")); TestGetEventTypeL(*client); - RDebug::Print(_L("TestChangeEventTypeL\n")); + TheTest.Printf(_L("TestChangeEventTypeL\n")); TestChangeEventTypeL(*client); - RDebug::Print(_L("TestDeleteEventTypeL\n")); + TheTest.Printf(_L("TestDeleteEventTypeL\n")); TestDeleteEventTypeL(*client); - RDebug::Print(_L("TestAddEventL\n")); + TheTest.Printf(_L("TestAddEventL\n")); TestAddEventL(*client); - RDebug::Print(_L("TestGetEventL\n")); + TheTest.Printf(_L("TestGetEventL\n")); TestGetEventL(*client); - RDebug::Print(_L("TestChangeEventL\n")); + TheTest.Printf(_L("TestChangeEventL\n")); TestChangeEventL(*client); - RDebug::Print(_L("TestDeleteEventL\n")); + TheTest.Printf(_L("TestDeleteEventL\n")); TestDeleteEventL(*client); - RDebug::Print(_L("TestGetConfigL\n")); + TheTest.Printf(_L("TestGetConfigL\n")); TestGetConfigL(*client); - RDebug::Print(_L("TestChangeConfigL\n")); + TheTest.Printf(_L("TestChangeConfigL\n")); TestChangeConfigL(*client); - RDebug::Print(_L("TestGetStringL\n")); + TheTest.Printf(_L("TestGetStringL\n")); TestGetStringL(*client); - RDebug::Print(_L("TestClearEventLogL\n")); + TheTest.Printf(_L("TestClearEventLogL\n")); TestClearEventLogL(*client); CleanupStack::PopAndDestroy(2); // active, client - RDebug::Print(_L("TestNoNotifierL - end\n")); + TheTest.Printf(_L("TestNoNotifierL - end\n")); } /** @@ -1597,7 +1570,7 @@ */ LOCAL_C void TestLogChangeDefinitionL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4016")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4016")); TestUtils::DeleteDatabaseL(); CLogEvent* event = CLogEvent::NewL(); @@ -1657,12 +1630,12 @@ const CLogChangeDefinition& changes = changeObs->Changes(); changeCount = changes.Count(); - RDebug::Print(_L("Change Count: %d\n"), changeCount); + TheTest.Printf(_L("Change Count: %d\n"), changeCount); TEST2(changeCount, KTestEventNum); for(TInt i=0; i=0); TEST(changes.Find(TLogId(100000000), ELogChangeTypeEventAdded)==KErrNotFound); @@ -1736,7 +1709,7 @@ */ LOCAL_C void TestStartupL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0849 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0849 ")); RThread thread1; RThread thread2; @@ -1775,27 +1748,27 @@ */ LOCAL_C void TestInvalidSchemaL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0850 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0850 ")); TestUtils::TestInvalidSchemaL(); } void doTestsL() { - TestUtils::Initialize(_L("T_LOGAPI")); + TestUtils::Initialize(_L("t_logapi")); // This test should be first to ensure no clients kicking around - test.Next(_L("Invalid database scheme")); + TheTest.Next(_L("Invalid database scheme")); TestInvalidSchemaL(); theLog.Write(_L8("Test 0 OK\n")); - test.Start(_L("Simultaneous Startup")); + TheTest.Start(_L("Simultaneous Startup")); TestStartupL(); theLog.Write(_L8("Test 1 OK\n")); CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); CleanupStack::PushL(notifier); - test.Next(_L("Dying thread test")); + TheTest.Next(_L("Dying thread test")); TestThreadDieL(); theLog.Write(_L8("Test 2 OK\n")); @@ -1807,16 +1780,16 @@ CTestActive* active = new(ELeave) CTestActive(CActive::EPriorityIdle - 500); CleanupStack::PushL(active); - test.Next(_L("Additional tests on CLogChangeDefinition.")); + TheTest.Next(_L("Additional tests on CLogChangeDefinition.")); TestLogChangeDefinitionL(*client); theLog.Write(_L8("Test 2.1 OK\n")); TestUtils::DeleteDatabaseL(); - test.Next(_L("Client death")); + TheTest.Next(_L("Client death")); TestClientFailL(); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Testing client API")); + TheTest.Next(_L("Testing client API")); TestNoNotifierL(); theLog.Write(_L8("Test 4 OK\n")); @@ -1828,14 +1801,14 @@ active->StartL(); client->NotifyChange(delay, active->iStatus); - test.Next(_L("Delete Event Type")); + TheTest.Next(_L("Delete Event Type")); TestDeleteEventTypeL(*client); theLog.Write(_L8("Test 5 OK\n")); CActiveScheduler::Start(); TEST(active->iStatus.Int() >= 0); - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0834 Add Event Type ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0834 Add Event Type ")); TestAddEventTypeL(*client); theLog.Write(_L8("Test 6 OK\n")); @@ -1858,11 +1831,11 @@ client->NotifyChange(delay, active->iStatus); // The following doesn't make any changes - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0835 Get Event Type ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0835 Get Event Type ")); TestGetEventTypeL(*client); theLog.Write(_L8("Test 7 OK\n")); - test.Next(_L("Change Event Type")); + TheTest.Next(_L("Change Event Type")); TestChangeEventTypeL(*client); theLog.Write(_L8("Test 8 OK\n")); @@ -1871,7 +1844,7 @@ active->StartL(); client->NotifyChange(delay, active->iStatus); - test.Next(_L("Delete Event Type")); + TheTest.Next(_L("Delete Event Type")); TestDeleteEventTypeL(*client); theLog.Write(_L8("Test 9 OK\n")); @@ -1880,7 +1853,7 @@ active->StartL(); client->NotifyChange(delay, active->iStatus); - test.Next(_L("Add Event")); + TheTest.Next(_L("Add Event")); TestAddEventL(*client); theLog.Write(_L8("Test 10 OK\n")); @@ -1890,11 +1863,11 @@ client->NotifyChange(delay, active->iStatus); // The following doesn't make any changes - test.Next(_L("Get Event")); + TheTest.Next(_L("Get Event")); TestGetEventL(*client); theLog.Write(_L8("Test 11 OK\n")); - test.Next(_L("Change Event")); + TheTest.Next(_L("Change Event")); TestChangeEventL(*client); theLog.Write(_L8("Test 12 OK\n")); @@ -1903,7 +1876,7 @@ active->StartL(); client->NotifyChange(delay, active->iStatus); - test.Next(_L("Delete Event")); + TheTest.Next(_L("Delete Event")); TestDeleteEventL(*client); theLog.Write(_L8("Test 13 OK\n")); @@ -1913,11 +1886,11 @@ client->NotifyChange(delay, active->iStatus); // The following doesn't make any changes - test.Next(_L("Get Config")); + TheTest.Next(_L("Get Config")); TestGetConfigL(*client); theLog.Write(_L8("Test 14 OK\n")); - test.Next(_L("Change Config")); + TheTest.Next(_L("Change Config")); TestChangeConfigL(*client); theLog.Write(_L8("Test 15 OK\n")); @@ -1927,11 +1900,11 @@ client->NotifyChange(delay*3, active->iStatus); // The following doesn't make any changes - test.Next(_L("Get String")); + TheTest.Next(_L("Get String")); TestGetStringL(*client); theLog.Write(_L8("Test 16 OK\n")); - test.Next(_L("Clear Event Log")); + TheTest.Next(_L("Clear Event Log")); TestClearEventLogL(*client); theLog.Write(_L8("Test 17 OK\n")); @@ -1940,11 +1913,11 @@ active->StartL(); client->NotifyChange(delay, active->iStatus); - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0833 Test global change API ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0833 Test global change API ")); TestClientObserverMechanismL(*client); theLog.Write(_L8("Test 18 OK\n")); - test.Next(_L("Multiple client access")); + TheTest.Next(_L("Multiple client access")); TestMultipleClientAccessL(); theLog.Write(_L8("Test 19 OK\n")); @@ -1966,7 +1939,7 @@ theLog.Write(_L8("Allocating a new CLogClient object... \n")); CLogClient* theClient = CLogClient::NewL(theFs); CleanupStack::PushL(theClient); - test.Next(_L("TestGetConfigSettingsFromRepositoryFileL () ")); + TheTest.Next(_L("TestGetConfigSettingsFromRepositoryFileL () ")); TestGetConfigSettingsFromRepositoryFileL(*theClient); theLog.Write(_L8("TestGetConfigSettingsFromRepositoryFileL () OK\n")); theLog.Write(_L8("Destroying the CLogClient object... \n")); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logapi2.cpp --- a/loggingservices/eventlogger/test/src/t_logapi2.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logapi2.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -19,12 +19,10 @@ #include #include #include -#include "TEST.H" +#include "t_logutil2.h" #include "LogServSqlStrings.h" -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("t_logapi2")); +RTest TheTest(_L("t_logapi2")); _LIT(KTestRemoteParty1, "Remote Party"); _LIT(KTestDirection1, "Direction"); @@ -148,7 +146,7 @@ TTime st_time; st_time.UniversalTime(); - test.Printf(_L("Added events:\n")); + TheTest.Printf(_L("Added events:\n")); TInt diffEvCount = KDiffEvCount; for(TInt i=0;iiStatus.Int(), KErrNone); if((i % 50) == 0 && i > 0) { - test.Printf(_L("%d\r"), i); + TheTest.Printf(_L("%d\r"), i); } } - test.Printf(_L("%d\n"), TheAddedEventCount); + TheTest.Printf(_L("%d\n"), TheAddedEventCount); TTime end_time; end_time.UniversalTime(); @@ -189,7 +187,7 @@ CleanupStack::PopAndDestroy(client); TTimeIntervalMicroSeconds us = end_time.MicroSecondsFrom(st_time); - test.Printf(_L("%d events added. Time: %ld milliseconds\n"), TheAddedEventCount, us.Int64() / 1000); + TheTest.Printf(_L("%d events added. Time: %ld milliseconds\n"), TheAddedEventCount, us.Int64() / 1000); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -360,7 +358,7 @@ CleanupStack::PopAndDestroy(active); CleanupStack::PopAndDestroy(client); - test.Printf(_L("===CLogClient::AddEvent() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::AddEvent() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -446,7 +444,7 @@ CleanupStack::PopAndDestroy(active); CleanupStack::PopAndDestroy(client); - test.Printf(_L("===CLogClient::ChangeEvent() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ChangeEvent() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -504,7 +502,7 @@ CleanupStack::PopAndDestroy(active); CleanupStack::PopAndDestroy(client); - test.Printf(_L("===CLogClient::DeleteEvent() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::DeleteEvent() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -564,7 +562,7 @@ CleanupStack::PopAndDestroy(active); CleanupStack::PopAndDestroy(client); - test.Printf(_L("===CLogClient::GetEvent() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::GetEvent() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -701,11 +699,11 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); TInt count = view->CountL(); - test.Printf(_L("===Events count: %d\n"), count); + TheTest.Printf(_L("===Events count: %d\n"), count); TTime end_time; end_time.UniversalTime(); TTimeIntervalMicroSeconds us = end_time.MicroSecondsFrom(st_time); - test.Printf(_L("SetFilter(). Time: %ld milliseconds\n"), us.Int64() / 1000); + TheTest.Printf(_L("SetFilter(). Time: %ld milliseconds\n"), us.Int64() / 1000); st_time.UniversalTime(); if(view->FirstL(active->iStatus)) @@ -722,7 +720,7 @@ } end_time.UniversalTime(); us = end_time.MicroSecondsFrom(st_time); - test.Printf(_L("Event view walk completed. Events count: %d. Time: %ld milliseconds\n"), count, us.Int64() / 1000); + TheTest.Printf(_L("Event view walk completed. Events count: %d. Time: %ld milliseconds\n"), count, us.Int64() / 1000); CleanupStack::PopAndDestroy(filterList); CleanupStack::PopAndDestroy(filter3); @@ -766,7 +764,7 @@ #else//_DEBUG static void StopLogServerL() { - RDebug::Print(_L("StopLogServerL(): the LogEng server cannot be stopped in release mode. ELogMakeTransient is a debug message.\n")); + TheTest.Printf(_L("StopLogServerL(): the LogEng server cannot be stopped in release mode. ELogMakeTransient is a debug message.\n")); } #endif//_DEBUG @@ -1018,40 +1016,41 @@ void doTestsL() { + TestUtils::Initialize(_L("t_logapi2")); TestUtils::DeleteDatabaseL(); // - test.Start(_L("Preparation. Adding 200 events...")); + TheTest.Start(_L("Preparation. Adding 200 events...")); DoAddEventsL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4029: AddEvent() server side OOM test when logged events count is max (200)")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4029: AddEvent() server side OOM test when logged events count is max (200)")); AddEventOomTestL(ELogOpAddEvent, KErrNone); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4029: AddEvent() server side OOM test when logged events count is max (200). Invalid event type.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4029: AddEvent() server side OOM test when logged events count is max (200). Invalid event type.")); AddEventOomTestL(ELogOpAddEventInvalidType, KErrNotFound); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4030: AddEvent() server side OOM test when logged events count is max (200). Logging disabled.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4030: AddEvent() server side OOM test when logged events count is max (200). Logging disabled.")); AddEventOomTestL(ELogOpAddEventLoggingDisabled, KErrNotSupported); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4030: ChangeEvent() server side OOM test when logged events count is max (200). The event does exist.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4030: ChangeEvent() server side OOM test when logged events count is max (200). The event does exist.")); ChangeEventOomTestL(ETrue); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4030: ChangeEvent() server side OOM test when logged events count is max (200). The event does not exist.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4030: ChangeEvent() server side OOM test when logged events count is max (200). The event does not exist.")); ChangeEventOomTestL(EFalse); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4032: GetEvent() server side OOM test when logged events count is max (200).")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4032: GetEvent() server side OOM test when logged events count is max (200).")); GetEventOomTestL(ELogOpGetEvent, KErrNone); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4032: GetEvent() server side OOM test when logged events count is max (200). The event does not exist.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4032: GetEvent() server side OOM test when logged events count is max (200). The event does not exist.")); GetEventOomTestL(ELogOpGetEventNotExists, KErrNotFound); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4032: GetEvent() server side OOM test when logged events count is max (200). The event id is 0.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4032: GetEvent() server side OOM test when logged events count is max (200). The event id is 0.")); GetEventOomTestL(ELogOpGetEventZeroId, KErrNotFound); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4031: DeleteEvent() server side OOM test when logged events count is max (200). The event does exist.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4031: DeleteEvent() server side OOM test when logged events count is max (200). The event does exist.")); DeleteEventOomTestL(ETrue); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4031: DeleteEvent() server side OOM test when logged events count is max (200). The event does not exist.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4031: DeleteEvent() server side OOM test when logged events count is max (200). The event does not exist.")); DeleteEventOomTestL(EFalse); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4033: Attempt to change one of the standard event types.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4033: Attempt to change one of the standard event types.")); ChangeStandardEventTypeTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4042: \"Cancel Operation\" test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4042: \"Cancel Operation\" test")); CancelOperationTest(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4034: Complex filter set test.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4034: Complex filter set test.")); ComplexFilterSetTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4047: Check for updated configuration values")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4047: Check for updated configuration values")); DoCheckUpdateConfigL(); #ifdef SYSLIBS_TEST - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4035: Complex recent list test.")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4035: Complex recent list test.")); ComplexRecentListTestL(); #endif // diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logapi_helper.cpp --- a/loggingservices/eventlogger/test/src/t_logapi_helper.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logapi_helper.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -19,35 +19,11 @@ #include #include #include - - -RTest TheTest(_L("t_logapi_helper")); +#include "t_logutil.h" _LIT(KSeparator, ";"); // Invalid filepath char used to separate filenames -////////////////////////////////////////////////////////////////////////////////////////// -//Tests macros and functions. -//If (!aValue) then the test will be panicked, the test data files will be deleted. -static void Check(TInt aValue, TInt aLine) - { - if(!aValue) - { - TheTest.Printf(_L("*** Boolean expression evaluated to false\r\n")); - TheTest(EFalse, aLine); - } - } -//If (aValue != aExpected) then the test will be panicked, the test data files will be deleted. -static void Check(TInt aValue, TInt aExpected, TInt aLine) - { - if(aValue != aExpected) - { - TheTest.Printf(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); - TheTest(EFalse, aLine); - } - } -//Use these to test conditions. -#define TEST(arg) Check((arg), __LINE__) -#define TEST2(aValue, aExpected) Check(aValue, aExpected, __LINE__) +RTest TheTest(_L("t_logapi_helper")); /* This method helps to do operations on files and folders, like copy, delete, rename, create directory (MkDir) diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logbackup.cpp --- a/loggingservices/eventlogger/test/src/t_logbackup.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logbackup.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,13 +15,11 @@ #include #include - -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. +RTest TheTest(_L("t_logbackup")); -RTest test(_L("Log Backup Test Harness")); CBaBackupSessionWrapper* theBackup = NULL; ///////////////////////////////////////////////////////////////////////////////////// @@ -77,7 +75,7 @@ */ LOCAL_C void TestLogOpenL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0993 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0993 ")); TEST(IsLogOpenL()); } @@ -91,7 +89,7 @@ */ LOCAL_C void TestLogClosedL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0994 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0994 ")); TEST(!IsLogOpenL()); } @@ -166,7 +164,7 @@ */ LOCAL_C void TestLockingL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0995 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0995 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -196,7 +194,7 @@ */ LOCAL_C void TestDeleteWhileLockedL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0996 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0996 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); ForceClientImplInstL(*client); @@ -234,7 +232,7 @@ */ LOCAL_C void TestDeleteViewWhileLockedL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0997 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0997 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); ForceClientImplInstL(*client); @@ -284,7 +282,7 @@ */ LOCAL_C void TestMultipleClientLockingL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0998 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0998 ")); CLogClient* client1 = CLogClient::NewL(theFs); CleanupStack::PushL(client1); ForceClientImplInstL(*client1); @@ -320,7 +318,7 @@ */ LOCAL_C void TestMultipleViewLockingL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0999 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0999 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); ForceClientImplInstL(*client); @@ -448,7 +446,7 @@ active->StartL(); aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); - RDebug::Print(_L("*** active->iStatus.Int()=%d\n"), active->iStatus.Int()); + TheTest.Printf(_L("*** active->iStatus.Int()=%d\n"), active->iStatus.Int()); TEST(active->iStatus.Int() == aError || active->iStatus.Int() == KErrNotFound); CleanupStack::PopAndDestroy(2); // event, active @@ -466,7 +464,7 @@ */ LOCAL_C void TestClientRequestsL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1000 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1000 ")); CLogClient* client1 = CLogClient::NewL(theFs); CleanupStack::PushL(client1); ForceClientImplInstL(*client1); @@ -509,7 +507,7 @@ */ LOCAL_C void TestNotificationsL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1001 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1001 ")); CTestActive* notify = new(ELeave)CTestActive; CleanupStack::PushL(notify); @@ -645,7 +643,7 @@ */ LOCAL_C void TestRequestInProgressL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1002 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1002 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); ForceClientImplInstL(*client); @@ -723,7 +721,7 @@ */ LOCAL_C void TestViewRequestInProgressL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1003 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1003 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); ForceClientImplInstL(*client); @@ -831,7 +829,7 @@ */ LOCAL_C void TestViewSetup1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1004 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1004 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); ForceClientImplInstL(*client); @@ -891,7 +889,7 @@ */ LOCAL_C void TestViewSetup2L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1005 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1005 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); ForceClientImplInstL(*client); @@ -965,7 +963,7 @@ */ LOCAL_C void TestRefreshViewL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1006 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1006 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1004,62 +1002,61 @@ ///////////////////////////////////////////////////////////////////////////////////// void doTestsL() -// -// -// { - test.Start(_L("T_LogBackup")); - TestUtils::Initialize(_L("T_BACKUP")); + TestUtils::Initialize(_L("t_logbackup")); TestUtils::DeleteDatabaseL(); + + TheTest.Start(_L("t_logbackup")); + #ifndef __WINS__ - test.Printf(_L("This test harness will only work on WINS\n")); + TheTest.Printf(_L("This test harness will only work on WINS\n")); User::After(5000000); #else//__WINS__ CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); CleanupStack::PushL(notifier); - test.Next(_L("Locking")); + TheTest.Next(_L("Locking")); TestLockingL(); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("Delete client while locked")); + TheTest.Next(_L("Delete client while locked")); TestDeleteWhileLockedL(); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("Delete view while locked")); + TheTest.Next(_L("Delete view while locked")); TestDeleteViewWhileLockedL(); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Multiple clients")); + TheTest.Next(_L("Multiple clients")); TestMultipleClientLockingL(); theLog.Write(_L8("Test 4 OK\n")); - test.Next(_L("Multiple views")); + TheTest.Next(_L("Multiple views")); TestMultipleViewLockingL(); theLog.Write(_L8("Test 5 OK\n")); - test.Next(_L("Client Requests")); + TheTest.Next(_L("Client Requests")); TestClientRequestsL(); theLog.Write(_L8("Test 6 OK\n")); - test.Next(_L("View setup")); + TheTest.Next(_L("View setup")); TestViewSetup1L(); TestViewSetup2L(); theLog.Write(_L8("Test 7 OK\n")); - test.Next(_L("Notifications")); + TheTest.Next(_L("Notifications")); TestNotificationsL(); theLog.Write(_L8("Test 8 OK\n")); - test.Next(_L("Request in progress")); + TheTest.Next(_L("Request in progress")); TestRequestInProgressL(); theLog.Write(_L8("Test 9 OK\n")); - test.Next(_L("View request in progress")); + TheTest.Next(_L("View request in progress")); TestViewRequestInProgressL(); theLog.Write(_L8("Test 10 OK\n")); - test.Next(_L("Refresh view")); + TheTest.Next(_L("Refresh view")); TestRefreshViewL(); theLog.Write(_L8("Test 11 OK\n")); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logbadclient.cpp --- a/loggingservices/eventlogger/test/src/t_logbadclient.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logbadclient.cpp Mon May 03 14:09:14 2010 +0300 @@ -18,6 +18,7 @@ #include #include "LogServShared.h" #include "logservcli.h" +#include "t_logutil.h" /////////////////////////////////////////////////////////////////////////////////////// @@ -78,48 +79,6 @@ static TPtrC8 TheLogIpcDataPtr((const TUint8*)&TheLogIpcData, sizeof(TheLogIpcData)); /////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -//Test macros and functions -void Check1(TInt aValue, TInt aLine, TBool aPrintThreadName = EFalse) - { - if(!aValue) - { - if(aPrintThreadName) - { - RThread th; - TName name = th.Name(); - RDebug::Print(_L("*** Thread %S, Line %d\r\n"), &name, aLine); - } - else - { - RDebug::Print(_L("*** Line %d\r\n"), aLine); - } - TheTest(EFalse, aLine); - } - } -void Check2(TInt aValue, TInt aExpected, TInt aLine, TBool aPrintThreadName = EFalse) - { - if(aValue != aExpected) - { - if(aPrintThreadName) - { - RThread th; - TName name = th.Name(); - RDebug::Print(_L("*** Thread %S, Line %d Expected error: %d, got: %d\r\n"), &name, aLine, aExpected, aValue); - } - else - { - RDebug::Print(_L("*** Line %d, Expected error: %d, got: %d\r\n"), aLine, aExpected, aValue); - } - TheTest(EFalse, aLine); - } - } -#define TEST(arg) ::Check1((arg), __LINE__) -#define TEST2(aValue, aExpected) ::Check2(aValue, aExpected, __LINE__) -#define TTEST(arg) ::Check1((arg), __LINE__, ETrue) -#define TTEST2(aValue, aExpected) ::Check2(aValue, aExpected, __LINE__, ETrue) - -/////////////////////////////////////////////////////////////////////////////////////// void PrintIterationCount(TInt aIteration) { @@ -130,7 +89,7 @@ TDateTime dt = time.DateTime(); TBuf<16> tbuf; tbuf.Format(_L("%02d:%02d:%02d.%06d"), dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond()); - RDebug::Print(_L("-----[%S] Test iterations: %d\r\n"), &tbuf, aIteration); + TheTest.Printf(_L("-----[%S] Test iterations: %d\r\n"), &tbuf, aIteration); } } @@ -290,20 +249,20 @@ TheTest.Printf(_L("##Iteration %d. Function %d. Thread \"%S\" already exists!\r\n"), data.iIteration, data.iFunction, &KTestThreadName); for(TInt i=0;i -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. +RTest TheTest(_L("t_logbench")); -RTest test(_L("Log Engine Benchmark Test Harness")); TLogConfig theConfig; - _LIT(KTestString, "%dabcdefghijklmnopqrstuvwxyz"); _LIT(KResultFile, "C:\\LOGENG_TEST.TXT"); @@ -72,7 +70,7 @@ */ LOCAL_C void TestSetupL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0988 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0988 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -82,9 +80,9 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - test.Printf(_L(" Log size: %d\n"), theConfig.iMaxLogSize); - test.Printf(_L(" Recent list size: %d\n"), theConfig.iMaxRecentLogSize); - test.Printf(_L(" Max Event Age: %d\n"), theConfig.iMaxEventAge); + TheTest.Printf(_L(" Log size: %d\n"), theConfig.iMaxLogSize); + TheTest.Printf(_L(" Recent list size: %d\n"), theConfig.iMaxRecentLogSize); + TheTest.Printf(_L(" Max Event Age: %d\n"), theConfig.iMaxEventAge); TestUtils::DeleteDatabaseL(); @@ -95,7 +93,7 @@ TEST2(active->iStatus.Int(), KErrNone); // Wait for user interation - //test.Printf(_L(" Quick tests performed if no key pressed in next 10 seconds\n")); + //TheTest.Printf(_L(" Quick tests performed if no key pressed in next 10 seconds\n")); //TKeyCode key; //if (!TestUtils::WaitForKeyL(10000000, key)) { @@ -122,7 +120,7 @@ */ LOCAL_C void BenchmarkTestL(CLogClient& aClient, RFile& aFile) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0989 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0989 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -172,7 +170,7 @@ TInt serverHeapSize = GetServerHeapSizeL(); // Store details in file - test.Printf(_L(" Num: %d, Time: %d, Db Size: %d, Hs: %d, Server Hs: %d\n"), count, I64INT(interval.Int64()), dbSize, heapSize, serverHeapSize); + TheTest.Printf(_L(" Num: %d, Time: %d, Db Size: %d, Hs: %d, Server Hs: %d\n"), count, I64INT(interval.Int64()), dbSize, heapSize, serverHeapSize); buf.Format(_L8("%d,%d,%d,%d,%d\n"), count, I64INT(interval.Int64()), dbSize, heapSize, serverHeapSize); aFile.Write(buf); } @@ -203,7 +201,7 @@ TInt serverHeapSize = GetServerHeapSizeL(); // Store details in file - test.Printf(_L(" Count: %d, Time: %d, Hs: %d, Server Hs: %d\n"), count, I64INT(interval.Int64()), heapSize, serverHeapSize); + TheTest.Printf(_L(" Count: %d, Time: %d, Hs: %d, Server Hs: %d\n"), count, I64INT(interval.Int64()), heapSize, serverHeapSize); buf.Format(_L8("%d,%d,%d,%d\n"), count++, I64INT(interval.Int64()), heapSize, serverHeapSize); aFile.Write(buf); } @@ -222,7 +220,7 @@ */ LOCAL_C void DoTestRecentViewsL(CLogClient& aClient, TLogRecentList aList, TInt aRecentCount, TInt aDuplicateCount) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0990 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0990 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -273,7 +271,7 @@ */ LOCAL_C void DoTestClearDuplicateL(CLogClient& aClient, TLogRecentList aList, RFile& aFile) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0991 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0991 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -294,7 +292,7 @@ TTimeIntervalMicroSeconds interval = after.MicroSecondsFrom(before); TBuf8<256> buf; - test.Printf(_L("Clearing Duplicates for List %d, %d\n"), recent->RecentList(), I64INT(interval.Int64())); + TheTest.Printf(_L("Clearing Duplicates for List %d, %d\n"), recent->RecentList(), I64INT(interval.Int64())); buf.Format(_L8("Clearing Duplicates for List %d, %d\n"), recent->RecentList(), I64INT(interval.Int64())); aFile.Write(buf); @@ -311,7 +309,7 @@ */ LOCAL_C void TestRecentListsL(CLogClient& aClient, RFile& aFile) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0992 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0992 ")); aFile.Write(_L8("Recent Lists\n")); CTestActive* active = new(ELeave)CTestActive(); @@ -399,7 +397,7 @@ // Store details in file TBuf8<256> buf; - test.Printf(_L(" Count: %d, Add: %d, Nav: %d\n"), duplicates, I64INT(interval1.Int64()), I64INT(interval2.Int64())); + TheTest.Printf(_L(" Count: %d, Add: %d, Nav: %d\n"), duplicates, I64INT(interval1.Int64()), I64INT(interval2.Int64())); buf.Format(_L8("%d,%d,%d\n"), duplicates, I64INT(interval1.Int64()), I64INT(interval2.Int64())); aFile.Write(buf); } @@ -414,7 +412,7 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGBENCH")); + TestUtils::Initialize(_L("t_logbench")); CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); CleanupStack::PushL(notifier); @@ -431,20 +429,20 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - test.Start(_L("Setup")); + TheTest.Start(_L("Setup")); TestSetupL(*client); theLog.Write(_L8("Test 1 OK\n")); RFile results; LEAVE_IF_ERROR(results.Replace(theFs, KResultFile, EFileWrite|EFileShareExclusive)); - test.Next(_L("Benchmark tests")); + TheTest.Next(_L("Benchmark tests")); BenchmarkTestL(*client, results); theLog.Write(_L8("Test 2 OK\n")); TestUtils::DeleteDatabaseL(); - test.Next(_L("Recent List tests")); + TheTest.Next(_L("Recent List tests")); TestRecentListsL(*client, results); theLog.Write(_L8("Test 3 OK\n")); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logcntmatch.cpp --- a/loggingservices/eventlogger/test/src/t_logcntmatch.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logcntmatch.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -22,7 +22,7 @@ #include #include #include -#include "TEST.H" +#include "t_logutil2.h" ///////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -61,9 +61,8 @@ _LIT(KPhoneNumber, "0123456789"); _LIT(KTestNum, "1234567890"); -#undef test //there is a "test" macro which hides "RTest test" declaration. +RTest TheTest(_L("t_logcntmatch")); -RTest test(_L("Contact Matching Test Harness")); TBool TheMatchingIsEnabled = EFalse; //TheContactNameFmt variable must be initialized before tests. //It gives an information what is the contact name format in the logs. @@ -354,15 +353,15 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGCONTACT")); + TestUtils::Initialize(_L("t_logcntmatch")); - test.Start(_L("Prepare the test environment")); + TheTest.Start(_L("Prepare the test environment")); TheMatchingIsEnabled = TestUtils::MatchingEnabledL(); if (!TheMatchingIsEnabled) { - test.Printf(_L("Contacts matching not enabled. Contacts matching tests NOT run\n")); + TheTest.Printf(_L("Contacts matching not enabled. Contacts matching tests NOT run\n")); return; } @@ -375,11 +374,11 @@ //All tests bellow are likely to fail if 101f401d.txt file exists in CentralRepository private data cage //and the contact mach count is set to 0 in that file. - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1392: DEF068087: Chinese names don't display in Chinese name format")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1392: DEF068087: Chinese names don't display in Chinese name format")); ::DEF068087L(*client); - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1016: Contacts matching - test1")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1016: Contacts matching - test1")); TestContactMatch1L(*client); - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1017: Contacts matching - test2")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1017: Contacts matching - test2")); TestContactMatch2L(*client); TestUtils::DeleteDatabaseL(); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logcompat.cpp --- a/loggingservices/eventlogger/test/src/t_logcompat.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logcompat.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -20,11 +20,9 @@ #include #include #include -#include "TEST.H" +#include "t_logutil2.h" -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("LogEng compatibility")); +RTest TheTest(_L("t_logcompat")); #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM @@ -82,7 +80,7 @@ TEST(aEvent.SimId() == aSimId); TPtrC eventStatus = aEvent.Subject(); TPtrC eventNumber = aEvent.Number(); - test.Printf(_L("Id:%d No:%S Sub:%S Contact Id:0x%x SimId:%u\n"), aEvent.Id(), &eventNumber, &eventStatus, aEvent.Contact(), aEvent.SimId()); + TheTest.Printf(_L("Id:%d No:%S Sub:%S Contact Id:0x%x SimId:%u\n"), aEvent.Id(), &eventNumber, &eventStatus, aEvent.Contact(), aEvent.SimId()); } void DoGetEventTestL(TLogId aEventId, const TDesC& aEventNumber, TSimId aSimId, CTestActive& aActive, CLogClient& aLogClient) @@ -651,32 +649,34 @@ void doTestsL() { + TestUtils::Initialize(_L("t_logcompat")); + #ifdef _DEBUG - test.Start(_L("Copy the old LogEng database")); + TheTest.Start(_L("Copy the old LogEng database")); TestUtils::CopyOldDbL(); // - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4018: \"Get Event\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4018: \"Get Event\" compatibility test")); GetEventTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4019: \"Change Event\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4019: \"Change Event\" compatibility test")); ChangeEventTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4020: \"Add Event\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4020: \"Add Event\" compatibility test")); AddEventTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4021: \"Delete Event\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4021: \"Delete Event\" compatibility test")); DeleteEventTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4022: \"Event View\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4022: \"Event View\" compatibility test")); EventViewTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4023: \"Event View 2\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4023: \"Event View 2\" compatibility test")); EventViewTest2L(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4024: \"Event View 3\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4024: \"Event View 3\" compatibility test")); EventViewTest3L(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4043: \"CLogEvent data\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4043: \"CLogEvent data\" compatibility test")); EventDataTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4046: \"CLogClient::ClearLog()\" compatibility test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4046: \"CLogClient::ClearLog()\" compatibility test")); ClearLogTestL(); // TestUtils::DeleteDatabaseL(); #else - test.Start(_L("This test works only in debug mode, otherwise the LogEng server cannot be stopped. See TestUtils::CopyOldDbL()")); + TheTest.Start(_L("This test works only in debug mode, otherwise the LogEng server cannot be stopped. See TestUtils::CopyOldDbL()")); #endif } @@ -684,7 +684,7 @@ void doTestsL() { - test.Start(_L("The LogEng compatibility test cases are compiled only when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM macro is defined!")); + TheTest.Start(_L("The LogEng compatibility test cases are compiled only when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM macro is defined!")); } #endif//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logcontact.cpp --- a/loggingservices/eventlogger/test/src/t_logcontact.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logcontact.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,12 +14,9 @@ // #include -#include "TEST.H" - +#include "t_logutil2.h" -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Contact Test Harness")); +RTest TheTest(_L("t_logcontact")); /** @SYMTestCaseID SYSLIB-LOGENG-CT-1018 @@ -32,7 +29,7 @@ */ static void TestBackupL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1018 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1018 ")); CTestActive* active = new (ELeave) CTestActive; CleanupStack::PushL(active); @@ -155,9 +152,9 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGCONTACT")); + TestUtils::Initialize(_L("t_logcontact")); - test.Start(_L("Prepare the test environment")); + TheTest.Start(_L("Prepare the test environment")); // Create log client CLogClient* client = CLogClient::NewL(theFs); @@ -166,9 +163,9 @@ // Send a message to the hicap helper to delete logeng DB TestUtils::DeleteDatabaseL(); - test.Next(_L("Backup")); + TheTest.Next(_L("Backup")); TestBackupL(*client); - test.Next(_L("Backup completed ok")); + TheTest.Next(_L("Backup completed ok")); theLog.Write(_L8("Test 2 OK\n")); CleanupStack::PopAndDestroy(client); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logenvcreate.cpp --- a/loggingservices/eventlogger/test/src/t_logenvcreate.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logenvcreate.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -18,6 +18,7 @@ #include #include +#include "t_logutil.h" RTest TheTest(_L("t_logenvcreate - copying EventLogger test files to C:")); @@ -31,53 +32,6 @@ _LIT(KCFileName1, "c:\\private\\10003a73\\CntModel.ini"); _LIT(KCFileName2, "c:\\private\\10003a73\\SQLite__Contacts.cdb"); -/////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -//Test macros and functions -static void Check(TInt aValue, TInt aExpected, TInt aLine) - { - if(aValue != aExpected) - { - RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); - TheTest(EFalse, aLine); - } - } -#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) - -/////////////////////////////////////////////////////////////////////////////////////// - -static void KillProcess(const TDesC& aProcessName) - { - TFullName name; - TheTest.Printf(_L(":: Find and kill \"%S\" process.\n"), &aProcessName); - TBuf<64> pattern(aProcessName); - TInt length = pattern.Length(); - pattern += _L("*"); - TFindProcess procFinder(pattern); - - while (procFinder.Next(name) == KErrNone) - { - if (name.Length() > length) - {//If found name is a string containing aProcessName string. - TChar c(name[length]); - if (c.IsAlphaDigit() || c == TChar('_') || c == TChar('-')) - { - // If the found name is other valid application name - // starting with aProcessName string. - TheTest.Printf(_L(":: Process name: \"%S\".\n"), &name); - continue; - } - } - RProcess proc; - if (proc.Open(name) == KErrNone) - { - proc.Kill(0); - TheTest.Printf(_L(":: \"%S\" process killed.\n"), &name); - } - proc.Close(); - } - } - void DoRun() { RFs fs; diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logenvdestroy.cpp --- a/loggingservices/eventlogger/test/src/t_logenvdestroy.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logenvdestroy.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -18,6 +18,7 @@ #include #include +#include "t_logutil.h" RTest TheTest(_L("t_logenvdestroy - deleting EventLogger test files from C:")); @@ -25,19 +26,6 @@ _LIT(KCFileName2, "c:\\private\\10003a73\\SQLite__Contacts.cdb"); /////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -//Test macros and functions -static void Check(TInt aValue, TInt aExpected, TInt aLine) - { - if(aValue != aExpected) - { - RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); - TheTest(EFalse, aLine); - } - } -#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) - -/////////////////////////////////////////////////////////////////////////////////////// void DoDeleteFile(RFs& aFs, const TDesC& aFilePath) { diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logevent.cpp --- a/loggingservices/eventlogger/test/src/t_logevent.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logevent.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,17 +14,10 @@ // #include -#include "TEST.H" +#include "t_logutil2.h" #include -/* this fixes a MSVC link warning */ -#ifdef __VC32__ -#pragma comment (linker, "/opt:noref") -#endif - -#undef test //there is a "TEST" macro which hides "RTest TEST" declaration. - -RTest test(_L("Log Event Test Harness")); +RTest TheTest(_L("t_logevent")); TBool CompareEvents(const CLogEvent& aLeft, const CLogEvent& aRight) { @@ -77,11 +70,8 @@ @SYMREQ REQ0000 */ LOCAL_C void TestEventL() -// -// -// { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1008 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1008 ")); CLogEvent* event1 = CLogEvent::NewL(); CleanupStack::PushL(event1); @@ -567,12 +557,8 @@ @SYMREQ REQ0000 */ LOCAL_C void TestEventWithHeapFailL() -// -// -// - { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1009 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1009 ")); #ifdef _DEBUG TInt failCount = 0; #endif @@ -826,11 +812,8 @@ @SYMREQ REQ0000 */ LOCAL_C void TestEventWithFileFailL() -// -// -// { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1010 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1010 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -900,24 +883,21 @@ } void doTestsL() -// -// -// { - TestUtils::Initialize(_L("T_LOGEVENT")); + TestUtils::Initialize(_L("t_logevent")); - test.Start(_L("Event")); + TheTest.Start(_L("Event")); // TestServerL(); TestEventL(); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("Event with heap failure")); + TheTest.Next(_L("Event with heap failure")); TestEventWithHeapFailL(); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("Event with file failure")); + TheTest.Next(_L("Event with file failure")); TestEventWithFileFailL(); theLog.Write(_L8("Test 3 OK\n")); } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logfile.cpp --- a/loggingservices/eventlogger/test/src/t_logfile.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logfile.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,7 +14,7 @@ // #include -#include "TEST.H" +#include "t_logutil2.h" /* This test may fail occasionally, especially after changing the LogEng server code. The reported error is KErrCorrupt. @@ -45,9 +45,7 @@ SetErrorCondition()/DBMS interaction. */ -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log Client API File Failure Test Harness")); +RTest TheTest(_L("t_logfile")); const TUid KTestEventUid = {0x10005393}; _LIT(KTestEventDesc1, "Event Type Description"); @@ -86,7 +84,7 @@ */ LOCAL_C void TestBasicL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1334 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1334 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -191,7 +189,7 @@ */ LOCAL_C void TestConstructionL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0911 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0911 ")); CLogClient* client = NULL; TInt failCount = 0; @@ -228,7 +226,7 @@ } delete client; - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -242,7 +240,7 @@ */ LOCAL_C void TestAddEventTypeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0912 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0912 ")); CLogEventType* type = CLogEventType::NewL(); CleanupStack::PushL(type); @@ -303,7 +301,7 @@ TEST2(active->iStatus.Int(), KErrAlreadyExists); CleanupStack::PopAndDestroy(2); // active, type - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -317,7 +315,7 @@ */ LOCAL_C void TestGetEventTypeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0913 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0913 ")); CLogEventType* type = CLogEventType::NewL(); CleanupStack::PushL(type); @@ -354,7 +352,7 @@ TEST(type->LoggingEnabled()); CleanupStack::PopAndDestroy(2); // active, type - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -368,7 +366,7 @@ */ LOCAL_C void TestChangeEventTypeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0914 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0914 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -438,7 +436,7 @@ TEST(type->LoggingEnabled() == EFalse); CleanupStack::PopAndDestroy(2); // type, active - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -452,7 +450,7 @@ */ LOCAL_C void TestDeleteEventTypeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0915 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0915 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -510,7 +508,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(2); // type, active - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -525,7 +523,7 @@ */ LOCAL_C void TestAddEventL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0916 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0916 ")); // Ensure we always start from the same state TestUtils::DeleteDatabaseL(); @@ -619,7 +617,7 @@ TEST2(active->iStatus.Int(), KErrNone); CleanupStack::PopAndDestroy(3); // event, active, type - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -634,7 +632,7 @@ */ LOCAL_C void TestGetEventL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0917 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0917 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -678,7 +676,7 @@ TEST(event->Data() == KTestData1); CleanupStack::PopAndDestroy(2); // event, active - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -693,7 +691,7 @@ */ LOCAL_C void TestChangeEventL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0918 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0918 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -753,7 +751,7 @@ aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); if (active->iStatus != KErrNone) - RDebug::Print(_L("error code:%d failcount:%d\n"),active->iStatus.Int(),failCount); + TheTest.Printf(_L("error code:%d failcount:%d\n"),active->iStatus.Int(),failCount); TEST2(active->iStatus.Int(), KErrNone); TEST(event->Id() == 0); @@ -796,7 +794,7 @@ TEST(event->Data() == KTestData2); CleanupStack::PopAndDestroy(2); // event, active - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -811,7 +809,7 @@ */ LOCAL_C void TestDeleteEventL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0919 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0919 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -869,7 +867,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(2); // event, active - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -884,7 +882,7 @@ */ LOCAL_C void TestGetConfigL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0920 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0920 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -918,7 +916,7 @@ TEST(config.iMaxRecentLogSize > 0); CleanupStack::PopAndDestroy(); // active - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -933,7 +931,7 @@ */ LOCAL_C void TestChangeConfigL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0921 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0921 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -1002,7 +1000,7 @@ TEST(config.iMaxEventAge == KTestMaxEventAge); CleanupStack::PopAndDestroy(); // active - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -1017,7 +1015,7 @@ */ LOCAL_C void TestGetStringL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0922 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0922 ")); TBuf str; TInt failCount = 0; @@ -1043,7 +1041,7 @@ TEST(str.Length() == 0); } } - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } /** @@ -1063,7 +1061,7 @@ #endif ) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0923 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0923 ")); TTime now; now.UniversalTime(); @@ -1174,7 +1172,7 @@ aClient.GetEvent(*event1, active->iStatus); CActiveScheduler::Start(); if (active->iStatus != KErrNone) - RDebug::Print(_L("error code:%d\n"),active->iStatus.Int()); + TheTest.Printf(_L("error code:%d\n"),active->iStatus.Int()); TEST2(active->iStatus.Int(), KErrNone); active->StartL(); @@ -1208,17 +1206,17 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(5); // event4, event3, event2, event1, active - RDebug::Print(_L("The test has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test has succeeded at iteration %d\n"), failCount); } void doTestsL() { - TestUtils::Initialize(_L("T_LOGFILE")); + TestUtils::Initialize(_L("t_logfile")); - test.Start(_L("Construction + create db")); + TheTest.Start(_L("Construction + create db")); TestUtils::DeleteDatabaseL(); TestConstructionL(); // Creates database - test.Next(_L("Construction + open db")); + TheTest.Next(_L("Construction + open db")); TestConstructionL(); // Opens existing database TestUtils::DeleteDatabaseL(); theLog.Write(_L8("Test 1 OK\n")); @@ -1226,58 +1224,58 @@ CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); - test.Next(_L("Add Event Type")); + TheTest.Next(_L("Add Event Type")); TestAddEventTypeL(*client); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("Get Event Type")); + TheTest.Next(_L("Get Event Type")); TestGetEventTypeL(*client); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Change Event Type")); + TheTest.Next(_L("Change Event Type")); TestChangeEventTypeL(*client); theLog.Write(_L8("Test 4 OK\n")); - test.Next(_L("Delete Event Type")); + TheTest.Next(_L("Delete Event Type")); TestDeleteEventTypeL(*client); theLog.Write(_L8("Test 5 OK\n")); TestUtils::DeleteDatabaseL(); - test.Next(_L("Add Event")); + TheTest.Next(_L("Add Event")); TestAddEventL(*client); theLog.Write(_L8("Test 6 OK\n")); - test.Next(_L("Get Event")); + TheTest.Next(_L("Get Event")); TestGetEventL(*client); theLog.Write(_L8("Test 7 OK\n")); - test.Next(_L("Change Event")); + TheTest.Next(_L("Change Event")); TestChangeEventL(*client); theLog.Write(_L8("Test 8 OK\n")); - test.Next(_L("Delete Event")); + TheTest.Next(_L("Delete Event")); TestDeleteEventL(*client); theLog.Write(_L8("Test 9 OK\n")); - test.Next(_L("Get Config")); + TheTest.Next(_L("Get Config")); TestGetConfigL(*client); theLog.Write(_L8("Test 10 OK\n")); - test.Next(_L("Change Config")); + TheTest.Next(_L("Change Config")); TestChangeConfigL(*client); theLog.Write(_L8("Test 11 OK\n")); - test.Next(_L("Get String")); + TheTest.Next(_L("Get String")); TestGetStringL(*client); theLog.Write(_L8("Test 12 OK\n")); - test.Next(_L("Clear Event Log")); + TheTest.Next(_L("Clear Event Log")); TestClearEventLogL(*client); theLog.Write(_L8("Test 13 OK\n")); #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM - test.Next(_L("Clear Event Log + SimId")); + TheTest.Next(_L("Clear Event Log + SimId")); TestClearEventLogL(*client, ETrue); theLog.Write(_L8("Test 14 OK\n")); #endif diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logfilter.cpp --- a/loggingservices/eventlogger/test/src/t_logfilter.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logfilter.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,16 +14,9 @@ // #include -#include "TEST.H" +#include "t_logutil2.h" -/* this fixes a MSVC link warning */ -#ifdef __VC32__ -#pragma comment (linker, "/opt:noref") -#endif - -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log Filter Test Harness")); +RTest TheTest(_L("t_logfilter")); /** @SYMTestCaseID SYSLIB-LOGENG-CT-0924 @@ -35,11 +28,8 @@ @SYMREQ REQ0000 */ LOCAL_C void TestFilterL() -// -// -// { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0924 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0924 ")); CLogFilter* filter1 = CLogFilter::NewL(); CleanupStack::PushL(filter1); @@ -244,11 +234,8 @@ @SYMREQ REQ0000 */ LOCAL_C void TestFilterWithHeapFailL() -// -// -// { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0925 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0925 ")); #ifdef _DEBUG TInt failCount = 0; #endif @@ -278,17 +265,14 @@ } void doTestsL() -// -// -// { - TestUtils::Initialize(_L("T_LOGFILTER")); + TestUtils::Initialize(_L("t_logfilter")); - test.Start(_L("Filter")); + TheTest.Start(_L("Filter")); TestFilterL(); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("Filter with heap failure")); + TheTest.Next(_L("Filter with heap failure")); TestFilterWithHeapFailL(); theLog.Write(_L8("Test 2 OK\n")); } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logheap.cpp --- a/loggingservices/eventlogger/test/src/t_logheap.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logheap.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,11 +15,9 @@ #include #include -#include "TEST.H" - -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log Client API Heap Failure Test Harness")); +#include "t_logutil2.h" + +RTest TheTest(_L("t_logheap")); const TUid KTestEventUid = {0x10005393}; _LIT(KTestEventDesc1, "Event Type Description"); @@ -66,7 +64,7 @@ */ LOCAL_C void TestStartup1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0884 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0884 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -108,7 +106,7 @@ } CleanupStack::PopAndDestroy(3); // client, active, event - test.Printf(_L("===CLogClient::ChangeEvent() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ChangeEvent() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -121,7 +119,7 @@ */ LOCAL_C void TestBasicL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0885 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0885 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -227,7 +225,7 @@ */ LOCAL_C void TestConstruction1L(TBool aCreateDb) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0886 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0886 ")); if(aCreateDb) { @@ -258,7 +256,7 @@ } delete client; - test.Printf(_L("==CLogClient::NewL()+\"%S\" client side OOM test succeeded at iteration %d\n"), aCreateDb ? &KCreateDb : &KOpenDb, failCount); + TheTest.Printf(_L("==CLogClient::NewL()+\"%S\" client side OOM test succeeded at iteration %d\n"), aCreateDb ? &KCreateDb : &KOpenDb, failCount); } /**s @@ -271,7 +269,7 @@ */ LOCAL_C void TestConstruction3L(TBool aCreateDb) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0887 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0887 ")); if(aCreateDb) { @@ -303,7 +301,7 @@ } delete client; - test.Printf(_L("==CLogClient::NewL()+\"%S\" server side OOM test succeeded at iteration %d\n"), aCreateDb ? &KCreateDb : &KOpenDb, failCount); + TheTest.Printf(_L("==CLogClient::NewL()+\"%S\" server side OOM test succeeded at iteration %d\n"), aCreateDb ? &KCreateDb : &KOpenDb, failCount); } /** @@ -317,7 +315,7 @@ */ LOCAL_C void TestAddEventType1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0888 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0888 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -371,7 +369,7 @@ TEST2(active->iStatus.Int(), KErrAlreadyExists); CleanupStack::PopAndDestroy(3, client); // active, type, client - test.Printf(_L("===CLogClient::AddEventType() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::AddEventType() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -386,7 +384,7 @@ */ LOCAL_C void TestAddEventType3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0889 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0889 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -441,7 +439,7 @@ TEST2(active->iStatus.Int(), KErrAlreadyExists); CleanupStack::PopAndDestroy(3, client); // active, type, client - test.Printf(_L("===CLogClient::AddEventType() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::AddEventType() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -455,7 +453,7 @@ */ LOCAL_C void TestGetEventType1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0890 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0890 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -496,7 +494,7 @@ TEST(type->LoggingEnabled()); CleanupStack::PopAndDestroy(3, client); // active, type, client - test.Printf(_L("===CLogClient::GetEventType() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::GetEventType() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -510,7 +508,7 @@ */ LOCAL_C void TestGetEventType3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0891 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0891 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -551,7 +549,7 @@ TEST(type->LoggingEnabled()); CleanupStack::PopAndDestroy(3, client); // active, type, client - test.Printf(_L("===CLogClient::GetEventType() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::GetEventType() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -565,7 +563,7 @@ */ LOCAL_C void TestChangeEventType1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0892 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0892 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -632,7 +630,7 @@ TEST(type->LoggingEnabled() == EFalse); CleanupStack::PopAndDestroy(3, client); // type, active, client - test.Printf(_L("===CLogClient::ChangeEventType() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ChangeEventType() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -646,7 +644,7 @@ */ LOCAL_C void TestChangeEventType3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0893 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0893 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -713,7 +711,7 @@ TEST(type->LoggingEnabled() == EFalse); CleanupStack::PopAndDestroy(3, client); // type, active, client - test.Printf(_L("===CLogClient::ChangeEventType() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ChangeEventType() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -728,7 +726,7 @@ */ LOCAL_C void TestDeleteEventType1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0894 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0894 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -779,7 +777,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(3, client); // type, active, client - test.Printf(_L("===CLogClient::DeleteEventType() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::DeleteEventType() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -794,7 +792,7 @@ */ LOCAL_C void TestDeleteEventType3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0895 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0895 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -846,7 +844,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(3, client); // type, active, client - test.Printf(_L("===CLogClient::DeleteEventType() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::DeleteEventType() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -860,7 +858,7 @@ */ LOCAL_C void TestAddEvent1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0896 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0896 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -933,7 +931,7 @@ TEST2(active->iStatus.Int(), KErrNone); CleanupStack::PopAndDestroy(4, client); // event, active, type, client - test.Printf(_L("===CLogClient::AddEvent() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::AddEvent() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -948,7 +946,7 @@ LOCAL_C void TestAddEvent3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0897 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0897 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1021,7 +1019,7 @@ TEST2(active->iStatus.Int(), KErrNone); CleanupStack::PopAndDestroy(4, client); // event, active, type, client - test.Printf(_L("===CLogClient::AddEvent() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::AddEvent() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1036,7 +1034,7 @@ */ LOCAL_C void TestGetEvent1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0898 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0898 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1084,7 +1082,7 @@ TEST(event->Data() == KTestData1); CleanupStack::PopAndDestroy(3, client); // event, active, client - test.Printf(_L("===CLogClient::AddEvent() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::AddEvent() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1098,7 +1096,7 @@ */ LOCAL_C void TestGetEvent3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0899 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0899 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1146,7 +1144,7 @@ TEST(event->Data() == KTestData1); CleanupStack::PopAndDestroy(3, client); // event, active, client - test.Printf(_L("===CLogClient::GetEvent() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::GetEvent() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1161,7 +1159,7 @@ */ LOCAL_C void TestChangeEvent3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0900 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0900 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1255,7 +1253,7 @@ TEST(event->Data() == KTestData2); CleanupStack::PopAndDestroy(3, client); // event, active, client - test.Printf(_L("===CLogClient::ChangeEvent() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ChangeEvent() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1269,7 +1267,7 @@ */ LOCAL_C void TestChangeEvent1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0901 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0901 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1363,7 +1361,7 @@ TEST(event->Data() == KTestData2); CleanupStack::PopAndDestroy(3, client); // event, active, client - test.Printf(_L("===CLogClient::ChangeEvent() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ChangeEvent() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1377,7 +1375,7 @@ */ LOCAL_C void TestDeleteEvent1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0902 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0902 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1431,7 +1429,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(3); // event, active, client - test.Printf(_L("===CLogClient::DeleteEvent() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::DeleteEvent() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1445,7 +1443,7 @@ */ LOCAL_C void TestDeleteEvent3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0903 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0903 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1499,7 +1497,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(3, client); // event, active, client - test.Printf(_L("===CLogClient::DeleteEvent() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::DeleteEvent() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1514,7 +1512,7 @@ */ LOCAL_C void TestGetConfig1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0904 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0904 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1552,7 +1550,7 @@ TEST(config.iMaxRecentLogSize > 0); CleanupStack::PopAndDestroy(2, client); // active, client - test.Printf(_L("===CLogClient::GetConfig() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::GetConfig() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1567,7 +1565,7 @@ */ LOCAL_C void TestGetConfig3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0905 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0905 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1605,7 +1603,7 @@ TEST(config.iMaxRecentLogSize > 0); CleanupStack::PopAndDestroy(2, client); // active, client - test.Printf(_L("===CLogClient::GetConfig() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::GetConfig() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1620,7 +1618,7 @@ */ LOCAL_C void TestChangeConfig1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0906 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0906 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1682,7 +1680,7 @@ TEST(config.iMaxEventAge == KTestMaxEventAge); CleanupStack::PopAndDestroy(2, client); // active, client - test.Printf(_L("===CLogClient::ChangeConfig() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ChangeConfig() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1697,7 +1695,7 @@ */ LOCAL_C void TestChangeConfig3L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0907 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0907 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1759,7 +1757,7 @@ TEST(config.iMaxEventAge == KTestMaxEventAge); CleanupStack::PopAndDestroy(2, client); // active, client - test.Printf(_L("===CLogClient::ChangeConfig() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ChangeConfig() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1773,7 +1771,7 @@ */ LOCAL_C void TestGetString1L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0908 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0908 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1804,7 +1802,7 @@ } } CleanupStack::PopAndDestroy(client); - test.Printf(_L("===CLogClient::GetString() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::GetString() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1819,7 +1817,7 @@ */ LOCAL_C void TestClearEventLog1L(TBool aMicroSeconds) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0909 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0909 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -1933,7 +1931,7 @@ client->GetEvent(*event1, active->iStatus); CActiveScheduler::Start(); if (active->iStatus != KErrNone) - RDebug::Print(_L("error code:%d failcoount:%d\n"),active->iStatus.Int(),failCount); + TheTest.Printf(_L("error code:%d failcoount:%d\n"),active->iStatus.Int(),failCount); TEST2(active->iStatus.Int(), KErrNone); active->StartL(); @@ -1967,7 +1965,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(6, client); // event4, event3, event2, event1, active, client - test.Printf(_L("===CLogClient::ClearLog() client side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ClearLog() client side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -1982,7 +1980,7 @@ */ LOCAL_C void TestClearEventLog3L(TBool aMicroSeconds) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0910 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0910 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -2129,7 +2127,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(6, client); // event4, event3, event2, event1, active, client - test.Printf(_L("===CLogClient::ClearLog() server side OOM test succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("===CLogClient::ClearLog() server side OOM test succeeded at iteration %d\n"), failCount); } /** @@ -2145,7 +2143,7 @@ */ LOCAL_C void TestDEF093601L(TBool aClientTest) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1910 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1910 ")); if(aClientTest) TestClearEventLog3L(EFalse); else @@ -2281,7 +2279,7 @@ TEST2(active->iStatus.Int(), KErrNotFound); CleanupStack::PopAndDestroy(4, client); //event2, event1, active, client - test.Printf(_L("===CLogClient::ClearLog() + SimId %S OOM test succeeded at iteration %d\n"), aServerSideOomTest ? &KServerSide : &KClientSide, failCount); + TheTest.Printf(_L("===CLogClient::ClearLog() + SimId %S OOM test succeeded at iteration %d\n"), aServerSideOomTest ? &KServerSide : &KClientSide, failCount); } /** @@ -2399,82 +2397,82 @@ TEST(!rc); CleanupStack::PopAndDestroy(5, client); //view, event2, event1, active, client - test.Printf(_L("===CLogClient::ClearLog()/Recent + SimId %S OOM test succeeded at iteration %d\n"), aServerSideOomTest ? &KServerSide : &KClientSide, failCount); + TheTest.Printf(_L("===CLogClient::ClearLog()/Recent + SimId %S OOM test succeeded at iteration %d\n"), aServerSideOomTest ? &KServerSide : &KClientSide, failCount); } #endif//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM LOCAL_C void doClientFailureL() { - test.Next(_L("Server startup")); + TheTest.Next(_L("Server startup")); TestStartup1L(); User::After(100000); - test.Next(_L("Construction + create logeng database")); + TheTest.Next(_L("Construction + create logeng database")); TestConstruction1L(ETrue); // Creates database - test.Next(_L("Construction + open logeng database")); + TheTest.Next(_L("Construction + open logeng database")); TestConstruction1L(EFalse); // Opens existing database TestUtils::DeleteDatabaseL(); theLog.Write(_L8("Test 1.1 OK\n")); - test.Next(_L("Add Event Type")); + TheTest.Next(_L("Add Event Type")); TestAddEventType1L(); theLog.Write(_L8("Test 1.2 OK\n")); - test.Next(_L("Get Event Type")); + TheTest.Next(_L("Get Event Type")); TestGetEventType1L(); theLog.Write(_L8("Test 1.3 OK\n")); - test.Next(_L("Change Event Type")); + TheTest.Next(_L("Change Event Type")); TestChangeEventType1L(); theLog.Write(_L8("Test 1.4 OK\n")); - test.Next(_L("Delete Event Type")); + TheTest.Next(_L("Delete Event Type")); TestDeleteEventType1L(); theLog.Write(_L8("Test 1.5 OK\n")); - test.Next(_L("Add Event")); + TheTest.Next(_L("Add Event")); TestAddEvent1L(); theLog.Write(_L8("Test 1.6 OK\n")); - test.Next(_L("Get Event")); + TheTest.Next(_L("Get Event")); TestGetEvent1L(); theLog.Write(_L8("Test 1.7 OK\n")); - test.Next(_L("Change Event")); + TheTest.Next(_L("Change Event")); TestChangeEvent1L(); theLog.Write(_L8("Test 1.8 OK\n")); - test.Next(_L("Delete Event")); + TheTest.Next(_L("Delete Event")); TestDeleteEvent1L(); theLog.Write(_L8("Test 1.9 OK\n")); - test.Next(_L("Get Config")); + TheTest.Next(_L("Get Config")); TestGetConfig1L(); theLog.Write(_L8("Test 1.10 OK\n")); - test.Next(_L("Change Config")); + TheTest.Next(_L("Change Config")); TestChangeConfig1L(); theLog.Write(_L8("Test 1.11 OK\n")); - test.Next(_L("Get String")); + TheTest.Next(_L("Get String")); TestGetString1L(); theLog.Write(_L8("Test 1.12 OK\n")); - test.Next(_L("Clear Event Log")); + TheTest.Next(_L("Clear Event Log")); TestClearEventLog1L(ETrue); theLog.Write(_L8("Test 1.13 OK\n")); - test.Next(_L("DEF093601")); + TheTest.Next(_L("DEF093601")); TestDEF093601L(EFalse); theLog.Write(_L8("Test 1.14 OK\n")); #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4038 Clear Event Log + SimId")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4038 Clear Event Log + SimId")); ClearLogSimIdOomTestL(EFalse); theLog.Write(_L8("Test 1.15 OK\n")); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4039 Clear Event Log/Recent + SimId")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4039 Clear Event Log/Recent + SimId")); ClearLogRecentSimIdOomTestL(EFalse); theLog.Write(_L8("Test 1.16 OK\n")); #endif @@ -2482,67 +2480,67 @@ LOCAL_C void doLogServFailureL() { - test.Next(_L("Construction + create logeng database")); + TheTest.Next(_L("Construction + create logeng database")); TestConstruction3L(ETrue); // Creates database - test.Next(_L("Construction + open logeng database")); + TheTest.Next(_L("Construction + open logeng database")); TestConstruction3L(EFalse); // Opens existing database TestUtils::DeleteDatabaseL(); theLog.Write(_L8("Test 2.1 OK\n")); - test.Next(_L("Add Event Type")); + TheTest.Next(_L("Add Event Type")); TestAddEventType3L(); theLog.Write(_L8("Test 2.2 OK\n")); - test.Next(_L("Get Event Type")); + TheTest.Next(_L("Get Event Type")); TestGetEventType3L(); theLog.Write(_L8("Test 2.3 OK\n")); - test.Next(_L("Change Event Type")); + TheTest.Next(_L("Change Event Type")); TestChangeEventType3L(); theLog.Write(_L8("Test 2.4 OK\n")); - test.Next(_L("Delete Event Type")); + TheTest.Next(_L("Delete Event Type")); TestDeleteEventType3L(); theLog.Write(_L8("Test 2.5 OK\n")); - test.Next(_L("Add Event")); + TheTest.Next(_L("Add Event")); TestAddEvent3L(); theLog.Write(_L8("Test 2.6 OK\n")); - test.Next(_L("Get Event")); + TheTest.Next(_L("Get Event")); TestGetEvent3L(); theLog.Write(_L8("Test 2.7 OK\n")); - test.Next(_L("Change Event")); + TheTest.Next(_L("Change Event")); TestChangeEvent3L(); theLog.Write(_L8("Test 2.8 OK\n")); - test.Next(_L("Delete Event")); + TheTest.Next(_L("Delete Event")); TestDeleteEvent3L(); theLog.Write(_L8("Test 2.9 OK\n")); - test.Next(_L("Get Config")); + TheTest.Next(_L("Get Config")); TestGetConfig3L(); theLog.Write(_L8("Test 2.10 OK\n")); - test.Next(_L("Change Config")); + TheTest.Next(_L("Change Config")); TestChangeConfig3L(); theLog.Write(_L8("Test 2.11 OK\n")); - test.Next(_L("Clear Event Log")); + TheTest.Next(_L("Clear Event Log")); TestClearEventLog3L(ETrue); theLog.Write(_L8("Test 2.12 OK\n")); - test.Next(_L("DEF093601")); + TheTest.Next(_L("DEF093601")); TestDEF093601L(ETrue); theLog.Write(_L8("Test 2.13 OK\n")); #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4038 Clear Event Log + SimId")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4038 Clear Event Log + SimId")); ClearLogSimIdOomTestL(ETrue); theLog.Write(_L8("Test 2.14 OK\n")); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4039 Clear Event Log/Recent + SimId")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4039 Clear Event Log/Recent + SimId")); ClearLogRecentSimIdOomTestL(ETrue); theLog.Write(_L8("Test 2.15 OK\n")); #endif @@ -2550,11 +2548,11 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGHEAP")); - - test.Start(_L("Log Client")); + TestUtils::Initialize(_L("t_logheap")); + + TheTest.Start(_L("Log Client")); doClientFailureL(); - test.Next(_L("Log Server")); + TheTest.Next(_L("Log Server")); doLogServFailureL(); } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_loghicaphelper.cpp --- a/loggingservices/eventlogger/test/src/t_loghicaphelper.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_loghicaphelper.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -24,7 +24,7 @@ #include #include #include -#include "TEST.H" +#include "t_logutil2.h" const TUid KTestEventUid = {0x10005393}; _LIT(KTestEventDesc1, "Event Type Description"); @@ -44,39 +44,13 @@ _LIT(KLogHiCapHelperPanic, "TLHCHlpr"); +RTest TheTest(_L("t_loghicaphelper")); //used in t_logutil.cpp only + RFs theFs; CActiveScheduler *TheTestScheduler = NULL; //=========================================================================================== -static TPtrC FileName(const TText* aFile) - { - TPtrC p(aFile); - TInt ix=p.LocateReverse('\\'); - if (ix<0) - ix=p.LocateReverse('/'); - if (ix>=0) - p.Set(p.Mid(1+ix)); - return p; - } - -void LogLeave(TInt aErr, const TText* aFile, TInt aLine) - { - TPtrC fname(FileName(aFile)); - RDebug::Print(_L("*** LogEng test leave, err=%d, file: %S-%d\r\n"), aErr, &fname, aLine); - User::Leave(aErr); - } - -#undef TEST_STRING -#define TEST_STRING(s) _S(s) - -#undef LEAVE -#undef LEAVE_IF_ERROR -#define LEAVE(err) LogLeave(err, TEST_STRING(__FILE__), __LINE__) -#define LEAVE_IF_ERROR(err) (err < KErrNone ? LogLeave(err, TEST_STRING(__FILE__), __LINE__) : void(0)) - -//=========================================================================================== - //Supported remote operaions enum THelperOp { @@ -690,7 +664,7 @@ { __UHEAP_MARK; - Initialize(_L("T_HICAPHELPER")); + Initialize(_L("t_loghicaphelper")); CTrapCleanup* tc = CTrapCleanup::New(); if(!tc) diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logmaxnumlen.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/src/t_logmaxnumlen.cpp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,242 @@ +// Copyright (c) 2005-2010 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: +// test code for INC041118 - Numberfield in logdatabase/engine is too small +// +// + +#include +#include +#include +#include "t_logutil2.h" + +RTest TheTest(_L("t_logmaxnumlen")); + +_LIT(KTestEventDesc1, "Event Type Description"); +_LIT(KTestRemoteParty1, "Remote Party"); +_LIT(KTestDirection1, "Direction"); +_LIT(KTestStatus1, "Status"); +_LIT(KTestSubject1, "Subject"); + + +// These values are stored in "oldLogdb.dat" +_LIT(KTestEvent0, "00000"); +_LIT(KTestEvent1, "11111"); +_LIT(KTestEvent2, "22222"); + +const TUid KTestEventUid = {0x10005393}; +const TLogDurationType KTestDurationType1 = 1; +const TLogDuration KTestDuration1 = 0x1234; +const TLogContactItemId KTestContact1 = 0x1234; +const TLogLink KTestLink1 = 0x1234; +_LIT8(KTestData1, "ABCDEFGH"); +const TLogFlags KTestFlags1 = 0x5; + + +// with this value the test will ONLY pass with the new database +_LIT(KTestNumberMax, + "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"); + +// This test needs a number > 32 to check that database has been converted +_LIT(KTestNumber50, "01234567890123456789012345678901234567890123456789"); +_LIT(KTestNumberMin, "0"); + +// this coresponds to an event already stored in oldLogDb.dat +const TInt KoldId = 3; +_LIT(KTestOldDbNumber, "012345678901234567"); + + +/** +@SYMTestCaseID SYSLIB-LOGENG-CT-1336 +@SYMTestCaseDesc Tests for adding events to the log engine database +@SYMTestPriority High +@SYMTestActions Check for event ID assigned by log engine +@SYMTestExpectedResults Test must not fail +@SYMREQ REQ0000 +*/ +TInt TestAddEventL(CLogClient& aClient, const TDesC &aNumber) + { + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1336 ")); + TInt returnId = KLogNullId; + + CTestActive* active = new(ELeave)CTestActive(); + CleanupStack::PushL(active); + + // create a new event + CLogEvent* event = CLogEvent::NewL(); + CleanupStack::PushL(event); + + // Reset + TTime now; + now.UniversalTime(); + + // load the event with test values + event->SetEventType(KTestEventUid); + event->SetRemoteParty(KTestRemoteParty1); + event->SetDirection(KTestDirection1); + event->SetDurationType(KTestDurationType1); + event->SetDuration(KTestDuration1); + event->SetStatus(KTestStatus1); + event->SetSubject(KTestSubject1); + event->SetNumber(aNumber); + event->SetContact(KTestContact1); + event->SetLink(KTestLink1); + event->SetDataL(KTestData1); + event->SetFlags(KTestFlags1); + + // add the event to the logeng database + active->StartL(); + aClient.AddEvent(*event, active->iStatus); + + CActiveScheduler::Start(); + TEST(!active->IsActive()); + aClient.Cancel(); + TEST2(active->iStatus.Int(), KErrNone); + + // check that an ID has been assigned + returnId = event->Id(); + TEST(returnId != KLogNullId); + + TEST(event->Time() >= now); + TEST(event->Description() == KTestEventDesc1); + + CleanupStack::PopAndDestroy(2); // event, active + + // return the event id which has been assigned by the + // log engine + return returnId; + } + +/** +@SYMTestCaseID SYSLIB-LOGENG-CT-1337 +@SYMTestCaseDesc Tests for getting the event from the log engine database +@SYMTestPriority High +@SYMTestActions Tests for CLogClient::GetEvent() function +@SYMTestExpectedResults Test must not fail +@SYMREQ REQ0000 +*/ +void TestGetEventL(CLogClient& aClient, TInt aTheId, const TDesC& aNumber) + + { + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1337 ")); + CTestActive* active = new(ELeave)CTestActive(); + CleanupStack::PushL(active); + + CLogEvent* event = CLogEvent::NewL(); + CleanupStack::PushL(event); + + // set the id of the event to be fetched + event->SetId(aTheId); + + active->StartL(); + aClient.GetEvent(*event, active->iStatus); + CActiveScheduler::Start(); + aClient.Cancel(); + TEST2(active->iStatus.Int(), KErrNone); + + TEST(event->Id() == aTheId); + TEST(event->Time() > TTime(0)); + TEST(event->Description() == KTestEventDesc1); + TEST(event->EventType() == KTestEventUid); + TEST(event->RemoteParty() == KTestRemoteParty1); + TEST(event->Direction() == KTestDirection1); + TEST(event->DurationType() == KTestDurationType1); + TEST(event->Duration() == KTestDuration1); + TEST(event->Status() == KTestStatus1); + TEST(event->Subject() == KTestSubject1); + TEST(event->Contact() == KTestContact1); + TEST(event->Link() == KTestLink1); + TEST(event->Data() == KTestData1); + TEST(event->Flags() == KTestFlags1); + + // this is the important test + // check the number has not been truncated + TEST(event->Number() == aNumber); + + TPtrC eventStatus = event->Subject(); + TPtrC eventNumber = event->Number(); + TheTest.Printf(_L("Id:%d No:%S Sub:%S Con:0x%x \n"), + event->Id(), &eventNumber, &eventStatus, event->Contact()); + + CleanupStack::PopAndDestroy(2); // event, active + } + + +/** +Test code for INC041118 - Numberfield in logdatabase/engine is too small +This is the main part of the test + +@SYMTestCaseID SYSLIB-LOGENG-CT-1019 +@SYMTestCaseDesc Tests for number field in logdatabase/engine is too small +@SYMTestPriority High +@SYMTestActions Add an event to the log engine database.When the database is opened it should be + converted to new format.Check by reading the event and checking the number length + Check with maximum and minimum number field +@SYMTestExpectedResults Test must not fail +@SYMREQ REQ0000 +*/ +void TestStartupL() + { + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1019 ")); + TestUtils::CopyOldDbL(); + + // add an event to the log engine database. + // When the database is opened it should be checked for the old numberfield length + // and converted to the new format if required. (It will be required, as old db has been copied) + CLogClient* client = CLogClient::NewL(theFs); + CleanupStack::PushL(client); + User::After(1000000); + TheTest.Next(_L("check database conversion")); + TInt eventId = TestAddEventL(*client, KTestNumber50 ); + + // check that the database has been converted to the new format + // by reading back an event the checking that number is the + // correct length + TestGetEventL(*client, eventId, KTestNumber50); + + // check using Max + TheTest.Next(_L("check a maxium length number")); + eventId = TestAddEventL(*client, KTestNumberMax ); + TestGetEventL(*client, eventId, KTestNumberMax); + + // check using Min + TheTest.Next(_L("check a mimium length number")); + eventId = TestAddEventL(*client, KTestNumberMin ); + TestGetEventL(*client, eventId, KTestNumberMin); + + // When OldLogdbu.dat was created, using TestBuildTestDbL() below, + // 4 events were stored. Check that these can still be accessed. + // Note: There was a problem here with old events being purged after 30 days + // This was fixed by setting TLogConfig::iMaxEventAge = 0 in OldLogdb.dat + TheTest.Next(_L("check all events in the old database")); + TestGetEventL(*client, 0, KTestEvent0); + TestGetEventL(*client, 1, KTestEvent1); + TestGetEventL(*client, 2, KTestEvent2); + TestGetEventL(*client, KoldId, KTestOldDbNumber); + + CleanupStack::PopAndDestroy(); // client + } + +// Test code for INC041118 - Numberfield in logdatabase/engine is too small +void doTestsL() + { + TestUtils::Initialize(_L("t_logmaxnumlen")); +#ifdef _DEBUG + TheTest.Start(_L("T_MaxNumberLength Set/Check Phone Number Maximum Length")); + + TestStartupL(); + theLog.Write(_L8("Test T_MAXNUMBERLENGTH OK\n")); +#else + TheTest.Start(_L("This test works only in debug mode, otherwise the LogEng server cannot be stopped. See TestUtils::CopyOldDbL()")); +#endif//_DEBUG + } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_lognotify.cpp --- a/loggingservices/eventlogger/test/src/t_lognotify.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_lognotify.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -13,12 +13,10 @@ // Description: // -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log Change Notification Test Harness")); +RTest TheTest(_L("t_lognotify")); _LIT(KTestRemoteParty1, "Remote Party"); _LIT(KTestDirection1, "Direction"); @@ -43,7 +41,7 @@ */ LOCAL_C void TestNotificationL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0926 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0926 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -200,7 +198,7 @@ */ LOCAL_C void TestCancelNotificationL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0927 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0927 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -321,7 +319,7 @@ */ LOCAL_C void TestViewPurgeNotifyL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0928 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0928 ")); CTestTimer* timer = CTestTimer::NewL(); CleanupStack::PushL(timer); @@ -388,7 +386,7 @@ */ LOCAL_C void INC045485L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0929 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0929 ")); const TInt KEventCnt = 5;//test events count const TInt KSizeOfEventData = 400;//should be bigger than KLogSizeOfEventGuess constant //Create client, active, event @@ -437,7 +435,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone);//If the defect is not fixed this check fails with "KErrOverflow" const CLogEvent& e = view->Event(); - RDebug::Print(_L("View Entry[%d]: Id:%d, Type:%x\n"), j, e.Id(), e.EventType().iUid); + TheTest.Printf(_L("View Entry[%d]: Id:%d, Type:%x\n"), j, e.Id(), e.EventType().iUid); const TDesC8& data = e.Data(); TEST(data.Length() == KSizeOfEventData); //Touch the data. @@ -520,7 +518,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); const CLogEvent& e = view->Event(); - RDebug::Print(_L("View Entry[%d]: Id:%d, Type:%x\n"), j, e.Id(), e.EventType().iUid); + TheTest.Printf(_L("View Entry[%d]: Id:%d, Type:%x\n"), j, e.Id(), e.EventType().iUid); const TDesC8& data = e.Data(); TEST(data.Length() == KSizeOfEventData); //Touch the data. @@ -543,24 +541,24 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGNOTIFY")); + TestUtils::Initialize(_L("t_lognotify")); TestUtils::DeleteDatabaseL(); - test.Start(_L("Notifications")); + TheTest.Start(_L("Notifications")); TestNotificationL(); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("INC045485")); + TheTest.Next(_L("INC045485")); ::INC045485L(); - test.Next(_L("Cancelling Notifications")); + TheTest.Next(_L("Cancelling Notifications")); TestCancelNotificationL(); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("Notify with View Purge")); + TheTest.Next(_L("Notify with View Purge")); TestViewPurgeNotifyL(); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("DEF060381")); + TheTest.Next(_L("DEF060381")); ::DEF060381L(); } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logorderbyid.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/src/t_logorderbyid.cpp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,221 @@ +// Copyright (c) 2004-2010 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: +// test code for INC045441 - Log Engine does not return events in sequence order +// +// + +#include +#include +#include +#include "t_logutil2.h" + +RTest TheTest(_L("t_logorderbyid")); + +_LIT( KTestNumber1, "11111" ); +_LIT( KTestNumber2, "22222" ); +_LIT( KTestNumber3, "33333" ); + +/** +Add an event to the log engine database. +The event ID assigned by logengine is store in gTheId + +@param aClient +@param aNumber The number that the event should contain +@return The index for the event added. + +*/ +LOCAL_C TInt AddEventL( CLogClient& aClient, CLogEvent& aEvent, CTestActive& aActive, TInt aIndex ) + { + TInt returnId = KLogNullId; + + // Reset + TTime now; + now.UniversalTime(); + + aEvent.SetContact( aIndex ); + + // load the event with test values + switch (aIndex) + { + case 1: + aEvent.SetNumber( KTestNumber1 ); + break; + case 2: + aEvent.SetNumber( KTestNumber2 ); + break; + case 3: + aEvent.SetNumber( KTestNumber3 ); + break; + } + + // add the event to the logeng database + aActive.StartL(); + aClient.AddEvent( aEvent, aActive.iStatus ); + CActiveScheduler::Start(); + TEST2(aActive.iStatus.Int(), KErrNone); + + // check that an ID has been assigned + returnId = aEvent.Id(); + TEST( returnId != KLogNullId ); + TEST( aEvent.Time() >= now ); + + // return the event id which has been assigned by the + // log engine + return returnId; + } + + +/** +Get the event from the log engine database. + +@param aClient +@param aTheId Unique id for the event to be fetch +@param aNumber The number that the event should contain +*/ +LOCAL_C void TestGetEventL( CLogClient& aClient, TInt aTheId, TInt aIndex ) + + { + CTestActive* active = new( ELeave )CTestActive(); + CleanupStack::PushL( active ); + + CLogEvent* event = CLogEvent::NewL(); + CleanupStack::PushL( event ); + + event->SetId( aTheId ); + + active->StartL(); + aClient.GetEvent( *event, active->iStatus ); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + + // check we got the right one back + TEST( event->Contact() == aIndex ); + + TPtrC eventNumber = event->Number(); + + TBuf<30> dateString; + _LIT( KDateString5, "%-B%:0%J%:1%T%:2%S%:3%+B" ); + event->Time().FormatL( dateString, KDateString5 ); + TPtrC eventDate = dateString.Ptr(); + TheTest.Printf( _L( "Id:%d No:%S Time:%S \n" ), event->Id(), &eventNumber, &eventDate ); + + CleanupStack::PopAndDestroy( 2 ); // event, active + } + +/** +Test code for INC045441 - Log Engine does not return events in sequence order + +@SYMTestCaseID SYSLIB-LOGENG-CT-1020 +@SYMTestCaseDesc Tests for checking the sequence order on events returned by log engine +@SYMTestPriority High +@SYMTestActions Test for getting the event in order as they were added to the log + Check for memory and no error +@SYMTestExpectedResults Test must not fail +@SYMREQ REQ0000 +*/ +LOCAL_C void TestRecentViewOrderingL( CLogClient& aClient ) +// +// +// + { + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1020 ")); + CLogEvent* event = CLogEvent::NewL(); + CleanupStack::PushL(event); + + CTestActive* active = new( ELeave )CTestActive(); + CleanupStack::PushL( active ); + + CLogViewRecent* view = CLogViewRecent::NewL( aClient ); + CleanupStack::PushL( view ); + + TBuf buf; + aClient.GetString(buf, R_LOG_DIR_MISSED); + + event->SetEventType( KLogCallEventTypeUid ); + event->SetDirection( buf ); + + TEST( !view->SetRecentListL( KLogRecentMissedCalls, active->iStatus ) ); + TEST( view->CountL() == 0 ); + + TTime time; + TheTest.Next( _L( "add new event 1" ) ); + TInt eventId1 = AddEventL( aClient, *event, *active, 1 ); + TestGetEventL( aClient, eventId1, 1 ); + + TheTest.Next( _L( "time plus 10 mins - add new event 2" ) ); + time.HomeTime(); + TTimeIntervalMinutes timeTravelForward( 10 ); + time += timeTravelForward; + User::SetHomeTime( time ); + TInt eventId2 = AddEventL( aClient, *event, *active, 2 ); + TestGetEventL( aClient, eventId2, 2 ); + + TheTest.Next( _L( "time minus 5 mins - add new event 3" ) ); + time.HomeTime(); + TTimeIntervalMinutes timeTravelBackward( 5 ); + time -= timeTravelBackward; + User::SetHomeTime( time ); + TInt eventId3 = AddEventL( aClient, *event, *active, 3 ); + TestGetEventL( aClient, eventId3, 3 ); + + TEST( view->CountL() == 3 ); + + active->StartL(); + // Get most recent + TEST( view->FirstL( active->iStatus ) ); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + + TInt id3 = view->Event().Id(); + // Get the one before that + active->StartL(); + TEST( view->NextL( active->iStatus ) ); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TInt id2 = view->Event().Id(); + + // Get the one before that + active->StartL(); + TEST( view->NextL( active->iStatus ) ); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TInt id1 = view->Event().Id(); + + TEST( id1 == eventId1 ); + TEST( id2 == eventId2 ); + TEST( id3 == eventId3 ); + + CleanupStack::PopAndDestroy( 3 ); // view, active, event + theLog.Write( _L8( "Test 1.1 OK\n" ) ); + } + + + +void doTestsL() + { + TestUtils::Initialize(_L("t_logorderbyid")); + TestUtils::DeleteDatabaseL(); + + CLogClient* client = CLogClient::NewL( theFs ); + CleanupStack::PushL( client ); + + CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); + CleanupStack::PushL( notifier ); + + TheTest.Start( _L( "Recent view sorts by Id not ETime" ) ); + TestRecentViewOrderingL( *client ); + theLog.Write( _L8( "Test 1 OK\n" ) ); + + CleanupStack::PopAndDestroy( 2 ); // notifier, client; + } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logplatformsecurity.cpp --- a/loggingservices/eventlogger/test/src/t_logplatformsecurity.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logplatformsecurity.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,5 +1,5 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -17,15 +17,19 @@ #include #include -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log Client Platform Security Test Harness")); - -// If LOWCAP is defined in the .mmp file 'TheHiCapability' will be set to false. -TBool TheHiCapability = ETrue; +//LOWCAP defined in t_loglowcapability.mmp file. +#ifdef LOWCAP + TBool TheHiCapability = EFalse; + RTest TheTest(_L("t_loglowcapability")); + _LIT(KTestTitle, "t_loglowcapability"); +#else + TBool TheHiCapability = ETrue; + RTest TheTest(_L("t_loghicapability")); + _LIT(KTestTitle, "t_loghicapability"); +#endif const TUid KTestEventUid = {0x10005393}; _LIT(KTestEventDesc1, "Event Type Description"); @@ -60,7 +64,7 @@ */ LOCAL_C void TestStartupL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0118 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0118 ")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); @@ -105,7 +109,7 @@ */ LOCAL_C void TestBasicL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0119 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0119 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -150,7 +154,7 @@ active->StartL(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); - test.Printf(_L("TestBasicL(), TheHiCapability=%d, event id=%d\r\n"), TheHiCapability, id); + TheTest.Printf(_L("TestBasicL(), TheHiCapability=%d, event id=%d\r\n"), TheHiCapability, id); TEST2(active->iStatus.Int(), TheHiCapability ? KErrNone : KErrPermissionDenied); TEST(event->Id() == id ); @@ -248,7 +252,7 @@ */ LOCAL_C void TestAddEventTypeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0120 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0120 ")); CLogEventType* type = CLogEventType::NewL(); CleanupStack::PushL(type); @@ -295,7 +299,7 @@ // GetEventType is not policed. // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0121 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0121 ")); CLogEventType* type = CLogEventType::NewL(); CleanupStack::PushL(type); @@ -329,7 +333,7 @@ */ LOCAL_C void TestChangeEventTypeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0122 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0122 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -424,7 +428,7 @@ */ LOCAL_C void TestDeleteEventTypeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0123 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0123 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -494,7 +498,7 @@ */ LOCAL_C void TestDeleteBuiltInEventTypeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0124 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0124 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -540,7 +544,7 @@ */ LOCAL_C void TestGetConfigL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0125 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0125 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -592,7 +596,7 @@ */ LOCAL_C void TestChangeConfigL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0126 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0126 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -683,7 +687,7 @@ */ void ClearLogL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0127 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0127 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -709,7 +713,7 @@ */ void ClearRecentListL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0128 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0128 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -807,7 +811,7 @@ // It deletes the database, then... // adds 8 events - 2 are visible to clients with no capabilities // and 6 are of type KLogCallEventTypeUid, which is protected. - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0129 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0129 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -885,7 +889,7 @@ */ LOCAL_C void TestRecentViewL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0130 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0130 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -917,31 +921,25 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGENGSECURITY")); - -#ifdef LOWCAP // defined in mmp file - TheHiCapability = EFalse; -#else - TheHiCapability = ETrue; -#endif + TestUtils::Initialize(KTestTitle); - test.Start(_L("Starting tests...")); + TheTest.Start(_L("Starting tests...")); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); TestUtils::DeleteDatabaseL(); - test.Start(_L("Server startup")); + TheTest.Next(_L("Server startup")); TestStartupL(); User::After(100000); - test.Next(_L("Test Add, Get, Change & Delete event")); + TheTest.Next(_L("Test Add, Get, Change & Delete event")); TestUtils::DeleteDatabaseL(); TestBasicL(*client); theLog.Write(_L8("Basic tests OK\n")); - test.Next(_L("Add Event Type")); + TheTest.Next(_L("Add Event Type")); TestAddEventTypeL(*client); theLog.Write(_L8("Add Event Type test OK\n")); @@ -952,46 +950,46 @@ TestUtils::AddEventTypeL(); } - test.Next(_L("Get Event Type")); + TheTest.Next(_L("Get Event Type")); TestGetEventTypeL(*client); theLog.Write(_L8("Get Event Type test OK\n")); - test.Next(_L("Change Event Type")); + TheTest.Next(_L("Change Event Type")); TestChangeEventTypeL(*client); theLog.Write(_L8("Change Event Type test OK\n")); - test.Next(_L("Delete Event Type")); + TheTest.Next(_L("Delete Event Type")); TestDeleteEventTypeL(*client); theLog.Write(_L8("Delete Event Type test OK\n")); - test.Next(_L("Delete Built-in Event Type")); + TheTest.Next(_L("Delete Built-in Event Type")); TestDeleteBuiltInEventTypeL(*client); theLog.Write(_L8("Delete Built-in Event Type test OK\n")); - test.Next(_L("Get Server Configuration")); + TheTest.Next(_L("Get Server Configuration")); TestGetConfigL(*client); theLog.Write(_L8("Get Server Configuration test OK\n")); - test.Next(_L("Change Server Configuration")); + TheTest.Next(_L("Change Server Configuration")); TestChangeConfigL(*client); theLog.Write(_L8("Change Server Configuration test OK\n")); - test.Next(_L("Clear the Log test")); + TheTest.Next(_L("Clear the Log test")); ClearLogL(*client); theLog.Write(_L8("Clear the Log test OK\n")); - test.Next(_L("Clear Recent List test")); + TheTest.Next(_L("Clear Recent List test")); ClearRecentListL(*client); theLog.Write(_L8("Clear Recent List test OK\n")); #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM const TSimId KSimId = 4000000000U; - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4040 Clear the \"Log + SimId\" test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4040 Clear the \"Log + SimId\" test")); ClearLogL(*client, KSimId); theLog.Write(_L8("Clear the \"Log + SimId\" test OK\n")); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4041 Clear \"Recent List + SimId\" test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4041 Clear \"Recent List + SimId\" test")); ClearRecentListL(*client, KSimId); theLog.Write(_L8("Clear \"Recent List + SimId\" test OK\n")); #endif @@ -1006,16 +1004,15 @@ // and 6 are of type KLogCallEventTypeUid, which is protected. TestUtils::AddViewTestEventsL(); - test.Next(_L("Event View with Filter list")); + TheTest.Next(_L("Event View with Filter list")); TestEventViewWithFilterL(*client); theLog.Write(_L8("Event View with Filter list test OK\n")); - test.Next(_L("Recent View")); + TheTest.Next(_L("Recent View")); TestRecentViewL(*client); theLog.Write(_L8("Recent View test OK\n")); TestUtils::DeleteDatabaseL(); // ready for next test - test.End(); CleanupStack::PopAndDestroy(); // client } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logpurge.cpp --- a/loggingservices/eventlogger/test/src/t_logpurge.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logpurge.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2003-2010 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" @@ -14,12 +14,10 @@ // #include -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log Purge Test Harness")); +RTest TheTest(_L("t_logpurge")); const TInt KTestEventNum = 10; const TInt KTestEventAge = 5; @@ -42,7 +40,7 @@ */ LOCAL_C void TestMaxLogSizeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0875 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0875 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); @@ -198,7 +196,7 @@ */ LOCAL_C void TestMaxLogSizeConfigL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0876 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0876 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); @@ -296,7 +294,7 @@ */ LOCAL_C void TestMaxLogAgeL(CLogClient& aClient, TLogAge aMaxLogAge) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0877 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0877 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); @@ -398,7 +396,7 @@ */ LOCAL_C void TestMaxRecentSize1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0878 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0878 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -519,7 +517,7 @@ */ LOCAL_C void TestMaxRecentSizeConfigL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0879 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0879 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -623,7 +621,7 @@ */ LOCAL_C void TestMaxRecentSize2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0880 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0880 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -753,7 +751,7 @@ */ LOCAL_C void TestNoPurgeWithGetL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0881 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0881 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); @@ -834,7 +832,7 @@ */ LOCAL_C void TestClearLog1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0882 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0882 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); @@ -916,7 +914,7 @@ */ LOCAL_C void TestClearLog2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0883 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0883 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); @@ -1255,52 +1253,52 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGPURGE")); + TestUtils::Initialize(_L("t_logpurge")); TestUtils::DeleteDatabaseL(); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); - test.Start(_L("Maximum Log Size")); + TheTest.Start(_L("Maximum Log Size")); TestMaxLogSizeL(*client); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("Purge Log When Config Changed")); + TheTest.Next(_L("Purge Log When Config Changed")); TestMaxLogSizeConfigL(*client); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("Test purge by Maximum Log Age enabled/disabled")); + TheTest.Next(_L("Test purge by Maximum Log Age enabled/disabled")); TestMaxLogAgeL(*client, 0); // disable purging by age TestMaxLogAgeL(*client, KTestEventAge * 60 * 60 * 24); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Maximum Recent List Size")); + TheTest.Next(_L("Maximum Recent List Size")); TestMaxRecentSize1L(*client); theLog.Write(_L8("Test 4 OK\n")); - test.Next(_L("Purge Recent Lists When Config Changed")); + TheTest.Next(_L("Purge Recent Lists When Config Changed")); TestMaxRecentSizeConfigL(*client); theLog.Write(_L8("Test 5 OK\n")); - test.Next(_L("Maximum Recent List Size With Duplicates")); + TheTest.Next(_L("Maximum Recent List Size With Duplicates")); TestMaxRecentSize2L(*client); theLog.Write(_L8("Test 6 OK\n")); - test.Next(_L("Check no purge when retrieving event")); + TheTest.Next(_L("Check no purge when retrieving event")); TestNoPurgeWithGetL(*client); theLog.Write(_L8("Test 7 OK\n")); - test.Next(_L("Check ClearLog works for different locales")); + TheTest.Next(_L("Check ClearLog works for different locales")); TestClearLog1L(*client); TestClearLog2L(*client); theLog.Write(_L8("Test 8 OK\n")); #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4036 CLogClient::ClearLog() + SimId test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4036 CLogClient::ClearLog() + SimId test")); ClearLogSimIdL(*client); theLog.Write(_L8("Test 9 OK\n")); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4037 CLogClient::ClearLog()/recent + SimId test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4037 CLogClient::ClearLog()/recent + SimId test")); ClearLogRecentSimIdL(*client); theLog.Write(_L8("Test 10 OK\n")); #endif diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logsecureview.cpp --- a/loggingservices/eventlogger/test/src/t_logsecureview.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logsecureview.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -13,22 +13,20 @@ // Description: // -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - #define PRECONDITION_TRUE(x) TEST((x)) #define PRECONDITION_EQ(x,y) TEST2((x),(y)) // If LOWCAP is defined in the .mmp file 'hiCapabilityTest' will be set to FALSE. #ifdef LOWCAP TBool hiCapabilityTest = EFalse; - RTest test(_L("Log Client Low Capability Secure View Test")); + RTest TheTest(_L("t_logsecureview_lowcap")); _LIT(KTestTitle, "t_logsecureview (low capability)"); #else TBool hiCapabilityTest = ETrue; - RTest test(_L("Log Client High Capability Secure View Test")); + RTest TheTest(_L("t_logsecureview_hicap")); _LIT(KTestTitle, "t_logsecureview (high capability)"); #endif @@ -43,7 +41,7 @@ */ LOCAL_C void TestDuplicateRemoveIdL(CLogViewDuplicate* aView) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0135 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0135 ")); TLogId id = aView->Event().Id(); TRAPD(error, aView->RemoveL(id)); @@ -69,7 +67,7 @@ */ LOCAL_C void TestDuplicateRemoveCurrentL(CLogViewDuplicate* aView, CTestActive* aTestActive) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0136 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0136 ")); aTestActive->StartL(); PRECONDITION_TRUE(aView->FirstL(aTestActive->iStatus)); CActiveScheduler::Start(); @@ -103,7 +101,7 @@ */ LOCAL_C void TestRecentClearDuplicatesL(CLogViewRecent* aRecentView, CLogViewDuplicate* aDuplicateView) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0137 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0137 ")); TRAPD(error, aRecentView->ClearDuplicatesL()); if(hiCapabilityTest) @@ -128,7 +126,7 @@ */ LOCAL_C void TestRecentRemoveIdL(CLogViewRecent* aView) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0138 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0138 ")); TLogId id = aView->Event().Id(); TRAPD(error, aView->RemoveL(id)); @@ -154,7 +152,7 @@ */ LOCAL_C void TestRecentRemoveCurrentL(CLogViewRecent* aView, CTestActive* aTestActive) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0139 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0139 ")); aTestActive->StartL(); PRECONDITION_TRUE(aView->FirstL(aTestActive->iStatus)); CActiveScheduler::Start(); @@ -200,19 +198,19 @@ PRECONDITION_EQ(testActive->iStatus.Int(), KErrNone); PRECONDITION_EQ(duplicateView->CountL(), 4); - test.Start(_L("RemoveL on duplicate view with id as argument")); + TheTest.Start(_L("RemoveL on duplicate view with id as argument")); TestDuplicateRemoveIdL(duplicateView); - test.Next(_L("RemoveL on duplicate view at current cursor position")); + TheTest.Next(_L("RemoveL on duplicate view at current cursor position")); TestDuplicateRemoveCurrentL(duplicateView, testActive); - test.Next(_L("ClearDuplicatesL on recent view")); + TheTest.Next(_L("ClearDuplicatesL on recent view")); TestRecentClearDuplicatesL(recentView, duplicateView); - test.Next(_L("RemoveL on recent view with id as argument")); + TheTest.Next(_L("RemoveL on recent view with id as argument")); TestRecentRemoveIdL(recentView); - test.Next(_L("RemoveL on recent view at current cursor position")); + TheTest.Next(_L("RemoveL on recent view at current cursor position")); TestRecentRemoveCurrentL(recentView, testActive); CleanupStack::PopAndDestroy(4); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logservIPC.cpp --- a/loggingservices/eventlogger/test/src/t_logservIPC.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logservIPC.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -19,64 +19,13 @@ #include "LogCliServShared.h" #include "logservpanic.h" #include "logpackage.h" +#include "t_logutil.h" -LOCAL_D RTest TheTest(_L("T_LogServIPC")); +RTest TheTest(_L("t_logservipc")); _LIT(KServerName, "!LogServ"); _LIT(KServerProcess, "LogServ"); -//=========================================================================================== - -static TPtrC FileName(const TText* aFile) - { - TPtrC p(aFile); - TInt ix=p.LocateReverse('\\'); - if (ix<0) - ix=p.LocateReverse('/'); - if (ix>=0) - p.Set(p.Mid(1+ix)); - return p; - } - -void LogLeave(TInt aErr, const TText* aFile, TInt aLine) - { - TPtrC fname(FileName(aFile)); - RDebug::Print(_L("*** LogEng test leave, err=%d, file: %S-%d\r\n"), aErr, &fname, aLine); - User::Leave(aErr); - } - -#undef TEST_STRING -#define TEST_STRING(s) _S(s) - -#undef LEAVE -#undef LEAVE_IF_ERROR -#define LEAVE(err) LogLeave(err, TEST_STRING(__FILE__), __LINE__) -#define LEAVE_IF_ERROR(err) (err < KErrNone ? LogLeave(err, TEST_STRING(__FILE__), __LINE__) : void(0)) - -//=========================================================================================== - -/////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////// -//Test macross and functions - -static void Check(TInt aValue, TInt aLine) - { - if(!aValue) - { - TheTest(EFalse, aLine); - } - } -static void Check(TInt aValue, TInt aExpected, TInt aLine) - { - if(aValue != aExpected) - { - RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); - TheTest(EFalse, aLine); - } - } -#define TEST(arg) ::Check((arg), __LINE__) -#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) - /////////////////////////////////////////////////////////////////////////////////////// // @@ -281,44 +230,6 @@ } } -TInt KillProcess(const TDesC& aProcessName) - { - TFullName name; - - RDebug::Print(_L("Find and kill \"%S\" process.\n"), &aProcessName); - - TBuf<64> pattern(aProcessName); - TInt length = pattern.Length(); - pattern += _L("*"); - TFindProcess procFinder(pattern); - - while (procFinder.Next(name) == KErrNone) - { - if (name.Length() > length) - {//If found name is a string containing aProcessName string. - TChar c(name[length]); - if (c.IsAlphaDigit() || - c == TChar('_') || - c == TChar('-')) - { - // If the found name is other valid application name - // starting with aProcessName string. - RDebug::Print(_L(":: Process name: \"%S\".\n"), &name); - continue; - } - } - RProcess proc; - if (proc.Open(name) == KErrNone) - { - proc.Kill(0); - RDebug::Print(_L("\"%S\" process killed.\n"), &name); - } - proc.Close(); - } - return KErrNone; - } - - TInt FuzzServerL(TAny* aTestInfo) { CTrapCleanup* cleanup=CTrapCleanup::New(); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logservercrash.cpp --- a/loggingservices/eventlogger/test/src/t_logservercrash.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logservercrash.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2004-2010 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" @@ -23,13 +23,10 @@ #include #include - -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log Event Test Harness")); +RTest TheTest(_L("t_logservercrash")); const TInt KTestEventNum = 10; const TLogDurationType KTestDurationType1 = 1; @@ -60,7 +57,7 @@ */ LOCAL_C void TestKillServerL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1021 Before Killing Server ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1021 Before Killing Server ")); User::After(2000000); // for EKA2 find process and Kill @@ -73,7 +70,7 @@ LEAVE_IF_ERROR( server.Open(findProcess, EOwnerProcess) ); server.Kill(0); - test.Next(_L("Server is Killed")); + TheTest.Next(_L("Server is Killed")); User::After(2000000); } @@ -87,7 +84,7 @@ */ LOCAL_C void TestEventViewL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1022 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1022 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -209,7 +206,7 @@ TheMatchingIsEnabled = TestUtils::MatchingEnabledL(); // test 0 adds an event - TestUtils::Initialize(_L("T_LOGSERVERCRASH")); + TestUtils::Initialize(_L("t_logservercrash")); TestUtils::DeleteDatabaseL(); CLogClient* client = CLogClient::NewL(theFs); @@ -218,22 +215,21 @@ CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); CleanupStack::PushL(notifier); - test.Start(_L("Event View With No Filter: Before Killing Sever")); - test.Next(_L("Test Add Event")); + TheTest.Start(_L("Event View With No Filter: Before Killing Sever")); + TheTest.Next(_L("Test Add Event")); TestEventViewL(*client); theLog.Write(_L8("Test 0 OK\n")); // Test 1 stops the server - test.Next(_L("Test Kill Server")); + TheTest.Next(_L("Test Kill Server")); TestKillServerL(); theLog.Write(_L8("Test 1 OK\n")); // Test 2 checks the server is going again - test.Start(_L("Event View With No Filter : After Killing Sever")); - test.Next(_L("Test Add Event")); + TheTest.Next(_L("Event View With No Filter : After Killing Sever")); + TheTest.Next(_L("Test Add Event")); TestEventViewL(*client); theLog.Write(_L8("Test 2 OK\n")); - test.End(); CleanupStack::PopAndDestroy(2); } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logsimid.cpp --- a/loggingservices/eventlogger/test/src/t_logsimid.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logsimid.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -20,12 +20,10 @@ #include #include #include -#include "TEST.H" +#include "t_logutil2.h" #include "LogServSqlStrings.h" -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("LogEng - SimId tests")); +RTest TheTest(_L("t_logsimid")); #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM @@ -263,7 +261,7 @@ TTime st_time; st_time.UniversalTime(); - test.Printf(_L("Added events:\n")); + TheTest.Printf(_L("Added events:\n")); TInt diffEvCount = KDiffEvCount; for(TInt i=0;iiStatus.Int(), KErrNone); if((i % 50) == 0) { - test.Printf(_L("%d\r"), i); + TheTest.Printf(_L("%d\r"), i); } } - test.Printf(_L("%d\n"), TheAddedEventCount); + TheTest.Printf(_L("%d\n"), TheAddedEventCount); TTime end_time; end_time.UniversalTime(); @@ -300,7 +298,7 @@ CleanupStack::PopAndDestroy(client); TTimeIntervalMicroSeconds us = end_time.MicroSecondsFrom(st_time); - test.Printf(_L("%d events added. Time: %ld milliseconds\n"), TheAddedEventCount, us.Int64() / 1000); + TheTest.Printf(_L("%d events added. Time: %ld milliseconds\n"), TheAddedEventCount, us.Int64() / 1000); } void DoSetFilterL(TLogViewSimId aViewSimId, TInt aExpectedEventCount, @@ -329,7 +327,7 @@ CActiveScheduler::Start(); TEST2(aActive.iStatus.Int(), KErrNone); TInt count = aLogView.CountL(); - test.Printf(_L("===Events count: %d\n"), count); + TheTest.Printf(_L("===Events count: %d\n"), count); TEST2(count, aExpectedEventCount); } @@ -389,7 +387,7 @@ TTime end_time; end_time.UniversalTime(); TTimeIntervalMicroSeconds us = end_time.MicroSecondsFrom(st_time); - test.Printf(_L("SetFilter(). Time: %ld milliseconds\n"), us.Int64() / 1000); + TheTest.Printf(_L("SetFilter(). Time: %ld milliseconds\n"), us.Int64() / 1000); TInt count = 0; st_time.UniversalTime(); @@ -407,7 +405,7 @@ } end_time.UniversalTime(); us = end_time.MicroSecondsFrom(st_time); - test.Printf(_L("Event view walk completed. Events count: %d. Time: %ld milliseconds\n"), count, us.Int64() / 1000); + TheTest.Printf(_L("Event view walk completed. Events count: %d. Time: %ld milliseconds\n"), count, us.Int64() / 1000); CleanupStack::PopAndDestroy(filter); CleanupStack::PopAndDestroy(view); @@ -435,21 +433,22 @@ void doTestsL() { + TestUtils::Initialize(_L("t_logsimid")); TestUtils::DeleteDatabaseL(); // - test.Start(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4025: CLogEvent API test")); + TheTest.Start(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4025: CLogEvent API test")); LogEventApiTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4026: CLogFilter API test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4026: CLogFilter API test")); LogFilterApiTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4027: Add events test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4027: Add events test")); LogAddEventsTestL(); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4028: View events without SimId test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4028: View events without SimId test")); LogViewEventsTestL(ELogWithoutSimId, TheMaxLogSize / 2); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4028: View events with SimId test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4028: View events with SimId test")); LogViewEventsTestL(ELogWithSimId, TheMaxLogSize / 2); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4028: View events with or without SimId test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4028: View events with or without SimId test")); LogViewEventsTestL(ELogIgnoreSimId, TheMaxLogSize); - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4028: More complex event view test")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-UT-4028: More complex event view test")); LogViewEventsTestL(ELogDiffEvents, KDiffEvCount); // TestUtils::DeleteDatabaseL(); @@ -459,7 +458,8 @@ void doTestsL() { - test.Start(_L("The t_simid test cases are compiled only when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM macro is defined!")); + TestUtils::Initialize(_L("t_logsimid")); + TheTest.Start(_L("The t_simid test cases are compiled only when SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM macro is defined!")); } #endif//SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logtype.cpp --- a/loggingservices/eventlogger/test/src/t_logtype.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logtype.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,10 +15,9 @@ #include #include -#include "TEST.H" +#include "t_logutil2.h" -#undef test //there is a "test" macro which hides "RTest test" declaration. -RTest test(_L("Event Type Test Harness")); +RTest TheTest(_L("t_logtype")); /** @SYMTestCaseID SYSLIB-LOGENG-CT-0830 @@ -31,7 +30,7 @@ */ LOCAL_C void TestTypeL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0830 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0830 ")); CLogEventType* type1 = CLogEventType::NewL(); CleanupStack::PushL(type1); @@ -116,7 +115,7 @@ // // { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0831 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0831 ")); #ifdef _DEBUG TInt failCount = 0; #endif @@ -153,7 +152,7 @@ */ LOCAL_C void TestInitialEventsL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0832 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0832 ")); // Make sure the database is deleted TestUtils::DeleteDatabaseL(); @@ -267,16 +266,16 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGTYPE")); - test.Start(_L("Event Type")); + TestUtils::Initialize(_L("t_logtype")); + TheTest.Start(_L("Event Type")); TestTypeL(); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("Event Type with heap failure")); + TheTest.Next(_L("Event Type with heap failure")); TestTypeWithHeapFailL(); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("Initial events")); + TheTest.Next(_L("Initial events")); TestInitialEventsL(); theLog.Write(_L8("Test 3 OK\n")); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/src/t_logutil.cpp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,140 @@ +// Copyright (c) 2010 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: +// +#include "t_logutil.h" + +//Define "TheTest" variable used in the test cpp files +extern RTest TheTest; + +TPtrC FileName(const TText* aFile) + { + TPtrC p(aFile); + TInt ix=p.LocateReverse('\\'); + if (ix<0) + ix=p.LocateReverse('/'); + if (ix>=0) + p.Set(p.Mid(1+ix)); + return p; + } + +void LogTestBoolExpr(TBool aRes, const TText* aFile, TInt aLine, TBool aPrintThreadName) + { + if(!aRes) + { + TPtrC fname(FileName(aFile)); + if(aPrintThreadName) + { + RThread th; + TName name = th.Name(); + RDebug::Print(_L("*** Boolean expression evaluated to false, file: %S-%d\r\n"), &fname, aLine); + User::Panic(_L("t_logutil-1"), 1); + } + else + { + TheTest.Printf(_L("*** Boolean expression evaluated to false, file: %S-%d\r\n"), &fname, aLine); + TheTest(EFalse, aLine); + } + } + } + +void LogCheck(TInt aValue, TInt aExpected, const TText* aFile, TInt aLine, TBool aPrintThreadName) + { + if(aValue != aExpected) + { + TPtrC fname(FileName(aFile)); + if(aPrintThreadName) + { + RThread th; + TName name = th.Name(); + RDebug::Print(_L("*** Expected error: %d, got: %d, file: %S-%d\r\n"), aExpected, aValue, &fname, aLine); + User::Panic(_L("t_logutil-2"), 2); + } + else + { + TheTest.Printf(_L("*** Expected error: %d, got: %d, file: %S-%d\r\n"), aExpected, aValue, &fname, aLine); + TheTest(EFalse, aLine); + } + } + } + +void LogCheckU(TUint aValue, TUint aExpected, const TText* aFile, TInt aLine, TBool aPrintThreadName) + { + if(aValue != aExpected) + { + TPtrC fname(FileName(aFile)); + if(aPrintThreadName) + { + RThread th; + TName name = th.Name(); + RDebug::Print(_L("*** Expected error: %u, got: %u, file: %S-%d\r\n"), aExpected, aValue, &fname, aLine); + User::Panic(_L("t_logutil-3"), 3); + } + else + { + TheTest.Printf(_L("*** Expected error: %u, got: %u, file: %S-%d\r\n"), aExpected, aValue, &fname, aLine); + TheTest(EFalse, aLine); + } + } + } + +void LogLeave(TInt aErr, const TText* aFile, const TInt aLine) + { + TPtrC fname(FileName(aFile)); + TheTest.Printf(_L("*** LogEng test leave, err=%d, file: %S-%d\r\n"), aErr, &fname, aLine); + User::Leave(aErr); + } + +void LogPanic(const TDesC& aCategory, TInt aErr, const TText* aFile, TInt aLine) + { + TPtrC fname(FileName(aFile)); + TheTest.Printf(_L("*** LogEng test panic'd with err=%d, category=%S, file: %S-%d\r\n"), aErr, &aCategory, &fname, aLine); + User::Panic(aCategory, aErr); + } + +TInt KillProcess(const TDesC& aProcessName) + { + TFullName name; + + TheTest.Printf(_L("Find and kill \"%S\" process.\n"), &aProcessName); + + TBuf<64> pattern(aProcessName); + TInt length = pattern.Length(); + pattern += _L("*"); + TFindProcess procFinder(pattern); + + while (procFinder.Next(name) == KErrNone) + { + if (name.Length() > length) + {//If found name is a string containing aProcessName string. + TChar c(name[length]); + if (c.IsAlphaDigit() || + c == TChar('_') || + c == TChar('-')) + { + // If the found name is other valid application name + // starting with aProcessName string. + TheTest.Printf(_L(":: Process name: \"%S\".\n"), &name); + continue; + } + } + RProcess proc; + if (proc.Open(name) == KErrNone) + { + proc.Kill(0); + TheTest.Printf(_L("\"%S\" process killed.\n"), &name); + } + proc.Close(); + } + return KErrNone; + } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logutil2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/src/t_logutil2.cpp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,940 @@ +// Copyright (c) 2004-2010 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: +// + +#include +#include "t_logutil2.h" + +//Define "TheTest" variable used in the test cpp files +extern RTest TheTest; + +_LIT(KHelperExeName, "t_LogHiCapHelper.exe"); + +//====================================================================================================== + +#ifdef LOGGING_ENABLED + +void Log::New() + { + _LIT(KNewLogText, "===== NEW LOG ====="); + // + RFileLogger logger; + TInt ret=logger.Connect(); + if (ret==KErrNone) + { + logger.CreateLog(KLogFolder, KLogFileName, EFileLoggingModeOverwrite); + logger.Write(KNewLogText); + } + logger.Close(); + } + +void Log::Write(const TDesC& aText) + { + PruneLogFile(); + + RFileLogger logger; + TInt ret=logger.Connect(); + if (ret==KErrNone) + { + logger.SetDateAndTime(EFalse,EFalse); + logger.CreateLog(KLogFolder, KLogFileName,EFileLoggingModeAppend); + TBuf buf; + TTime now; + now.HomeTime(); + TDateTime dateTime; + dateTime = now.DateTime(); + buf.Format(KTimeFormat,dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond()); + buf.AppendFormat(KTextFormat,&aText); + + logger.Write(buf); + } + + logger.Close(); + } + +void Log::WriteFormat(TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + + PruneLogFile(); + + TBuf<2*KLogEngLogBufferSize> buf; + buf.SetMax(); + buf.FillZ(); + TTime now; + now.HomeTime(); + TDateTime dateTime; + dateTime = now.DateTime(); + buf.Format(KTimeFormat,dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond()); + buf.AppendFormatList(aFmt, list ); + + RFileLogger logger; + TInt ret=logger.Connect(); + if (ret==KErrNone) + { + logger.SetDateAndTime(EFalse,EFalse); + logger.CreateLog(KLogFolder, KLogFileName,EFileLoggingModeAppend); + logger.Write(buf); + } + + logger.Close(); + } + +void Log::PruneLogFile() + { + const TInt KMaxLogSize = 1024 * 500; + _LIT(KDriveLetter, "C:\\Logs\\"); + // + TFileName fileName(KDriveLetter); + fileName.Append(KLogFolder); + fileName.Append(KLogFileName); + // + RFs fsSession; + if (fsSession.Connect() == KErrNone) + { + TEntry entry; + if (fsSession.Entry(fileName, entry) == KErrNone) + { + // Check size and delete if its too big + if (entry.iSize >= KMaxLogSize) + fsSession.Delete(fileName); // ignore error + } + } + fsSession.Close(); + } + +#endif + +// Globals +GLDEF_D CTrapCleanup* theCleanup; +GLDEF_D CActiveScheduler *testScheduler; +GLDEF_D RFs theFs; +GLDEF_D TFileName theLogName; +GLDEF_D RFile theLog; +GLDEF_D RLogTestSession theLogServ; + +//********************************** +// CTestActive +//********************************** + +CTestActive::CTestActive(TInt aPriority) +: CActive(aPriority) + { + CActiveScheduler::Add(this); + iDelayTime=0; + } + +CTestActive::~CTestActive() + { + Cancel(); + } + +void CTestActive::DoCancel() + { + TRequestStatus* s=&iStatus; + User::RequestComplete(s, KErrNone); + } + +void CTestActive::StartL() + { + iDelayCompletion=EFalse; + iDelayTime=0; + iStatus = KRequestPending; + SetActive(); + } + +void CTestActive::StartL(TInt aDelay) + { + iDelayCompletion=ETrue; + iDelayTime=aDelay; + iStatus = KRequestPending; + SetActive(); + } + +void CTestActive::RunL() + { + if(iDelayCompletion && iDelayTime) + { + // Wait for events in other threads to have a go.... + User::After(iDelayTime); + iDelayTime=0; + iStoredStatus=iStatus; + SetActive(); + TRequestStatus* s=&iStatus; + User::RequestComplete(s, KErrNone); + } + else + { + if(iDelayCompletion) + iStatus=iStoredStatus; + + LOGTEXT("CTestActive::RunL() - Stopping the scheduler"); + CActiveScheduler::Stop(); + } + } + +//********************************** +// CTestTimer +//********************************** + +CTestTimer::CTestTimer() +: CTimer(EPriorityLow) + {} + +void CTestTimer::RunL() + { + LOGTEXT("CTestTimer::RunL() - Stopping the scheduler"); + CActiveScheduler::Stop(); + } + +CTestTimer* CTestTimer::NewL() + { + CTestTimer* self = new(ELeave) CTestTimer(); + CleanupStack::PushL(self); + self->ConstructL(); // CTimer + CActiveScheduler::Add(self); + CleanupStack::Pop(); + return self; + } + +//********************************** +// TestUtils +//********************************** + +void TestUtils::Initialize(const TDesC& aName) + { + TheTest.Title(); + TheTest.Printf(_L("%S\r\n"), &aName); + User::RenameThread(aName); + } + +TBool TestUtils::FileExists(const TDesC& aFile) + { + TEntry entry; + return theFs.Entry(aFile, entry) == KErrNone; + } + +//Loads t_loghihelper process and passes for execution to t_loghihelper "aCommandLineArg" command line. +//t_loghihelper will run, execute the command and die, returning the result of the command execution. +//TestUtils::ExecuteRemoteL() will leave if error and return the result of the remote cmd execution to the caller. +TInt TestUtils::ExecuteRemoteL(const TDesC& aCommandLineArg) + { + RProcess process; + LEAVE_IF_ERROR(process.Create(KHelperExeName, aCommandLineArg)); + + TRequestStatus status; + process.Logon(status); + process.Resume(); + + User::WaitForRequest(status); + TInt exitReason = process.ExitReason(); + + process.Close(); + LEAVE_IF_ERROR(exitReason); + + return exitReason; + } + +//Runs t_loghihelper. t_loghihelper will execute the "delete LogEng database" command. +//The "delete LogEng database" is a complex operation. The request is sent via the backup server +//which will send a request to the LogEng server to release the LogEng database file locks and close the file. +//After that the database will be deleted. +//In the same call the LogEng server will restarted and the LogEng server will re-create the database during the +//server startup. +// +//If "aCloseBeforeDelete" flag is false, then the database wil be only deleted. +//The default value of "aCloseBeforeDelete" is true: the database will be closed, deleted and re-created. +//But some of the LogEng tests create a CBaBackupSessionWrapper object and call CloseFileL() with the logeng +//database name as a parameter. In this case, if another process, as t_loghicaphelper for example, attempts +//to call CloseFileL() with the same file name as a parameter, then the caller will get KErrServerBusy error. +//See how CBaBackupSessionWrapper::CloseFileL() is implemented on the server side. +void TestUtils::DeleteDatabaseL(TBool aCloseBeforeDelete) + { + _LIT(KCmdLine1, "-delete_db1"); + _LIT(KCmdLine2, "-delete_db2"); + (void)ExecuteRemoteL(aCloseBeforeDelete ? KCmdLine1 : KCmdLine2); + } + +//Runs t_loghihelper. t_loghihelper will check and return whether the LogEng database is open or not. +TBool TestUtils::IsDatabaseOpenL() + { + _LIT(KCmdLine, "-db_is_open"); + TInt result = ExecuteRemoteL(KCmdLine); + return result != 0; + } + +//Runs t_loghihelper. t_loghihelper will add an event type to the LogEng database. +void TestUtils::AddEventTypeL() + { + _LIT(KCmdLine, "-add_event_type"); + (void)ExecuteRemoteL(KCmdLine); + } + +//Runs t_loghihelper. t_loghihelper will add an event to the LogEng database. +TInt TestUtils::AddEventL() + { + _LIT(KCmdLine, "-add_event"); + return ExecuteRemoteL(KCmdLine); + } + +//Runs t_loghihelper. t_loghihelper will add events to the LogEng database. +void TestUtils::AddViewTestEventsL() + { + _LIT(KCmdLine, "-add_view_test_events"); + (void)ExecuteRemoteL(KCmdLine); + } + +//Runs t_loghihelper. t_loghihelper will return the size of the LogEng database. +TInt TestUtils::DatabaseSizeL() + { + _LIT(KCmdLine, "-db_size"); + return ExecuteRemoteL(KCmdLine); + } + +//Runs t_loghihelper. t_loghihelper will replace the LogEng database with a corrupted database (for testing purposes). +//The LogEng server will be stopped before that. The function can be used only in debug mode. +#ifdef _DEBUG +void TestUtils::CopyCorruptDbL() + { + + _LIT(KCmdLine, "-copy_corrupt"); + (void)ExecuteRemoteL(KCmdLine); + } + +//Runs t_loghihelper. t_loghihelper will replace the LogEng database with a corrupted database (for testing purposes). +//The LogEng server will be stopped before that. The function can be used only in debug mode. +void TestUtils::CopyCorruptDamagedDbL() + { + + _LIT(KCmdLine, "-copy_corrupt_damaged"); + (void)ExecuteRemoteL(KCmdLine); + } + +//Runs t_loghihelper. t_loghihelper will replace the LogEng database with an old format database +//(no SimId column, phone number length is different). The LogEng server will be stopped before that. +//The function can be used only in debug mode. +void TestUtils::CopyOldDbL() + { + _LIT(KCmdLine, "-copy_old"); + (void)ExecuteRemoteL(KCmdLine); + } +#else //_DEBUG +void TestUtils::CopyCorruptDbL() + { + TheTest.Printf(_L("TestUtils::CopyCorruptDbL() has a meaningfull implementation in debug builds only.\n")); + } + +void TestUtils::CopyCorruptDamagedDbL() + { + TheTest.Printf(_L("TestUtils::CopyCorruptDamagedDbL() has a meaningfull implementation in debug builds only.\n")); + } + +void TestUtils::CopyOldDbL() + { + TheTest.Printf(_L("TestUtils::CopyOldDbL() has a meaningfull implementation in debug builds only.\n")); + } + +#endif//_DEBUG + +//Runs t_loghihelper. t_loghihelper will re-create the LogEng database and check whether LogEng client can connect to the server. +void TestUtils::TestInvalidSchemaL() + { + _LIT(KCmdLine, "-invalid_schema"); + (void)ExecuteRemoteL(KCmdLine); + } + +//Runs t_loghihelper. t_loghihelper checks whether the phone number mathcing is enabled. +TBool TestUtils::MatchingEnabledL() + { + _LIT(KCmdLine, "-is_matching_enabled"); + return ExecuteRemoteL(KCmdLine) != 0; + } + +//Creates HBufC object and puts it on the cleanup stack. +//The buffer will be filled with (' ' + pos) characters, where pos is the character position in the buffer. +HBufC* TestUtils::CreateBufLC(TInt aLength) + { + HBufC* buf = HBufC::NewLC(aLength); + TPtr ptr = buf->Des(); + for(TInt pos=0;posDes(); + for(TInt pos=0;posAfter(aDelay); + + CTestActive* wait = new(ELeave)CTestActive; + CleanupStack::PushL(wait); + wait->StartL(); + + // Wait for key press + TheTest.Console()->Read(wait->iStatus); + CActiveScheduler::Start(); + + // If timer still active a key was pressed + TBool keyPressed = timer->IsActive(); + + if (keyPressed) + { + // Get the key pressed + aKeyCode = TheTest.Console()->KeyCode(); + + // Cancel timer + timer->Cancel(); + } + else + { + // Cancel wait for character + TheTest.Console()->ReadCancel(); + User::WaitForRequest(wait->iStatus); + } + + CleanupStack::PopAndDestroy(2); // wait, timer + return keyPressed; + } + +//Used for LogEng server side heap failure testing. +#ifdef _DEBUG +void TestUtils::SetLogServHeapFailureL(RHeap::TAllocFail aType, TInt aRate) + { + //this function doesn't have any effect on UREL builds + //get rid of warnings in release builds + aType = aType; + aRate = aRate; + if (!theLogServ.Handle()) + LEAVE_IF_ERROR(theLogServ.Connect()); + + TIpcArgs ipcArgs(aType,aRate) ; + LEAVE_IF_ERROR(theLogServ.Send(ELogSetHeapFail, ipcArgs)); + } +#else +void TestUtils::SetLogServHeapFailureL(RHeap::TAllocFail, TInt) + { + } +#endif//_DEBUG + +//********************************** +// CLogViewChangeObserver +//********************************** + +CLogViewChangeObserver* CLogViewChangeObserver::NewLC() + { + CLogViewChangeObserver* self = new(ELeave) CLogViewChangeObserver(); + CleanupStack::PushL(self); + return self; + } + +CLogViewChangeObserver::~CLogViewChangeObserver() + { + Cancel(); + delete iChanges; + } + +CLogViewChangeObserver::CLogViewChangeObserver() +: CActive(EPriorityStandard) + { + CActiveScheduler::Add(this); + } + + +CLogChangeDefinition* CLogViewChangeObserver::WaitForChangesLC(TStopType aType, TInt aCount) + { + __ASSERT_ALWAYS(!iSchedulerStarted, User::Invariant()); + Reset(); + // + iExpectedChangeCount = aCount; + iType = aType; + if (aType != EStopOnChanges) + SetActive(); + // + iSchedulerStarted = ETrue; + CActiveScheduler::Start(); + iSchedulerStarted = EFalse; + // + CLogChangeDefinition* ret = iChanges; + TEST(iChanges != NULL); + iChanges = NULL; + CleanupStack::PushL(ret); + return ret; + } + +CLogChangeDefinition* CLogViewChangeObserver::WaitForChangesLC(TCallBack aCallBack, TStopType aType, TInt aCount) + { + iHaveCallBack = ETrue; + iCallBack = aCallBack; + return WaitForChangesLC(aType, aCount); + } + +void CLogViewChangeObserver::HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount) + { + AddChangeL(ELogChangeTypeEventAdded, aId, aViewIndex); + if (aChangeIndex == aTotalChangeCount-1) + CheckForSchedulerStop(); + } + +void CLogViewChangeObserver::HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount) + { + AddChangeL(ELogChangeTypeEventChanged, aId, aViewIndex); + if (aChangeIndex == aTotalChangeCount-1) + CheckForSchedulerStop(); + } + +void CLogViewChangeObserver::HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount) + { + AddChangeL(ELogChangeTypeEventDeleted, aId, aViewIndex); + if (aChangeIndex == aTotalChangeCount-1) + CheckForSchedulerStop(); + } + +void CLogViewChangeObserver::RunL() + { + __ASSERT_ALWAYS(iType == EStopOnRunL || iType == EStopOnBoth, User::Invariant()); + iHaveFinishedOperation = ETrue; + CheckForSchedulerStop(); + } + +void CLogViewChangeObserver::DoCancel() + { + TRequestStatus* s=&iStatus; + User::RequestComplete(s, KErrCancel); + } + +void CLogViewChangeObserver::Reset() + { + iExpectedChangeCount = 0; + iHaveFinishedOperation = EFalse; + iHaveObtainedChanges = EFalse; + iSchedulerStarted = EFalse; + iType = EStopOnChanges; + delete iChanges; + iChanges = NULL; + } + +void CLogViewChangeObserver::CheckForSchedulerStop() + { + if(iSchedulerStarted) + { + if (iHaveCallBack) + { + iCallBack.CallBack(); + iCallBack.iFunction = NULL; + iCallBack.iPtr = NULL; + iHaveCallBack = EFalse; + } + // + TBool stopScheduler = EFalse; + switch(iType) + { + case EStopOnChanges: + stopScheduler = iHaveObtainedChanges; + break; + case EStopOnRunL: + stopScheduler = iHaveFinishedOperation; + break; + case EStopOnBoth: + stopScheduler = (iHaveObtainedChanges && iHaveFinishedOperation); + break; + case EStopOnCount: + if (iChanges) + { + TEST(iChanges->Count() <= iExpectedChangeCount); + stopScheduler = (iChanges->Count() == iExpectedChangeCount); + } + case EDontStopScheduler: + break; + } + + if (stopScheduler) + { + LOGTEXT("CLogViewChangeObserver::CheckForSchedulerStop() - Stopping the scheduler"); + CActiveScheduler::Stop(); + } + } + } + +void CLogViewChangeObserver::AddChangeL(TLogDatabaseChangeType aType, TLogId aId, TInt aViewIndex) + { + CLogChangeDefinition* changes; + + if (iChanges) + changes = iChanges; + else + { + changes = CLogChangeDefinition::NewL(); + CleanupStack::PushL(changes); + } + // + changes->AddL(aId, aType, aViewIndex); + // + if (!iChanges) + { + delete iChanges; + iChanges = changes; + CleanupStack::Pop(changes); + } + // + iHaveObtainedChanges = ETrue; + } + +//********************************** +// CLogViewChangeObserverErrorTest +//********************************** +CLogViewChangeObserverErrorTest* CLogViewChangeObserverErrorTest::NewLC() + { + CLogViewChangeObserverErrorTest* self = new(ELeave) CLogViewChangeObserverErrorTest(); + CleanupStack::PushL(self); + return self; + } + +CLogViewChangeObserverErrorTest::CLogViewChangeObserverErrorTest() + {} + +void CLogViewChangeObserverErrorTest::HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount) + { + // DEF108741L - the error condition tested here is that a leave is dealt with + // gracefully without any panics. + + // Add a new event to the log + AddChangeL(ELogChangeTypeEventAdded, aId, aViewIndex); + if (aChangeIndex == aTotalChangeCount-1) + CheckForSchedulerStop(); + + // In the test case for DEF108741L this method will be effectively + // invoked 3 times. This code forces a leave on the middle event to + // ensure that the leave is dealt with and the rest of the test + // completes successfully. + if (aId == 1) + { + LEAVE(KErrGeneral); + } + } + +//********************************** +// CLogSchedulerTimer +//********************************** + +CLogSchedulerTimer* CLogSchedulerTimer::NewLC() + { + CLogSchedulerTimer* self = new(ELeave) CLogSchedulerTimer(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +CLogSchedulerTimer::~CLogSchedulerTimer() + { + Cancel(); + } + +CLogSchedulerTimer::CLogSchedulerTimer() +: CTimer(0) + { + CActiveScheduler::Add(this); + } + +void CLogSchedulerTimer::ConstructL() + { + CTimer::ConstructL(); + } + +void CLogSchedulerTimer::Wait(TTimeIntervalMicroSeconds32 aTime) + { + After(aTime); + CActiveScheduler::Start(); + } + +void CLogSchedulerTimer::RunL() + { + LOGTEXT("CLogSchedulerTimer::RunL() - Stopping the scheduler"); + CActiveScheduler::Stop(); + } + + + + +//********************************** +// CLogChangeNotifier +//********************************** + +CLogChangeNotifier* CLogChangeNotifier::NewL() + { + CLogChangeNotifier* self = new(ELeave)CLogChangeNotifier(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +CLogChangeNotifier::~CLogChangeNotifier() + { + Cancel(); + delete iClient; + } + +CLogChangeNotifier::CLogChangeNotifier() +: CActive(EPriorityStandard) + { + CActiveScheduler::Add(this); + } + +void CLogChangeNotifier::ConstructL() + { + iClient = CLogClient::NewL(theFs); + + iStart.UniversalTime(); + iClient->NotifyChange(10000000, iStatus); + SetActive(); + } + +void CLogChangeNotifier::RunL() + { + TTime now; + now.UniversalTime(); + TTimeIntervalSeconds seconds; + now.SecondsFrom(iStart, seconds); + + TBuf<256> buf; + const TInt error = iStatus.Int(); + if (error == KErrServerTerminated) + { + buf.Format(_L("KErrServerTerminated")); + User::InfoPrint(buf); + return; + } + + buf.Format(_L("%d seconds"), seconds.Int()); + User::InfoPrint(buf); + + iStart.UniversalTime(); + iClient->NotifyChange(10000000, iStatus); + SetActive(); + } + +void CLogChangeNotifier::DoCancel() + { + iClient->NotifyChangeCancel(); + } + +//********************************** +// Global +//********************************** + +void SetupSchedulerL() + { + testScheduler = new (ELeave) CActiveScheduler; + CleanupStack::PushL( testScheduler ); + CActiveScheduler::Install( testScheduler ); + } + +void CloseScheduler() + { + CleanupStack::PopAndDestroy(); // Scheduler + testScheduler = NULL; + } + +static void CreateLogL() + { + LEAVE_IF_ERROR(theFs.Connect()); + + theLogName.Copy(RProcess().FileName()); + TInt start = theLogName.LocateReverse('\\'); + TInt end = theLogName.LocateReverse('.'); + theLogName = theLogName.Mid(start + 1, end - start - 1); + + // create the log filename + theLogName.Insert(0, _L("C:\\")); +#if defined(__WINS__) + theLogName.Append(_L(".WINS.")); +#else + theLogName.Append(_L(".MARM.")); +#endif +#if defined(_UNICODE) + theLogName.Append(_L("UNICODE.")); +#else + theLogName.Append(_L("ASCII.")); +#endif +#if defined(_DEBUG) + theLogName.Append(_L("DEB.")); +#else + theLogName.Append(_L("REL.")); +#endif + theLogName.Append(_L("LOG")); + + // create the logfile + LEAVE_IF_ERROR(theLog.Replace(theFs, theLogName, EFileWrite|EFileShareExclusive)); + TBuf8<256> text; + text.Copy(theLogName); + theLog.Write(text); + theLog.Write(_L8("\nTest results\n")); + } + +static void CloseLog() + { + theLog.Write(_L8("Tests completed\n")); + TheTest.Printf(_L("Results saved in %S\n"), &theLogName); + theLog.Close(); + theFs.Close(); + } + +void DeleteDataFile(const TDesC& aFullName) + { + RFs fsSession; + TInt err = fsSession.Connect(); + if(err == KErrNone) + { + TEntry entry; + if(fsSession.Entry(aFullName, entry) == KErrNone) + { + TheTest.Printf(_L("Deleting \"%S\" file.\n"), &aFullName); + err = fsSession.SetAtt(aFullName, 0, KEntryAttReadOnly); + if(err != KErrNone) + { + TheTest.Printf(_L("Error %d changing \"%S\" file attributes.\n"), err, &aFullName); + } + err = fsSession.Delete(aFullName); + if(err != KErrNone) + { + TheTest.Printf(_L("Error %d deleting \"%S\" file.\n"), err, &aFullName); + } + } + fsSession.Close(); + } + else + { + TheTest.Printf(_L("Error %d connecting file session. File: %S.\n"), err, &aFullName); + } + } + +static void Cleanup(void*) + { + TRAP_IGNORE(TestUtils::DeleteDatabaseL()); + _LIT(KCntModelFileName, "c:\\system\\data\\CntModel.ini"); + ::DeleteDataFile(KCntModelFileName); + _LIT(KContactsFileName, "c:\\system\\data\\Contacts.cdb"); + ::DeleteDataFile(KContactsFileName); + ::DeleteDataFile(theLogName); + } + +static void DoMainL() + { + ::SetupSchedulerL(); + TCleanupItem cleanup(&Cleanup, NULL); + CleanupStack::PushL(cleanup); + CreateLogL(); + ::doTestsL(); + CloseLog(); + CleanupStack::PopAndDestroy();//cleanup + ::CloseScheduler(); + } + +TInt E32Main() + { + __UHEAP_MARK; + + theCleanup = CTrapCleanup::New(); + if(!theCleanup) + { + _LIT(KLogHiCapHelperPanic, "LogTestPanic"); + User::Panic(KLogHiCapHelperPanic, KErrNoMemory); + } + + TRAPD(err, ::DoMainL()); + TEST2(err, KErrNone); + + delete theCleanup; + + TheTest.Console()->SetPos(0, 13); + + TheTest.End(); + TheTest.Close(); + + __UHEAP_MARKEND; + + return KErrNone; + } + + diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logview1.cpp --- a/loggingservices/eventlogger/test/src/t_logview1.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logview1.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -22,15 +22,12 @@ #include #include #include - -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - #define UNUSED_VAR(a) a = a -RTest test(_L("Log View Test Harness Number 1")); +RTest TheTest(_L("t_logview1")); const TInt KTestLogNumberCharsToMatch = 9; // should be the same as KLogNumberCharsToMatch defined in LogServ\src\LOGFILTQ.CPP const TInt KTestEventNum = 10; @@ -107,7 +104,7 @@ */ LOCAL_C void TestEventViewL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0851 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0851 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); @@ -165,7 +162,7 @@ TLogId id = ++count; TEST2(view->Event().Id(), id); } - TEST(count == KTestEventNum - 1); + TEST2(count, KTestEventNum - 1); active->StartL(); res = view->FirstL(active->iStatus); @@ -224,7 +221,7 @@ */ LOCAL_C void TestViewFilterL(CLogClient& aClient, CLogFilter& aFilter) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0852 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0852 ")); CLogViewEvent* view = CLogViewEvent::NewL(aClient); CleanupStack::PushL(view); @@ -262,14 +259,14 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(view->CountL() == total + 1); - - TEST(event->EventType() == KTestEventUid); + TEST2(view->CountL(), total + 1); + + TEST2(event->EventType().iUid, KTestEventUid.iUid); TEST(event->RemoteParty() == aFilter.RemoteParty()); TEST(event->Direction() == aFilter.Direction()); - TEST(event->DurationType() == aFilter.DurationType()); + TEST2(event->DurationType(), aFilter.DurationType()); TEST(event->Status() == aFilter.Status()); - TEST(event->Contact() == aFilter.Contact()); + TEST2(event->Contact(), aFilter.Contact()); TEST(event->Number() == aFilter.Number()); TTime now; @@ -289,7 +286,7 @@ TEST(now >= event->Time()); if (aFilter.EventType() != KNullUid) - TEST(event->EventType() == aFilter.EventType()); + TEST2(event->EventType().iUid, aFilter.EventType().iUid); if (aFilter.RemoteParty().Length() > 0) TEST(event->RemoteParty() == aFilter.RemoteParty()); @@ -298,19 +295,19 @@ TEST(event->Direction() == aFilter.Direction()); if (aFilter.DurationType() != KLogNullDurationType) - TEST(event->DurationType() == aFilter.DurationType()); + TEST2(event->DurationType(), aFilter.DurationType()); if (aFilter.Status().Length() > 0) TEST(event->Status() == aFilter.Status()); if (aFilter.Contact() > KLogNullContactId) - TEST(event->Contact() == aFilter.Contact()); + TEST2(event->Contact(), aFilter.Contact()); if (aFilter.Number().Length() > 0) TEST(event->Number() == aFilter.Number()); } - TEST(count == total + 1); + TEST2(count, total + 1); CleanupStack::PopAndDestroy(3); // active, event, view; } @@ -325,7 +322,7 @@ */ LOCAL_C void TestEventViewFilter1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0853 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0853 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -533,7 +530,7 @@ */ LOCAL_C void TestEventViewFilter2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0854 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0854 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -680,7 +677,7 @@ TEST2(active->iStatus.Int(), KErrNone); // Check the count is correct - TEST(view->CountL() == total + 4); + TEST2(view->CountL(), total + 4); filter->SetEventType(KLogCallEventTypeUid); @@ -691,7 +688,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(view->CountL() == calls + 2); + TEST2(view->CountL(), calls + 2); filter->SetEventType(KLogDataEventTypeUid); @@ -702,7 +699,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(view->CountL() == data + 2); + TEST2(view->CountL(), data + 2); filter->SetEventType(KLogFaxEventTypeUid); @@ -789,7 +786,7 @@ */ LOCAL_C void TestRecentView1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0855 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0855 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -847,7 +844,7 @@ TEST2(view->RecentList(), KLogRecentIncomingCalls); count++; } - TEST(count == KTestEventNum - 1); + TEST2(count, KTestEventNum - 1); active->StartL(); res = view->FirstL(active->iStatus); @@ -925,7 +922,7 @@ TEST2(view->RecentList(), KLogRecentOutgoingCalls); count++; } - TEST(count == KTestEventNum - 1); + TEST2(count, KTestEventNum - 1); active->StartL(); res = view->FirstL(active->iStatus); @@ -990,7 +987,7 @@ TEST2(view->RecentList(), KLogRecentMissedCalls); count++; } - TEST(count == KTestEventNum - 1); + TEST2(count, KTestEventNum - 1); active->StartL(); res = view->FirstL(active->iStatus); @@ -1017,7 +1014,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(view->CountL() == KTestEventNum * 3); + TEST2(view->CountL(), KTestEventNum * 3); count--; } while(view->NextL(active->iStatus)); @@ -1030,10 +1027,10 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(view->CountL() == KTestEventNum * 3); + TEST2(view->CountL(), KTestEventNum * 3); count++; } - TEST(count == KTestEventNum * 3 - 1); + TEST2(count, KTestEventNum * 3 - 1); active->StartL(); res = view->FirstL(active->iStatus); @@ -1061,7 +1058,7 @@ */ LOCAL_C void TestRecentView2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0856 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0856 ")); TInt count; CLogEvent* event = CLogEvent::NewL(); @@ -1129,7 +1126,7 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(dView->CountL() == KTestEventNum - 1); + TEST2(dView->CountL(), KTestEventNum - 1); CleanupStack::PopAndDestroy(4); // view, active, event, dView } @@ -1144,7 +1141,7 @@ */ LOCAL_C void TestRecentRemove1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0857 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0857 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -1161,7 +1158,7 @@ while(view->RemoveL(active->iStatus)) { - TEST(view->CountL() == count - 1); + TEST2(view->CountL(), count - 1); count = view->CountL(); active->StartL(); @@ -1215,7 +1212,7 @@ */ LOCAL_C void TestRecentRemove2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0858 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0858 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -1280,7 +1277,7 @@ */ LOCAL_C void TestDuplicateViewL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0859 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0859 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -1453,7 +1450,7 @@ */ LOCAL_C void TestDuplicateRemoveL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0860 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0860 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -1507,7 +1504,7 @@ */ LOCAL_C void TestPurgeOnSetup1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0861 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0861 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -1609,7 +1606,7 @@ */ LOCAL_C void TestPurgeOnSetup2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0862 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0862 ")); CTestActive* active1 = new(ELeave)CTestActive(); CleanupStack::PushL(active1); @@ -1719,7 +1716,7 @@ */ LOCAL_C void TestViewPurgeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0863 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0863 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -1729,9 +1726,7 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST2(config.iMaxLogSize, 1000); - TEST(config.iMaxRecentLogSize = 10); config.iMaxLogSize = 2000; config.iMaxRecentLogSize = 20; @@ -1784,7 +1779,7 @@ */ LOCAL_C void TestClearDuplicatesL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0864 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0864 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -2114,7 +2109,7 @@ */ LOCAL_C void TestPhoneNumberMatchingL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0865 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0865 ")); TestUtils::DeleteDatabaseL(); CTestActive* active = new(ELeave)CTestActive(); @@ -2228,7 +2223,7 @@ */ LOCAL_C void INC105010L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3472 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3472 ")); TestUtils::DeleteDatabaseL(); CTestActive* active = new(ELeave)CTestActive(); @@ -2336,7 +2331,7 @@ */ LOCAL_C void TestRecentFlagsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0866 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0866 ")); TestUtils::DeleteDatabaseL(); CLogEvent* event = CLogEvent::NewL(); @@ -2469,7 +2464,7 @@ */ LOCAL_C void TestViewFlagsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0867 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0867 ")); TestUtils::DeleteDatabaseL(); CLogEvent* event = CLogEvent::NewL(); @@ -2658,7 +2653,7 @@ */ LOCAL_C void TestViewChangeEvents1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0868 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0868 ")); TestUtils::DeleteDatabaseL(); CLogEvent* event = CLogEvent::NewL(); @@ -2741,7 +2736,7 @@ for(i=0; iAt(i, logId, viewIndex); - RDebug::Print(_L("Change Type: %d, logId: %d, viewIndex: %d\n"), type, logId, viewIndex); + TheTest.Printf(_L("Change Type: %d, logId: %d, viewIndex: %d\n"), type, logId, viewIndex); } // Check the change was as expected @@ -2764,10 +2759,10 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d\n"), i++, view->Event().Id()); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); + TheTest.Printf(_L("==\n")); TEST2(i, count); res = view->FirstL(active->iStatus); TEST(res); @@ -2791,9 +2786,9 @@ TEST2(changeCount, 5); // 1,3,5,7,9 for(i=0; iChanges().At(i, logId, viewIndex) == ELogChangeTypeEventDeleted); - TEST(logId == TLogId(2*i + 1)); - TEST(viewIndex == 10 - ((2*i) + 1)); + TEST2(changeObs->Changes().At(i, logId, viewIndex), ELogChangeTypeEventDeleted); + TEST2(logId, TLogId(2*i + 1)); + TEST2(viewIndex, 10 - ((2*i) + 1)); } // Add a new event that shouldn't appear in the view @@ -2804,8 +2799,8 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum + 1 - 5); - TEST(event->Id() == KTestEventNum + 1); + TEST2(count, KTestEventNum + 1 - 5); + TEST2(event->Id(), KTestEventNum + 1); // Check changes TEST(!changeObs->HaveChanges()); @@ -2819,10 +2814,10 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d\n"), i++, view->Event().Id()); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); + TheTest.Printf(_L("==\n")); TEST2(i, count); res = view->FirstL(active->iStatus); TEST(res); @@ -2837,7 +2832,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum + 1 - 5); + TEST2(count, KTestEventNum + 1 - 5); // Check changes TEST(!changeObs->HaveChanges()); @@ -2851,10 +2846,10 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d\n"), i++, view->Event().Id()); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); + TheTest.Printf(_L("==\n")); TEST2(i, count); res = view->FirstL(active->iStatus); TEST(res); @@ -2870,8 +2865,8 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum + 1 - 5); - TEST(event->Id() == KTestEventNum + 2); + TEST2(count, KTestEventNum + 1 - 5); + TEST2(event->Id(), KTestEventNum + 2); // Check changes TEST(!changeObs->HaveChanges()); @@ -2885,10 +2880,10 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d\n"), i++, view->Event().Id()); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); + TheTest.Printf(_L("==\n")); TEST2(i, count); res = view->FirstL(active->iStatus); TEST(res); @@ -2904,15 +2899,15 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum + 2 - 5); - TEST(event->Id() == KTestEventNum + 2); // Shouldn't change + TEST2(count, KTestEventNum + 2 - 5); + TEST2(event->Id(), KTestEventNum + 2); // Shouldn't change // Check changes changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); TEST2(type, ELogChangeTypeEventAdded); - TEST(logId == KTestEventNum + 2); + TEST2(logId, KTestEventNum + 2); TEST2(viewIndex, 0); // Check view navigation @@ -2924,10 +2919,10 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d\n"), i++, view->Event().Id()); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); + TheTest.Printf(_L("==\n")); TEST2(i, count); res = view->FirstL(active->iStatus); TEST(res); @@ -2943,15 +2938,15 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum + 2 - 5); // Shouldn't change - TEST(event->Id() == KTestEventNum + 2); // Shouldn't change + TEST2(count, KTestEventNum + 2 - 5); // Shouldn't change + TEST2(event->Id(), KTestEventNum + 2); // Shouldn't change // Check changes changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); TEST2(type, ELogChangeTypeEventChanged); - TEST(logId == KTestEventNum + 2); + TEST2(logId, KTestEventNum + 2); TEST2(viewIndex, 0); // Change an event in the view so that it is deleted @@ -2962,14 +2957,14 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum + 2 - 5 - 1); // one less now + TEST2(count, KTestEventNum + 2 - 5 - 1); // one less now // Check changes changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); TEST2(type, ELogChangeTypeEventDeleted); - TEST(logId == KTestEventNum + 2); + TEST2(logId, KTestEventNum + 2); TEST2(viewIndex, 0); // Navigate part way through the view so we have @@ -2983,12 +2978,12 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d\n"), i++, view->Event().Id()); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); + TheTest.Printf(_L("==\n")); TEST2(i, count); - TEST(view->Event().Id() == TLogId(0)); + TEST2(view->Event().Id(), TLogId(0)); // Save id TLogId savedId = view->Event().Id(); @@ -3008,15 +3003,15 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum + 2 - 5); // one more now - TEST(event->Id() == KTestEventNum + 3); + TEST2(count, KTestEventNum + 2 - 5); // one more now + TEST2(event->Id(), KTestEventNum + 3); // Check changes changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - TEST(type == ELogChangeTypeEventAdded); - TEST(logId == KTestEventNum + 3); + TEST2(type, ELogChangeTypeEventAdded); + TEST2(logId, KTestEventNum + 3); TEST2(viewIndex, 0); // Check we can still go forward to the last record @@ -3042,7 +3037,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum + 2 - 5 - 1); // one less + TEST2(count, KTestEventNum + 2 - 5 - 1); // one less // Check changes changeCount = changeObs->Changes().Count(); @@ -3050,7 +3045,7 @@ type = changeObs->Changes().At(0, logId, viewIndex); TEST2(type, ELogChangeTypeEventDeleted); TEST2(logId, savedId); - TEST(viewIndex == KTestEventNum + 2 - 5 - 2); // last but one event + TEST2(viewIndex, KTestEventNum + 2 - 5 - 2); // last but one event // Check we're now at the end of the view res = view->NextL(active->iStatus); @@ -3071,7 +3066,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum - 5); + TEST2(count, KTestEventNum - 5); // Check changes changeCount = changeObs->Changes().Count(); @@ -3092,7 +3087,7 @@ ++count; } while(view->NextL(active->iStatus)); - TEST(count == KTestEventNum - 5 - 1); + TEST2(count, KTestEventNum - 5 - 1); // Check last record savedId = view->Event().Id(); @@ -3101,7 +3096,7 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(savedId == view->Event().Id()); + TEST2(savedId, view->Event().Id()); // Delete the last record savedId = view->Event().Id(); @@ -3111,7 +3106,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KTestEventNum - 6); + TEST2(count, KTestEventNum - 6); // Check changes changeCount = changeObs->Changes().Count(); @@ -3137,12 +3132,12 @@ LOCAL_C void TestLogOpenL() { - test(IsLogOpenL()); + TEST(IsLogOpenL()); } LOCAL_C void TestLogClosedL() { - test(!IsLogOpenL()); + TEST(!IsLogOpenL()); } LOCAL_C void StartBackupL() @@ -3189,7 +3184,7 @@ */ LOCAL_C void TestViewChangeEvents1aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0869 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0869 ")); TestUtils::DeleteDatabaseL(); CLogEvent* event = CLogEvent::NewL(); @@ -3224,27 +3219,27 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); User::After(1 * 1000000); } // - test(view->CountL() == 0); - active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->CountL() == KTestEventNum); + TEST2(view->CountL(), 0); + active->StartL(); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->CountL(), KTestEventNum); // count = KTestEventNum; - test(view->FirstL(active->iStatus)); + TEST(view->FirstL(active->iStatus)); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // - test(view->CountL() == KTestEventNum); + TEST2(view->CountL(), KTestEventNum); const TLogId eventId = view->Event().Id(); - test(eventId == (TLogId)--count); + TEST2(eventId, (TLogId)--count); } while(view->NextL(active->iStatus)); @@ -3261,45 +3256,45 @@ changes = changeObs->WaitForChangesLC(); if (active->IsActive()) CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum+1); + TEST2(count, KTestEventNum+1); changeCount = changes->Count(); for(i=0; iAt(i, logId, viewIndex); - RDebug::Print(_L("Change Type: %d, logId: %d, viewIndex: %d"), type, logId, viewIndex); + TheTest.Printf(_L("Change Type: %d, logId: %d, viewIndex: %d"), type, logId, viewIndex); } // Check the change was as expected - test(changes->Count() == 1); + TEST2(changes->Count(), 1); type = changes->At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); - test(viewIndex == 0); // first (newest) event in the view + TEST2(type, ELogChangeTypeEventAdded); + TEST2(viewIndex, 0); // first (newest) event in the view { const TLogId expectedLogId = ((TLogId) KTestEventNum); - test(logId == expectedLogId); + TEST2(logId, expectedLogId); } CleanupStack::PopAndDestroy(changes); // Check view navigation i=0; - test(view->FirstL(active->iStatus)); + TEST(view->FirstL(active->iStatus)); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d"), i++, view->Event().Id()); + TEST2(active->iStatus.Int(), KErrNone); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); - test(i == count); - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TheTest.Printf(_L("==\n")); + TEST2(i, count); + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup DelayL(1000000); @@ -3310,24 +3305,24 @@ TestLogOpenL(); // Delete some events - test(KTestEventNum >= 10); + TEST(KTestEventNum >= 10); changeObs->StartCollectingChanges(); for(i=1; iStartL(); aClient.DeleteEvent(TLogId(i), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); } // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 5); // 1,3,5,7,9 + TEST2(changeCount, 5); // 1,3,5,7,9 for(i=0; iChanges().At(i, logId, viewIndex) == ELogChangeTypeEventDeleted); - test(logId == TLogId(2*i + 1)); - test(viewIndex == 10 - ((2*i) + 1)); + TEST2(changeObs->Changes().At(i, logId, viewIndex), ELogChangeTypeEventDeleted); + TEST2(logId, TLogId(2*i + 1)); + TEST2(viewIndex, 10 - ((2*i) + 1)); } // Check that changes work after a backup @@ -3343,31 +3338,31 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum + 1 - 5); - test(event->Id() == KTestEventNum + 1); + TEST2(count, KTestEventNum + 1 - 5); + TEST2(event->Id(), KTestEventNum + 1); // Check changes - test(!changeObs->HaveChanges()); + TEST(!changeObs->HaveChanges()); // Check view navigation i=0; - test(view->FirstL(active->iStatus)); + TEST(view->FirstL(active->iStatus)); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d"), i++, view->Event().Id()); + TEST2(active->iStatus.Int(), KErrNone); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); - test(i == count); - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TheTest.Printf(_L("==\n")); + TEST2(i, count); + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -3381,30 +3376,30 @@ active->StartL(); aClient.DeleteEvent(event->Id(), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum + 1 - 5); + TEST2(count, KTestEventNum + 1 - 5); // Check changes - test(!changeObs->HaveChanges()); + TEST(!changeObs->HaveChanges()); // Check view navigation i=0; - test(view->FirstL(active->iStatus)); + TEST(view->FirstL(active->iStatus)); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d"), i++, view->Event().Id()); + TEST2(active->iStatus.Int(), KErrNone); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); - test(i == count); - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TheTest.Printf(_L("==\n")); + TEST2(i, count); + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -3419,31 +3414,31 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum + 1 - 5); - test(event->Id() == KTestEventNum + 2); + TEST2(count, KTestEventNum + 1 - 5); + TEST2(event->Id(), KTestEventNum + 2); // Check changes - test(!changeObs->HaveChanges()); + TEST(!changeObs->HaveChanges()); // Check view navigation i=0; - test(view->FirstL(active->iStatus)); + TEST(view->FirstL(active->iStatus)); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d"), i++, view->Event().Id()); + TEST2(active->iStatus.Int(), KErrNone); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); - test(i == count); - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TheTest.Printf(_L("==\n")); + TEST2(i, count); + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -3458,36 +3453,36 @@ active->StartL(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum + 2 - 5); - test(event->Id() == KTestEventNum + 2); // Shouldn't change + TEST2(count, KTestEventNum + 2 - 5); + TEST2(event->Id(), KTestEventNum + 2); // Shouldn't change // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); - test(logId == KTestEventNum + 2); - test(viewIndex == 0); + TEST2(type, ELogChangeTypeEventAdded); + TEST2(logId, KTestEventNum + 2); + TEST2(viewIndex, 0); // Check view navigation i=0; - test(view->FirstL(active->iStatus)); + TEST(view->FirstL(active->iStatus)); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d"), i++, view->Event().Id()); + TEST2(active->iStatus.Int(), KErrNone); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); - test(i == count); - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TheTest.Printf(_L("==\n")); + TEST2(i, count); + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -3502,18 +3497,18 @@ active->StartL(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum + 2 - 5); // Shouldn't change - test(event->Id() == KTestEventNum + 2); // Shouldn't change + TEST2(count, KTestEventNum + 2 - 5); // Shouldn't change + TEST2(event->Id(), KTestEventNum + 2); // Shouldn't change // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventChanged); - test(logId == KTestEventNum + 2); - test(viewIndex == 0); + TEST2(type, ELogChangeTypeEventChanged); + TEST2(logId, KTestEventNum + 2); + TEST2(viewIndex, 0); // Check that changes work after a backup StartBackupL(); @@ -3528,43 +3523,43 @@ active->StartL(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum + 2 - 5 - 1); // one less now + TEST2(count, KTestEventNum + 2 - 5 - 1); // one less now // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); - test(logId == KTestEventNum + 2); - test(viewIndex == 0); + TEST2(type, ELogChangeTypeEventDeleted); + TEST2(logId, KTestEventNum + 2); + TEST2(viewIndex, 0); // Navigate part way through the view so we have // a cursor position part way through... i=0; count = view->CountL(); - test(view->FirstL(active->iStatus)); + TEST(view->FirstL(active->iStatus)); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d"), i++, view->Event().Id()); + TEST2(active->iStatus.Int(), KErrNone); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); - RDebug::Print(_L("==\n")); - test(i == count); - test(view->Event().Id() == TLogId(0)); + TheTest.Printf(_L("==\n")); + TEST2(i, count); + TEST2(view->Event().Id(), TLogId(0)); // Save id TLogId savedId = view->Event().Id(); // Go one back - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -3579,31 +3574,31 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum + 2 - 5); // one more now - test(event->Id() == KTestEventNum + 3); + TEST2(count, KTestEventNum + 2 - 5); // one more now + TEST2(event->Id(), KTestEventNum + 3); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); - test(logId == KTestEventNum + 3); - test(viewIndex == 0); + TEST2(type, ELogChangeTypeEventAdded); + TEST2(logId, KTestEventNum + 3); + TEST2(viewIndex, 0); // Check we can still go forward to the last record - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == savedId); + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), savedId); // Go one back - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -3618,26 +3613,26 @@ active->StartL(); aClient.DeleteEvent(savedId, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum + 2 - 5 - 1); // one less + TEST2(count, KTestEventNum + 2 - 5 - 1); // one less // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); - test(logId == savedId); - test(viewIndex == KTestEventNum + 2 - 5 - 2); // last but one event + TEST2(type, ELogChangeTypeEventDeleted); + TEST2(logId, savedId); + TEST2(viewIndex, KTestEventNum + 2 - 5 - 2); // last but one event // Check we're now at the end of the view - test(!view->NextL(active->iStatus)); + TEST(!view->NextL(active->iStatus)); // Go to the first record - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -3652,17 +3647,17 @@ active->StartL(); aClient.DeleteEvent(savedId, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum - 5); + TEST2(count, KTestEventNum - 5); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); - test(logId == savedId); - test(viewIndex == 0); // first item + TEST2(type, ELogChangeTypeEventDeleted); + TEST2(logId, savedId); + TEST2(viewIndex, 0); // first item // Check 'next' navigation can be performed correctly count = 0; @@ -3671,19 +3666,19 @@ { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); ++count; } while(view->NextL(active->iStatus)); - test(count == KTestEventNum - 5 - 1); + TEST2(count, KTestEventNum - 5 - 1); // Check last record savedId = view->Event().Id(); - test(view->LastL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(savedId == view->Event().Id()); + TEST(view->LastL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(savedId, view->Event().Id()); // Check that changes work after a backup StartBackupL(); @@ -3698,20 +3693,20 @@ active->StartL(); aClient.DeleteEvent(savedId, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KTestEventNum - 6); + TEST2(count, KTestEventNum - 6); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); - test(logId == savedId); - test(viewIndex == count); // There's now one less item, and we deleted the last item of the previous view + TEST2(type, ELogChangeTypeEventDeleted); + TEST2(logId, savedId); + TEST2(viewIndex, count); // There's now one less item, and we deleted the last item of the previous view // Check we're still at the end of the view - test(!view->NextL(active->iStatus)); + TEST(!view->NextL(active->iStatus)); CleanupStack::PopAndDestroy(5, event); // view, changeObs, active, filter, event } @@ -3728,7 +3723,7 @@ */ LOCAL_C void TestViewChangeEvents2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0870 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0870 ")); // Transients TInt i=0; TInt count; @@ -3788,7 +3783,7 @@ aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(event->Id() == runningNewId++); + TEST2(event->Id(), runningNewId++); User::After(1 * 1000000); } // @@ -3808,7 +3803,7 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d\n"), i++, view->Event().Id()); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); @@ -3829,14 +3824,14 @@ aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(event->Id() == runningNewId++); + TEST2(event->Id(), runningNewId++); // Check changes changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); TEST2(type, ELogChangeTypeEventAdded); - TEST(logId == runningNewId-1); + TEST2(logId, runningNewId-1); TEST2(viewIndex, 0); // 8, [7], 6, 5, 4, 2, 1, 0 // Check we can go forward @@ -3859,7 +3854,7 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); // [8], 7, 6, 5, 4, 2, 1, 0 - TEST(view->Event().Id() == TLogId(KChangeEventTest2NumberOfEventsInView+1)); + TEST2(view->Event().Id(), TLogId(KChangeEventTest2NumberOfEventsInView+1)); // Delete added event changeObs->ResetChanges(); @@ -3875,7 +3870,7 @@ TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); TEST2(type, ELogChangeTypeEventDeleted); - TEST(logId == runningNewId-1); + TEST2(logId, runningNewId-1); TEST2(viewIndex, 0); // Go to end of view @@ -3884,7 +3879,7 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(view->Event().Id() == TLogId(0)); // 7, 6, 5, 4, 2, 1, [0] + TEST2(view->Event().Id(), TLogId(0)); // 7, 6, 5, 4, 2, 1, [0] // Add new event description[0] = TUint16('X'); @@ -3895,14 +3890,14 @@ aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(event->Id() == runningNewId++); + TEST2(event->Id(), runningNewId++); // Check changes changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); TEST2(type, ELogChangeTypeEventAdded); - TEST(logId == runningNewId-1); + TEST2(logId, runningNewId-1); TEST2(viewIndex, 0); // 9, 7, 6, 5, 4, 2, 1, [0] // Check we can't go forward @@ -3915,7 +3910,7 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(view->Event().Id() == TLogId(runningNewId-1)); // 9, 7, 6, 5, 4, 2, 1, [0] + TEST2(view->Event().Id(), TLogId(runningNewId-1)); // 9, 7, 6, 5, 4, 2, 1, [0] // Delete added event changeObs->ResetChanges(); @@ -3929,7 +3924,7 @@ TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); TEST2(type, ELogChangeTypeEventDeleted); - TEST(logId == runningNewId-1); + TEST2(logId, runningNewId-1); TEST2(viewIndex, 0); // Go part way through view @@ -3955,7 +3950,7 @@ aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - TEST(event->Id() == runningNewId++); + TEST2(event->Id(), runningNewId++); // Check changes changeCount = changeObs->Changes().Count(); @@ -4035,7 +4030,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KChangeEventTest2NumberOfEventsInView+1); + TEST2(count, KChangeEventTest2NumberOfEventsInView+1); // Check changes changeCount = changeObs->Changes().Count(); @@ -4233,7 +4228,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KChangeEventTest2NumberOfEventsInView - 1); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 1); changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); @@ -4247,7 +4242,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KChangeEventTest2NumberOfEventsInView - 2); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 2); changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); @@ -4261,7 +4256,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KChangeEventTest2NumberOfEventsInView - 3); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 3); changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); @@ -4275,7 +4270,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KChangeEventTest2NumberOfEventsInView - 4); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 4); changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); @@ -4289,7 +4284,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KChangeEventTest2NumberOfEventsInView - 5); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 5); changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); @@ -4303,7 +4298,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KChangeEventTest2NumberOfEventsInView - 6); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 6); changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); @@ -4336,7 +4331,7 @@ CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - TEST(count == KChangeEventTest2NumberOfEventsInView - 7); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 7); changeCount = changeObs->Changes().Count(); TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); @@ -4370,7 +4365,7 @@ */ LOCAL_C void TestViewChangeEvents2aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0871 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0871 ")); // Transients TInt i=0; TInt count; @@ -4429,36 +4424,36 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(event->Id() == runningNewId++); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(event->Id(), runningNewId++); User::After(1 * 1000000); } // - test(view->CountL() == 0); - active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(view->CountL(), 0); + active->StartL(); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView); - - - test(view->FirstL(active->iStatus)); + TEST2(count, KChangeEventTest2NumberOfEventsInView); + + + TEST(view->FirstL(active->iStatus)); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - RDebug::Print(_L("View Entry[%d]: Id: %d"), i++, view->Event().Id()); + TEST2(active->iStatus.Int(), KErrNone); + TheTest.Printf(_L("View Entry[%d]: Id: %d\r\n"), i++, view->Event().Id()); } while(view->NextL(active->iStatus)); // Check addition change events - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); // [7], 6, 5, 4, 2, 1, 0 - test(view->Event().Id() == 7); + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // [7], 6, 5, 4, 2, 1, 0 + TEST2(view->Event().Id(), 7); // Add a new entry - should appear as the first item in the view description[0] = TUint16('X'); @@ -4476,59 +4471,59 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(event->Id() == runningNewId++); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(event->Id(), runningNewId++); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); - test(logId == runningNewId-1); - test(viewIndex == 0); // 8, [7], 6, 5, 4, 2, 1, 0 + TEST2(type, ELogChangeTypeEventAdded); + TEST2(logId, runningNewId-1); + TEST2(viewIndex, 0); // 8, [7], 6, 5, 4, 2, 1, 0 // Check we can go forward - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(6)); // 8, 7, [6], 5, 4, 2, 1, 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(6)); // 8, 7, [6], 5, 4, 2, 1, 0 // Check we can now go back (new first entry) - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); // 8, [7], 6, 5, 4, 2, 1, 0 - test(view->Event().Id() == 7); - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); // [8], 7, 6, 5, 4, 2, 1, 0 - test(view->Event().Id() == TLogId(KChangeEventTest2NumberOfEventsInView+1)); + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // 8, [7], 6, 5, 4, 2, 1, 0 + TEST2(view->Event().Id(), 7); + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); // [8], 7, 6, 5, 4, 2, 1, 0 + TEST2(view->Event().Id(), TLogId(KChangeEventTest2NumberOfEventsInView+1)); // Delete added event changeObs->ResetChanges(); changeCount = changeObs->Changes().Count(); - test(changeCount == 0); + TEST2(changeCount, 0); active->StartL(); aClient.DeleteEvent(view->Event().Id(), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); // [7], 6, 5, 4, 2, 1, 0 + TEST2(active->iStatus.Int(), KErrNone); // [7], 6, 5, 4, 2, 1, 0 // Check deletion changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); - test(logId == runningNewId-1); - test(viewIndex == 0); + TEST2(type, ELogChangeTypeEventDeleted); + TEST2(logId, runningNewId-1); + TEST2(viewIndex, 0); // Go to end of view - test(view->LastL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(0)); // 7, 6, 5, 4, 2, 1, [0] + TEST(view->LastL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(0)); // 7, 6, 5, 4, 2, 1, [0] // Add new event description[0] = TUint16('X'); @@ -4546,53 +4541,53 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(event->Id() == runningNewId++); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(event->Id(), runningNewId++); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); - test(logId == runningNewId-1); - test(viewIndex == 0); // 9, 7, 6, 5, 4, 2, 1, [0] + TEST2(type, ELogChangeTypeEventAdded); + TEST2(logId, runningNewId-1); + TEST2(viewIndex, 0); // 9, 7, 6, 5, 4, 2, 1, [0] // Check we can't go forward - test(!view->NextL(active->iStatus)); + TEST(!view->NextL(active->iStatus)); // Go back to the first record - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(runningNewId-1)); // 9, 7, 6, 5, 4, 2, 1, [0] + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(runningNewId-1)); // 9, 7, 6, 5, 4, 2, 1, [0] // Delete added event changeObs->ResetChanges(); active->StartL(); aClient.DeleteEvent(view->Event().Id(), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); // [7], 6, 5, 4, 2, 1, 0 + TEST2(active->iStatus.Int(), KErrNone); // [7], 6, 5, 4, 2, 1, 0 // Check deletion changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); - test(logId == runningNewId-1); - test(viewIndex == 0); + TEST2(type, ELogChangeTypeEventDeleted); + TEST2(logId, runningNewId-1); + TEST2(viewIndex, 0); // Go part way through view - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(6)); // 7, [6], 5, 4, 2, 1, 0 - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(5)); // 7, 6, [5], 4, 2, 1, 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(6)); // 7, [6], 5, 4, 2, 1, 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(5)); // 7, 6, [5], 4, 2, 1, 0 // Add new event description[0] = TUint16('X'); @@ -4610,74 +4605,74 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(event->Id() == runningNewId++); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(event->Id(), runningNewId++); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); - test(logId == runningNewId-1); - test(viewIndex == 0); // 10, 7, 6, [5], 4, 2, 1, 0 + TEST2(type, ELogChangeTypeEventAdded); + TEST2(logId, runningNewId-1); + TEST2(viewIndex, 0); // 10, 7, 6, [5], 4, 2, 1, 0 changeObs->ResetChanges(); // Work back to beginning - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(6)); // 10, 7, [6], 5, 4, 2, 1, 0 - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(7)); // 10, [7], 6, 5, 4, 2, 1, 0 - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == runningNewId-1); // [10], 7, 6, 5, 4, 2, 1, 0 + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(6)); // 10, 7, [6], 5, 4, 2, 1, 0 + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(7)); // 10, [7], 6, 5, 4, 2, 1, 0 + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), runningNewId-1); // [10], 7, 6, 5, 4, 2, 1, 0 // Delete added event changeCount = changeObs->Changes().Count(); - test(changeCount == 0); + TEST2(changeCount, 0); active->StartL(); aClient.DeleteEvent(view->Event().Id(), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); // [7], 6, 5, 4, 2, 1, 0 + TEST2(active->iStatus.Int(), KErrNone); // [7], 6, 5, 4, 2, 1, 0 // Check deletion changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); - test(logId == runningNewId-1); - test(viewIndex == 0); + TEST2(type, ELogChangeTypeEventDeleted); + TEST2(logId, runningNewId-1); + TEST2(viewIndex, 0); changeObs->ResetChanges(); // Go back to the first record - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(7)); // [7], 6, 5, 4, 2, 1, 0 + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(7)); // [7], 6, 5, 4, 2, 1, 0 // Move one record forward - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(6)); // 7, [6], 5, 4, 2, 1, 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(6)); // 7, [6], 5, 4, 2, 1, 0 // Change 'Z' event so that it now appears in the view changeCount = changeObs->Changes().Count(); - test(changeCount == 0); + TEST2(changeCount ,0); active->StartL(); event->SetId(TLogId(3)); aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // event->SetContact(KTestContact); active->StartL(); @@ -4692,44 +4687,44 @@ changeObs->StartCollectingChanges(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView+1); + TEST2(count, KChangeEventTest2NumberOfEventsInView+1); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); // Change resulted in an addition to the view - test(logId == TLogId(3)); - test(viewIndex == 4); // 7, [6], 5, 4, 3, 2, 1, 0 + TEST2(type, ELogChangeTypeEventAdded); // Change resulted in an addition to the view + TEST2(logId, TLogId(3)); + TEST2(viewIndex, 4); // 7, [6], 5, 4, 3, 2, 1, 0 changeObs->ResetChanges(); // Move forwards and check - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(5)); // 7, 6, [5], 4, 3, 2, 1, 0 - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(4)); // 7, 6, 5, [4], 3, 2, 1, 0 - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(3)); // 7, 6, 5, 4, [3], 2, 1, 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(5)); // 7, 6, [5], 4, 3, 2, 1, 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(4)); // 7, 6, 5, [4], 3, 2, 1, 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(3)); // 7, 6, 5, 4, [3], 2, 1, 0 // Change 'Z' event so that its now missing from the view again changeCount = changeObs->Changes().Count(); - test(changeCount == 0); + TEST2(changeCount ,0); active->StartL(); event->SetId(TLogId(3)); aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // event->SetContact(0); active->StartL(); @@ -4744,46 +4739,46 @@ changeObs->StartCollectingChanges(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView); + TEST2(count, KChangeEventTest2NumberOfEventsInView); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(3)); - test(viewIndex == 4); // 7, 6, 5, 4, [2], 1, 0 + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(3)); + TEST2(viewIndex, 4); // 7, 6, 5, 4, [2], 1, 0 changeObs->ResetChanges(); // Move forwards and check - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(1)); // 7, 6, 5, 4, 2, [1], 0 - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(0)); // 7, 6, 5, 4, 2, 1, [0] + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(1)); // 7, 6, 5, 4, 2, [1], 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(0)); // 7, 6, 5, 4, 2, 1, [0] // Move back one - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(1)); // 7, 6, 5, 4, 2, [1], 0 + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(1)); // 7, 6, 5, 4, 2, [1], 0 changeCount = changeObs->Changes().Count(); - test(changeCount == 0); + TEST2(changeCount ,0); // Change 'Z' event so that it now appears in the view active->StartL(); event->SetId(TLogId(3)); aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // event->SetContact(KTestContact); active->StartL(); @@ -4798,56 +4793,56 @@ changeObs->StartCollectingChanges(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView+1); + TEST2(count, KChangeEventTest2NumberOfEventsInView+1); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); // Change resulted in an addition to the view - test(logId == TLogId(3)); - test(viewIndex == 4); // 7, 6, 5, 4, 3, 2, [1], 0 + TEST2(type, ELogChangeTypeEventAdded); // Change resulted in an addition to the view + TEST2(logId, TLogId(3)); + TEST2(viewIndex, 4); // 7, 6, 5, 4, 3, 2, [1], 0 changeObs->ResetChanges(); // Check can only move forward one more record - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(0)); // 7, 6, 5, 4, 3, 2, 1, [0] + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(0)); // 7, 6, 5, 4, 3, 2, 1, [0] // Move back until we are before the inserted record - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(1)); // 7, 6, 5, 4, 3, 2, [1], 0 - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(2)); // 7, 6, 5, 4, 3, [2], 1, 0 - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(3)); // 7, 6, 5, 4, [3], 2, 1, 0 - test(view->PreviousL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(4)); // 7, 6, 5, [4], 3, 2, 1, 0 + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(1)); // 7, 6, 5, 4, 3, 2, [1], 0 + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(2)); // 7, 6, 5, 4, 3, [2], 1, 0 + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(3)); // 7, 6, 5, 4, [3], 2, 1, 0 + TEST(view->PreviousL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(4)); // 7, 6, 5, [4], 3, 2, 1, 0 changeCount = changeObs->Changes().Count(); - test(changeCount == 0); + TEST2(changeCount ,0); // Change 'Z' event so that its now missing from the view again active->StartL(); event->SetId(TLogId(3)); aClient.GetEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // event->SetContact(0); active->StartL(); @@ -4862,158 +4857,158 @@ changeObs->StartCollectingChanges(); aClient.ChangeEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView); + TEST2(count, KChangeEventTest2NumberOfEventsInView); // Check changes changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(3)); - test(viewIndex == 4); // 7, 6, 5, [4], 2, 1, 0 + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(3)); + TEST2(viewIndex, 4); // 7, 6, 5, [4], 2, 1, 0 changeObs->ResetChanges(); // Check navigating to the end of the view - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(2)); // 7, 6, 5, 4, [2], 1, 0 - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(1)); // 7, 6, 5, 4, 2, [1], 0 - test(view->NextL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(0)); // 7, 6, 5, 4, 2, 1, [0] + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(2)); // 7, 6, 5, 4, [2], 1, 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(1)); // 7, 6, 5, 4, 2, [1], 0 + TEST(view->NextL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(0)); // 7, 6, 5, 4, 2, 1, [0] changeCount = changeObs->Changes().Count(); - test(changeCount == 0); - test(!view->NextL(active->iStatus)); + TEST2(changeCount ,0); + TEST(!view->NextL(active->iStatus)); // Delete everything in the view and make sure we can't navigate anymore. active->StartL(); aClient.DeleteEvent(TLogId(4), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView - 1); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 1); changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(4)); - test(viewIndex == 3); // 7, 6, 5, 2, 1, [0] + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(4)); + TEST2(viewIndex, 3); // 7, 6, 5, 2, 1, [0] changeObs->ResetChanges(); // active->StartL(); aClient.DeleteEvent(TLogId(7), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView - 2); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 2); changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(7)); - test(viewIndex == 0); // 6, 5, 2, 1, [0] + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(7)); + TEST2(viewIndex, 0); // 6, 5, 2, 1, [0] changeObs->ResetChanges(); // active->StartL(); aClient.DeleteEvent(TLogId(0), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView - 3); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 3); changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(0)); - test(viewIndex == 4); // 6, 5, 2, [1] + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(0)); + TEST2(viewIndex, 4); // 6, 5, 2, [1] changeObs->ResetChanges(); // active->StartL(); aClient.DeleteEvent(TLogId(5), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView - 4); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 4); changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(5)); - test(viewIndex == 1); // 6, 2, [1] + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(5)); + TEST2(viewIndex, 1); // 6, 2, [1] changeObs->ResetChanges(); // active->StartL(); aClient.DeleteEvent(TLogId(2), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView - 5); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 5); changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(2)); - test(viewIndex == 1); // 6, [1] + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(2)); + TEST2(viewIndex, 1); // 6, [1] changeObs->ResetChanges(); // active->StartL(); aClient.DeleteEvent(TLogId(6), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView - 6); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 6); changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(6)); - test(viewIndex == 0); // [1] + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(6)); + TEST2(viewIndex, 0); // [1] changeObs->ResetChanges(); // Check we can't go backwards or forwards - test(!view->NextL(active->iStatus)); - test(!view->PreviousL(active->iStatus)); - test(view->FirstL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(1)); // [1] - test(view->LastL(active->iStatus)); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->Event().Id() == TLogId(1)); // [1] + TEST(!view->NextL(active->iStatus)); + TEST(!view->PreviousL(active->iStatus)); + TEST(view->FirstL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(1)); // [1] + TEST(view->LastL(active->iStatus)); + active->StartL(); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->Event().Id(), TLogId(1)); // [1] // Delete last event in view active->StartL(); aClient.DeleteEvent(TLogId(1), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); count = view->CountL(); - test(count == KChangeEventTest2NumberOfEventsInView - 7); + TEST2(count, KChangeEventTest2NumberOfEventsInView - 7); changeCount = changeObs->Changes().Count(); - test(changeCount == 1); + TEST2(changeCount, 1); type = changeObs->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); // Change resulted in a removal from the view - test(logId == TLogId(1)); - test(viewIndex == 0); // *Empty* + TEST2(type, ELogChangeTypeEventDeleted); // Change resulted in a removal from the view + TEST2(logId, TLogId(1)); + TEST2(viewIndex, 0); // *Empty* changeObs->ResetChanges(); // Check we can't navigate - test(!view->NextL(active->iStatus)); - test(!view->PreviousL(active->iStatus)); - test(!view->FirstL(active->iStatus)); - test(!view->LastL(active->iStatus)); + TEST(!view->NextL(active->iStatus)); + TEST(!view->PreviousL(active->iStatus)); + TEST(!view->FirstL(active->iStatus)); + TEST(!view->LastL(active->iStatus)); CleanupStack::PopAndDestroy(5, event); // view, changeObs, active, filter, event } @@ -5029,7 +5024,7 @@ */ LOCAL_C void TestViewFilteringDefect1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0872 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0872 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -5226,7 +5221,7 @@ */ LOCAL_C void TestDeletingViewWithinObserverCallbackL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0873 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0873 ")); TestUtils::DeleteDatabaseL(); TInt error = 0; @@ -5472,7 +5467,7 @@ __ASSERT_ALWAYS(active->iStatus == KErrNone, User::Panic(_L("ThreadPanic"), 1)); ++count; LEAVE_IF_ERROR(aThreadData.iArray->Append(event->Id())); - // RDebug::Print(_L("EAdd: i:%d count:%d, id:%d\n"), i, aThreadData.iArray->Count(), event->Id()); + // TheTest.Printf(_L("EAdd: i:%d count:%d, id:%d\n"), i, aThreadData.iArray->Count(), event->Id()); // Have to wait for a minimum of 1 ms here because otherwise DMBS sorts records (by time) // in an arbitrary manor @@ -5580,7 +5575,7 @@ */ LOCAL_C void TestNavigationWhilstBusyL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0874 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0874 ")); TestUtils::DeleteDatabaseL(); TInt error = 0; @@ -5598,7 +5593,7 @@ type->SetUid(TEST_LOG_UID); type->SetDescription(KTestEventDesc); type->SetLoggingEnabled(ETrue); - RDebug::Print(_L("\nTest event type added %x\n"),TEST_LOG_UID ); + TheTest.Printf(_L("\nTest event type added %x\n"),TEST_LOG_UID ); // Register the event type active->StartL(); @@ -5615,7 +5610,7 @@ CleanupStack::PushL(filter); filter->SetEventType(TEST_LOG_UID); TBool res = view->SetFilterL(*filter, active->iStatus); - test(!res); + TEST(!res); // increase the default log size TLogConfig Config; @@ -5643,107 +5638,107 @@ thread.Resume(); // Suspend this thread - RDebug::Print(_L("TEST CODE: Suspending thread for 2 seconds\n")); + TheTest.Printf(_L("TEST CODE: Suspending thread for 2 seconds\n")); CLogSchedulerTimer* timer = CLogSchedulerTimer::NewLC(); timer->Wait(10 * 1000000); // Apply the filter now there are some records - RDebug::Print(_L("TEST CODE: Setting filter again - should be some records now\n")); + TheTest.Printf(_L("TEST CODE: Setting filter again - should be some records now\n")); res = view->SetFilterL(*filter, active->iStatus); - test(res); - active->StartL(); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone || active->iStatus == KErrCancel); // KErrCancel when the worker thread clears the log at the same time as we are navigating to the first record + TEST(res); + active->StartL(); + CActiveScheduler::Start(); + TEST(active->iStatus == KErrNone || active->iStatus == KErrCancel); // KErrCancel when the worker thread clears the log at the same time as we are navigating to the first record count = view->CountL(); - test(count > 0); + TEST(count > 0); // Navigate around (up and down) whilst events are being created count = view->CountL(); res = view->FirstL(active->iStatus); - test(res); + TEST(res); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone || active->iStatus == KErrCancel); + TEST(active->iStatus == KErrNone || active->iStatus == KErrCancel); count--; if (active->iStatus == KErrNone) - test(view->Event().Id() != KLogNullId); + TEST(view->Event().Id() != KLogNullId); } while(view->NextL(active->iStatus)); timer->Wait(5 * 1000000); count = view->CountL(); res = view->FirstL(active->iStatus); - test(res); + TEST(res); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone || active->iStatus == KErrCancel); + TEST(active->iStatus == KErrNone || active->iStatus == KErrCancel); count--; if (active->iStatus == KErrNone) - test(view->Event().Id() != KLogNullId); + TEST(view->Event().Id() != KLogNullId); } while(view->NextL(active->iStatus)); timer->Wait(5 * 1000000); count = view->CountL(); res = view->LastL(active->iStatus); - test(res); + TEST(res); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone || active->iStatus == KErrCancel); + TEST(active->iStatus == KErrNone || active->iStatus == KErrCancel); count--; if (active->iStatus == KErrNone) - test(view->Event().Id() != KLogNullId); + TEST(view->Event().Id() != KLogNullId); } while(view->PreviousL(active->iStatus)); timer->Wait(5 * 1000000); count = view->CountL(); res = view->FirstL(active->iStatus); - test(res); + TEST(res); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone || active->iStatus == KErrCancel); + TEST(active->iStatus == KErrNone || active->iStatus == KErrCancel); count--; if (active->iStatus == KErrNone) - test(view->Event().Id() != KLogNullId); + TEST(view->Event().Id() != KLogNullId); } while(view->NextL(active->iStatus)); timer->Wait(5 * 1000000); count = view->CountL(); res = view->LastL(active->iStatus); - test(res); + TEST(res); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone || active->iStatus == KErrCancel); + TEST(active->iStatus == KErrNone || active->iStatus == KErrCancel); count--; if (active->iStatus == KErrNone) - test(view->Event().Id() != KLogNullId); + TEST(view->Event().Id() != KLogNullId); } while(view->PreviousL(active->iStatus)); timer->Wait(5 * 1000000); count = view->CountL(); res = view->LastL(active->iStatus); - test(res); + TEST(res); do { active->StartL(); CActiveScheduler::Start(); - test(active->iStatus == KErrNone || active->iStatus == KErrCancel); + TEST(active->iStatus == KErrNone || active->iStatus == KErrCancel); count--; if (active->iStatus == KErrNone) - test(view->Event().Id() != KLogNullId); + TEST(view->Event().Id() != KLogNullId); } while(view->PreviousL(active->iStatus)); // STOP THE WORKER THREAD threadData.iStopThread = ETrue; - RDebug::Print(_L("Stopping worker thread\n")); + TheTest.Printf(_L("Stopping worker thread\n")); timer->Wait(30 * 1000000); // do some checks on the log @@ -5752,20 +5747,20 @@ active->StartL(); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("MaxLogSize:%ld MaxRecentLogSize:%d\n"), + TheTest.Printf(_L("MaxLogSize:%ld MaxRecentLogSize:%d\n"), logConfig.iMaxLogSize, logConfig.iMaxRecentLogSize ); - test(logConfig.iMaxLogSize > logConfig.iMaxRecentLogSize); + TEST(logConfig.iMaxLogSize > logConfig.iMaxRecentLogSize); /* Check the log has not overflowed. If this fails either increase the log size or reduce the time the worker thread has been running */ - test (arrayOfIds.Count() < kMaxLogSize); + TEST(arrayOfIds.Count() < kMaxLogSize); // Loop though the logevents created by the worker thread and compare against the // data stored in arrayOfIds. res = view->LastL(active->iStatus); - test(res); + TEST(res); count = 0; do { active->StartL(); @@ -5775,10 +5770,10 @@ const TLogId logId = view->Event().Id(); const TLogId arrayId = arrayOfIds[count]; if (logId != arrayId) - RDebug::Print(_L("Events[%d] - array:%5d, id:%5d ****\n"), count, arrayId, logId); + TheTest.Printf(_L("Events[%d] - array:%5d, id:%5d ****\n"), count, arrayId, logId); // Note: If this test fails the fist thing to check is the time delay after EAdd. // If several events get the same time stamp, the order is arbitrary and the test fails here. - test(logId == arrayId); + TEST2(logId, arrayId); count++; } while(view->PreviousL(active->iStatus)); @@ -5807,7 +5802,7 @@ */ LOCAL_C void INC123066L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4014 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4014 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); event->SetEventType(KLogCallEventTypeUid); @@ -5883,7 +5878,7 @@ */ LOCAL_C void INC136334L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4017 ")); + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4017 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -5962,7 +5957,7 @@ { TheMatchingIsEnabled = TestUtils::MatchingEnabledL(); - TestUtils::Initialize(_L("T_LOGVIEW1")); + TestUtils::Initialize(_L("t_logview1")); TestUtils::DeleteDatabaseL(); CLogClient* client = CLogClient::NewL(theFs); @@ -5971,87 +5966,87 @@ CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); CleanupStack::PushL(notifier); - test.Start(_L("Event View With No Filter")); + TheTest.Start(_L("Event View With No Filter")); TestEventViewL(*client); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("Event View Filter alternative")); + TheTest.Next(_L("Event View Filter alternative")); TestViewFilteringDefect1L(*client); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("Event View With Filter")); + TheTest.Next(_L("Event View With Filter")); TestEventViewFilter1L(*client); TestEventViewFilter2L(*client); - test.Next(_L("INC123066 - LogView not updated if SetFilterL found no event")); + TheTest.Next(_L("INC123066 - LogView not updated if SetFilterL found no event")); INC123066L(*client); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Recent View")); + TheTest.Next(_L("Recent View")); TestRecentView1L(*client); TestRecentView2L(*client); theLog.Write(_L8("Test 4 OK\n")); - test.Next(_L("Removing recent events")); + TheTest.Next(_L("Removing recent events")); TestRecentRemove1L(*client); TestRecentRemove2L(*client); theLog.Write(_L8("Test 5 OK\n")); - test.Next(_L("Duplicate View")); + TheTest.Next(_L("Duplicate View")); TestDuplicateViewL(*client); theLog.Write(_L8("Test 6 OK\n")); - test.Next(_L("Removing duplicate events")); + TheTest.Next(_L("Removing duplicate events")); TestDuplicateRemoveL(*client); theLog.Write(_L8("Test 7 OK\n")); - test.Next(_L("Check purge performed on view setup")); + TheTest.Next(_L("Check purge performed on view setup")); TestPurgeOnSetup1L(*client); TestPurgeOnSetup2L(*client); theLog.Write(_L8("Test 8 OK\n")); - test.Next(_L("View Purging")); + TheTest.Next(_L("View Purging")); TestViewPurgeL(*client); theLog.Write(_L8("Test 9 OK\n")); - test.Next(_L("Clearing duplicate lists")); + TheTest.Next(_L("Clearing duplicate lists")); TestClearDuplicatesL(*client); theLog.Write(_L8("Test 10 OK\n")); - test.Next(_L("Phone number matching")); + TheTest.Next(_L("Phone number matching")); TestPhoneNumberMatchingL(*client); theLog.Write(_L8("Test 11 OK\n")); - test.Next(_L("view flags setting/clearing")); + TheTest.Next(_L("view flags setting/clearing")); TestViewFlagsL(*client); theLog.Write(_L8("Test 12 OK\n")); - test.Next(_L("Recent view flags setting/clearing")); + TheTest.Next(_L("Recent view flags setting/clearing")); TestRecentFlagsL(*client); theLog.Write(_L8("Test 13 OK\n")); - test.Next(_L("View change tests 1")); + TheTest.Next(_L("View change tests 1")); TestViewChangeEvents1L(*client); TestViewChangeEvents1aL(*client); theLog.Write(_L8("Test 14 OK\n")); - test.Next(_L("View change tests 2")); + TheTest.Next(_L("View change tests 2")); TestViewChangeEvents2L(*client); TestViewChangeEvents2aL(*client); theLog.Write(_L8("Test 15 OK\n")); - test.Next(_L("View deletion from within callback")); + TheTest.Next(_L("View deletion from within callback")); TestDeletingViewWithinObserverCallbackL(*client); theLog.Write(_L8("Test 16 OK\n")); - test.Next(_L("Test navigation whilst events are added")); + TheTest.Next(_L("Test navigation whilst events are added")); TestNavigationWhilstBusyL(*client); theLog.Write(_L8("Test 17 OK\n")); - test.Next(_L("Defect INC105010 - phone number matching")); + TheTest.Next(_L("Defect INC105010 - phone number matching")); INC105010L(*client); theLog.Write(_L8("Test 18 OK\n")); - test.Next(_L("INC136334 - The miss call log won't show if you have ' in your contact")); + TheTest.Next(_L("INC136334 - The miss call log won't show if you have ' in your contact")); INC136334L(*client); theLog.Write(_L8("Test 19 OK\n")); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logview2.cpp --- a/loggingservices/eventlogger/test/src/t_logview2.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logview2.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2003-2010 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" @@ -16,12 +16,10 @@ #include #include #include -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log View Test Harness Number 2")); +RTest TheTest(_L("t_logview2")); const TInt KTestEventNum = 20; const TInt KTestErrorEventNum = 3; @@ -55,7 +53,7 @@ */ LOCAL_C void TestEventViewWithFilterListL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0930 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0930 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -534,7 +532,7 @@ */ LOCAL_C void TestEventViewWithTimestampsInFilterListL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3432 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3432 ")); TTime testStartTime; testStartTime.UniversalTime(); TTime tomorrow = testStartTime + (TTimeIntervalDays)1; @@ -735,7 +733,7 @@ */ LOCAL_C void TestRecentViewWithFilterL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0931 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0931 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -847,7 +845,7 @@ */ LOCAL_C void TestRecentViewWithFilterListL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0932 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0932 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -967,7 +965,7 @@ */ LOCAL_C void TestDuplicateViewWithFilterL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0933 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0933 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -1087,7 +1085,7 @@ */ LOCAL_C void TestDuplicateViewWithFilterListL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0934 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0934 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -1203,7 +1201,7 @@ */ LOCAL_C void TestEventViewForNullFieldsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0935 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0935 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -1386,7 +1384,7 @@ */ LOCAL_C void TestRecentViewForNullFieldsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0936 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0936 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -1494,7 +1492,7 @@ */ LOCAL_C void TestDuplicateViewForNullFieldsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0937 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0937 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -1630,7 +1628,7 @@ */ LOCAL_C void TestEventViewForFlagsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0938 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0938 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -1741,7 +1739,7 @@ */ LOCAL_C void TestRecentViewForFlagsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0939 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0939 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -1859,7 +1857,7 @@ */ LOCAL_C void TestDuplicateViewForFlagsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0940 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0940 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -1978,7 +1976,7 @@ */ LOCAL_C void TestRemovingRecentEventsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0941 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0941 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -2051,7 +2049,7 @@ */ LOCAL_C void TestRemovingDuplicateEventsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0942 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0942 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -2092,7 +2090,7 @@ aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); - RDebug::Print(_L("EVENT ID: %d\n"), event->Id()); + TheTest.Printf(_L("EVENT ID: %d\n"), event->Id()); } // Create the view @@ -2142,7 +2140,7 @@ */ LOCAL_C void TestMultipleViews1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0943 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0943 ")); CTestActive* active1 = new(ELeave)CTestActive; CleanupStack::PushL(active1); @@ -2714,7 +2712,7 @@ */ LOCAL_C void TestMultipleViews2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0944 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0944 ")); CTestActive* active1 = new(ELeave)CTestActive; CleanupStack::PushL(active1); @@ -3289,7 +3287,7 @@ */ LOCAL_C void TestViewChangeEventsL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0945 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0945 ")); TestUtils::DeleteDatabaseL(); CLogEvent* event = CLogEvent::NewL(); @@ -3342,7 +3340,7 @@ */ LOCAL_C void TestAltEventsInRecentListL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0946 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0946 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -3440,7 +3438,7 @@ */ LOCAL_C void TestFilterByTimeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0947 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0947 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -3571,7 +3569,7 @@ */ LOCAL_C void TestHiddenChangeEvents1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0948 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0948 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -3687,7 +3685,7 @@ */ LOCAL_C void TestHiddenChangeEvents2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0949 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0949 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -3810,7 +3808,7 @@ */ LOCAL_C void TestHiddenChangeEvents3L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0950 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0950 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -3931,7 +3929,7 @@ */ LOCAL_C void TestHiddenChangeEvents4L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0951 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0951 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -4042,7 +4040,7 @@ */ LOCAL_C void TestHiddenChangeEvents5L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0952 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0952 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -4152,7 +4150,7 @@ */ LOCAL_C void TestHiddenChangeEvents6L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0953 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0953 ")); CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); changeObs1->StartCollectingChanges(); @@ -4261,7 +4259,7 @@ */ LOCAL_C void TestHiddenChangeEvents7L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0954 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0954 ")); CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); changeObs1->StartCollectingChanges(); @@ -4363,7 +4361,7 @@ */ LOCAL_C void DEF066296L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1363 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1363 ")); TBuf buf; CLogEvent* event = CLogEvent::NewL(); @@ -4388,7 +4386,7 @@ // Set up the view to display the recent call list active->StartL(); - test(view->SetRecentListL(-1, active->iStatus)); + TEST(view->SetRecentListL(-1, active->iStatus)); CActiveScheduler::Start(); TEST2(active->iStatus.Int(), KErrNone); @@ -4397,14 +4395,14 @@ now.UniversalTime(); TBuf<0x80> testString; now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); - RDebug::Print(_L("Current UTC time - %S\n"), &testString); + TheTest.Printf(_L("Current UTC time - %S\n"), &testString); // Move the UTC time forward by one day now += TTimeIntervalDays(1); User::SetUTCTime(now); now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); - RDebug::Print(_L("Changed UTC time to - %S\n"), &testString); + TheTest.Printf(_L("Changed UTC time to - %S\n"), &testString); // Set up the event and log a call from number 555 event->SetNumber(_L("555")); @@ -4458,7 +4456,7 @@ User::SetUTCTime(now); now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); - RDebug::Print(_L("Restored UTC time to - %S\n"), &testString); + TheTest.Printf(_L("Restored UTC time to - %S\n"), &testString); CleanupStack::PopAndDestroy(3, event); //event, active, view } @@ -4473,7 +4471,7 @@ */ LOCAL_C void DEF087459L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1807 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1807 ")); RTz tz; TInt err = tz.Connect(); TEST2(err, KErrNone); @@ -4486,7 +4484,7 @@ TBuf<0x80> testString; now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); - RDebug::Print(_L("Current home time - %S\n"), &testString); + TheTest.Printf(_L("Current home time - %S\n"), &testString); // Problem occurred between midnight and 01:00am hometime, so change home time to // be 00:30am @@ -4504,8 +4502,8 @@ // Get and print new home time now.HomeTime(); now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); - RDebug::Print(_L("Changed home time to - %S\n"), &testString); - RDebug::Print(_L("Re-running DEF066296 test\n")); + TheTest.Printf(_L("Changed home time to - %S\n"), &testString); + TheTest.Printf(_L("Re-running DEF066296 test\n")); DEF066296L(aClient); @@ -4514,7 +4512,7 @@ TEST2(err, KErrNone); now.HomeTime(); now.FormatL(testString,(_L("%H:%T %1\\%2\\%3 %E"))); - RDebug::Print(_L("Restored home time to - %S\n"), &testString); + TheTest.Printf(_L("Restored home time to - %S\n"), &testString); CleanupStack::PopAndDestroy(); //tz } @@ -4529,7 +4527,7 @@ */ LOCAL_C void TestChangeEventRecentView1L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0955 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0955 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -4811,7 +4809,7 @@ */ LOCAL_C void TestChangeEventRecentView2L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0956 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0956 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -5091,7 +5089,7 @@ */ LOCAL_C void TestChangeEventRecentViewAndPurgeL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0957 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0957 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -5332,7 +5330,7 @@ */ LOCAL_C void TestChangeEventRecentViewRemoveL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0958 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0958 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -5511,12 +5509,12 @@ LOCAL_C void TestLogOpenL() { - test(IsLogOpenL()); + TEST(IsLogOpenL()); } LOCAL_C void TestLogClosedL() { - test(!IsLogOpenL()); + TEST(!IsLogOpenL()); } LOCAL_C void StartBackupL() @@ -5563,7 +5561,7 @@ */ LOCAL_C void TestHiddenChangeEvents1aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0959 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0959 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -5592,7 +5590,7 @@ active->StartL(); aClient.ClearLog(now, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus.Int() == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Incoming call event event->SetEventType(KLogCallEventTypeUid); @@ -5604,13 +5602,13 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Setup normal event view active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); changeObs2->StartCollectingChanges(); @@ -5620,16 +5618,16 @@ // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == 1); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), 1); // Add a new event active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -5639,28 +5637,28 @@ DelayL(1000000); TestLogOpenL(); - test(changeObs2->Changes().Count() == 2); + TEST2(changeObs2->Changes().Count(), 2); type = changeObs2->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); + TEST2(type, ELogChangeTypeEventAdded); type = changeObs2->Changes().At(1, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); + TEST2(type, ELogChangeTypeEventDeleted); // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == 1); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), 1); CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); CleanupStack::PushL(duplicate); // Check duplicate count active->StartL(); - test(recent->DuplicatesL(*duplicate, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus.Int() == KErrNone); - test(duplicate->CountL() == 1); + TEST(recent->DuplicatesL(*duplicate, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(duplicate->CountL(), 1); // Check that changes work after a backup StartBackupL(); @@ -5671,9 +5669,9 @@ // Check change events User::After(100000); - test(changeObs1->Changes().Count() == 1); + TEST2(changeObs1->Changes().Count(), 1); type = changeObs1->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); + TEST2(type, ELogChangeTypeEventAdded); CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate } @@ -5690,7 +5688,7 @@ */ LOCAL_C void TestHiddenChangeEvents2aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0960 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0960 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -5718,14 +5716,14 @@ active->StartL(); aClient.ClearLog(now, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus.Int() == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Get config TLogConfig config; active->StartL(); aClient.GetConfig(config, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Incoming call event event->SetEventType(KLogCallEventTypeUid); @@ -5741,14 +5739,14 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); } // Setup normal event view active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); changeObs2->StartCollectingChanges(); @@ -5758,17 +5756,17 @@ // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == config.iMaxRecentLogSize); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), config.iMaxRecentLogSize); // Add a new event, will cause one to be purged from recent view event->SetContact(1234); active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -5778,24 +5776,24 @@ TestLogOpenL(); DelayL(1000000); - test(changeObs2->Changes().Count() == 2); + TEST2(changeObs2->Changes().Count(), 2); type = changeObs2->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); + TEST2(type, ELogChangeTypeEventAdded); type = changeObs2->Changes().At(1, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); + TEST2(type, ELogChangeTypeEventDeleted); // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == config.iMaxRecentLogSize); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), config.iMaxRecentLogSize); CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); CleanupStack::PushL(duplicate); // Check duplicate count - test(!recent->DuplicatesL(*duplicate, active->iStatus)); + TEST(!recent->DuplicatesL(*duplicate, active->iStatus)); // Check that changes work after a backup StartBackupL(); @@ -5806,9 +5804,9 @@ // Check change events User::After(100000); - test(changeObs1->Changes().Count() == 1); + TEST2(changeObs1->Changes().Count(), 1); type = changeObs1->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); + TEST2(type, ELogChangeTypeEventAdded); CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate } @@ -5825,7 +5823,7 @@ */ LOCAL_C void TestHiddenChangeEvents3aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0961 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0961 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -5853,19 +5851,19 @@ active->StartL(); aClient.ClearLog(now, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus.Int() == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Get and set config TLogConfig config; active->StartL(); aClient.GetConfig(config, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); config.iMaxRecentLogSize = 2; active->StartL(); aClient.ChangeConfig(config, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Incoming call event event->SetEventType(KLogCallEventTypeUid); @@ -5881,14 +5879,14 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); } // Setup normal event view active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); changeObs2->StartCollectingChanges(); @@ -5898,17 +5896,17 @@ // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == config.iMaxRecentLogSize); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), config.iMaxRecentLogSize); // Change config, will cause one event to be purged from recent view config.iMaxRecentLogSize = 1; active->StartL(); aClient.ChangeConfig(config, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -5920,22 +5918,22 @@ // Check change events User::After(100000); - test(changeObs2->Changes().Count() == 1); + TEST2(changeObs2->Changes().Count(), 1); type = changeObs2->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); + TEST2(type, ELogChangeTypeEventDeleted); // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == config.iMaxRecentLogSize); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), config.iMaxRecentLogSize); CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); CleanupStack::PushL(duplicate); // Check duplicate count - test(!recent->DuplicatesL(*duplicate, active->iStatus)); + TEST(!recent->DuplicatesL(*duplicate, active->iStatus)); // Check that changes work after a backup StartBackupL(); @@ -5946,7 +5944,7 @@ // Check change events User::After(100000); - test(!changeObs1->HaveChanges()); + TEST(!changeObs1->HaveChanges()); CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate } @@ -5964,7 +5962,7 @@ */ LOCAL_C void TestHiddenChangeEvents4aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0962 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0962 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -5993,7 +5991,7 @@ active->StartL(); aClient.ClearLog(now, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus.Int() == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Incoming call event event->SetEventType(KLogCallEventTypeUid); @@ -6007,13 +6005,13 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Add an event active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); event->ClearFlags(0xF); @@ -6021,14 +6019,14 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Setup normal event view active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->CountL() == 2); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->CountL(), 2); CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); changeObs2->StartCollectingChanges(); @@ -6038,10 +6036,10 @@ // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == 1); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), 1); changeObs1->StartCollectingChanges(); changeObs2->StartCollectingChanges(); @@ -6050,7 +6048,7 @@ active->StartL(); aClient.DeleteEvent(event->Id(), active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -6060,13 +6058,13 @@ TestLogOpenL(); // Check change events - test(changeObs2->Changes().Count() == 2); + TEST2(changeObs2->Changes().Count(), 2); type = changeObs2->Changes().At(0, logId, viewIndex); - test(type == ELogChangeTypeEventAdded); + TEST2(type, ELogChangeTypeEventAdded); type = changeObs2->Changes().At(1, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); - - test(!changeObs1->HaveChanges()); + TEST2(type, ELogChangeTypeEventDeleted); + + TEST(!changeObs1->HaveChanges()); CleanupStack::PopAndDestroy(7, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent } @@ -6082,7 +6080,7 @@ */ LOCAL_C void TestHiddenChangeEvents5aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0963 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0963 ")); TLogId logId; TInt viewIndex; TLogDatabaseChangeType type; @@ -6110,14 +6108,14 @@ active->StartL(); aClient.ClearLog(now, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus.Int() == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Get config TLogConfig config; active->StartL(); aClient.GetConfig(config, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Incoming call event event->SetEventType(KLogCallEventTypeUid); @@ -6133,14 +6131,14 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); } // Setup normal event view active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); changeObs2->StartCollectingChanges(); @@ -6150,16 +6148,16 @@ // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == config.iMaxRecentLogSize); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), config.iMaxRecentLogSize); // Clear recent view active->StartL(); aClient.ClearLog(KLogRecentIncomingCalls, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Check that changes work after a backup StartBackupL(); @@ -6169,15 +6167,15 @@ TestLogOpenL(); count = config.iMaxRecentLogSize; - test(changeObs2->Changes().Count() == count); + TEST2(changeObs2->Changes().Count(), count); while(count--) { type = changeObs2->Changes().At(count, logId, viewIndex); - test(type == ELogChangeTypeEventDeleted); + TEST2(type, ELogChangeTypeEventDeleted); } // Check recent view - test(!recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + TEST(!recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); // Check that changes work after a backup StartBackupL(); @@ -6188,7 +6186,7 @@ // Check change events User::After(100000); - test(!changeObs1->HaveChanges()); + TEST(!changeObs1->HaveChanges()); CleanupStack::PopAndDestroy(7, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent } @@ -6204,7 +6202,7 @@ */ LOCAL_C void TestHiddenChangeEvents6aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0964 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0964 ")); CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); changeObs1->StartCollectingChanges(); @@ -6228,7 +6226,7 @@ active->StartL(); aClient.ClearLog(now, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus.Int() == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Incoming call event event->SetEventType(KLogCallEventTypeUid); @@ -6240,20 +6238,20 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Add a duplicate active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Setup normal event view active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->CountL() == 2); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST(view->CountL() == 2); CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); changeObs2->StartCollectingChanges(); @@ -6263,20 +6261,20 @@ // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == 1); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), 1); CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); CleanupStack::PushL(duplicate); // Check duplicate count active->StartL(); - test(recent->DuplicatesL(*duplicate, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == 1); + TEST(recent->DuplicatesL(*duplicate, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), 1); // Remove duplicate duplicate->RemoveL(duplicate->Event().Id()); @@ -6289,8 +6287,8 @@ TestLogOpenL(); // Check change events - test(!changeObs1->HaveChanges()); - test(!changeObs2->HaveChanges()); + TEST(!changeObs1->HaveChanges()); + TEST(!changeObs2->HaveChanges()); // Remove recent recent->RemoveL(recent->Event().Id()); @@ -6302,8 +6300,8 @@ EndBackupL(); TestLogOpenL(); - test(!changeObs1->HaveChanges()); - test(!changeObs2->HaveChanges()); // No event because we should know we called Remove on ourselves + TEST(!changeObs1->HaveChanges()); + TEST(!changeObs2->HaveChanges()); // No event because we should know we called Remove on ourselves CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate } @@ -6319,7 +6317,7 @@ */ LOCAL_C void TestHiddenChangeEvents7aL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0965 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0965 ")); CLogViewChangeObserver* changeObs1 = CLogViewChangeObserver::NewLC(); changeObs1->StartCollectingChanges(); @@ -6343,7 +6341,7 @@ active->StartL(); aClient.ClearLog(now, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus.Int() == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Incoming call event event->SetEventType(KLogCallEventTypeUid); @@ -6355,20 +6353,20 @@ active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Add a duplicate active->StartL(); aClient.AddEvent(*event, active->iStatus); CActiveScheduler::Start(); - test(active->iStatus == KErrNone); + TEST2(active->iStatus.Int(), KErrNone); // Setup normal event view active->StartL(); - test(view->SetFilterL(*filter, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(view->CountL() == 2); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->CountL(), 2); CLogViewChangeObserver* changeObs2 = CLogViewChangeObserver::NewLC(); changeObs2->StartCollectingChanges(); @@ -6378,20 +6376,20 @@ // Check recent view active->StartL(); - test(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == 1); + TEST(recent->SetRecentListL(KLogRecentIncomingCalls, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), 1); CLogViewDuplicate* duplicate = CLogViewDuplicate::NewL(aClient); CleanupStack::PushL(duplicate); // Check duplicate count active->StartL(); - test(recent->DuplicatesL(*duplicate, active->iStatus)); - CActiveScheduler::Start(); - test(active->iStatus == KErrNone); - test(recent->CountL() == 1); + TEST(recent->DuplicatesL(*duplicate, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(recent->CountL(), 1); // Remove duplicate recent->ClearDuplicatesL(); @@ -6404,8 +6402,8 @@ TestLogOpenL(); // Check change events - test(!changeObs1->HaveChanges()); - test(!changeObs2->HaveChanges()); + TEST(!changeObs1->HaveChanges()); + TEST(!changeObs2->HaveChanges()); CleanupStack::PopAndDestroy(8, changeObs1); // changeObs1, changeObs2, view, filter, event, active, recent, duplicate } @@ -6422,7 +6420,7 @@ */ LOCAL_C void DEF108741L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3511 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3511 ")); // Perform clean up TestUtils::DeleteDatabaseL(); @@ -6490,7 +6488,7 @@ */ LOCAL_C void TestNumberFieldINC108225L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3716 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3716 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -6642,7 +6640,7 @@ */ LOCAL_C void TestOtherFieldsINC108225L(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3755 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-3755 ")); CLogEvent* event = CLogEvent::NewL(); CleanupStack::PushL(event); @@ -6787,9 +6785,105 @@ CleanupStack::PopAndDestroy(4); } +/** +@SYMTestCaseID PDS-LOGENG-CT-4050 +@SYMTestCaseDesc Tests for the changes made in defect DEF144552 +@SYMTestPriority High +@SYMTestActions Tests for the sucessful completion of the following operation - + 1)Applying a filter where the event's start time matches the end time. + 2)Clearing the log where the clear log time is 1 microsecs after the + timestamp of the event. +@SYMTestExpectedResults Test must not fail +@SYMREQ DEF144552 +*/ +LOCAL_C void DEF144552L(CLogClient& aClient) + { + TheTest.Next(_L(" @SYMTestCaseID:PDS-LOGENG-CT-4050 ")); + TestUtils::DeleteDatabaseL(EFalse); + + CTestActive* active = new(ELeave)CTestActive(); + CleanupStack::PushL(active); + + //Setup the database by adding a event and changing the timestamp for the event + //Add 1 event + CLogEvent* event = CLogEvent::NewL(); + CleanupStack::PushL(event); + event->SetEventType(KLogCallEventTypeUid); + event->SetContact(KTestContact1); + event->SetNumber(KTestNumber2); + event->SetDuration(0); + active->StartL(); + aClient.AddEvent(*event, active->iStatus); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + + //Change the event + TTime now; + now.UniversalTime(); + event->SetTime(now); + active->StartL(); + aClient.ChangeEvent(*event, active->iStatus); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + + //Test 1: Setup and apply a filter where the start time matches the end time + //If the defect is fixed then the view will contain the event previously added, + //Otherwise the time parameters will be truncated and the event will not be found + + //Setup filter so that the start and the end time matches + CLogFilter* filter = CLogFilter::NewL(); + CleanupStack::PushL(filter); + filter->SetStartTime(now); + filter->SetEndTime(now); + + //Apply the filter and check that 1 event is in the view + CLogViewEvent* view = CLogViewEvent::NewL(aClient); + CleanupStack::PushL(view); + active->StartL(); + TEST(view->SetFilterL(*filter, active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + TEST2(view->CountL(), 1); + + //Retrieve and check the event + active->StartL(); + TEST(view->FirstL(active->iStatus)); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + const CLogEvent& currentEvent(view->Event()); + TEST2(currentEvent.EventType().iUid, KLogCallEventTypeUid.iUid); + TEST2(currentEvent.Duration(), 0); + TEST2(currentEvent.Time().Int64(), now.Int64()); + + // Test 2: Clearing a log where the time specified in ClearLog() is just + // after the timestamp of the event by 1 microsecond. If the defect is fixed + // then the event will be deleted. However if the defect is not fixed then the + // time specified in ClearLog() will be truncated and the event will not be + // deleted + + //Clear the log + active->StartL(); + TTimeIntervalMicroSeconds microsecond(1); + now += microsecond; + aClient.ClearLog(now, active->iStatus); + CActiveScheduler::Start(); + TEST2(active->iStatus.Int(), KErrNone); + + //Check that the event has been deleted in the view + CleanupStack::PopAndDestroy(2); + view = CLogViewEvent::NewL(aClient); + CleanupStack::PushL(view); + filter = CLogFilter::NewL(); + CleanupStack::PushL(filter); + active->StartL(); + TEST(!view->SetFilterL(*filter, active->iStatus)); + + CleanupStack::PopAndDestroy(4, active); + } + void doTestsL() { - TestUtils::Initialize(_L("T_LOGVIEW2")); + TestUtils::Initialize(_L("t_logview2")); TestUtils::DeleteDatabaseL(); CLogClient* client = CLogClient::NewL(theFs); @@ -6798,77 +6892,77 @@ CLogChangeNotifier* notifier = CLogChangeNotifier::NewL(); CleanupStack::PushL(notifier); - test.Start(_L("Event View With Filter List")); + TheTest.Start(_L("Event View With Filter List")); TestEventViewWithFilterListL(*client); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("View change observer")); + TheTest.Next(_L("View change observer")); TestViewChangeEventsL(*client); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("Recent View With Filter")); + TheTest.Next(_L("Recent View With Filter")); TestRecentViewWithFilterL(*client); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Recent View With Filter List")); + TheTest.Next(_L("Recent View With Filter List")); TestRecentViewWithFilterListL(*client); theLog.Write(_L8("Test 4 OK\n")); - test.Next(_L("Duplicate View With Filter")); + TheTest.Next(_L("Duplicate View With Filter")); TestDuplicateViewWithFilterL(*client); theLog.Write(_L8("Test 5 OK\n")); - test.Next(_L("Duplicate View With Filter List")); + TheTest.Next(_L("Duplicate View With Filter List")); TestDuplicateViewWithFilterListL(*client); theLog.Write(_L8("Test 6 OK\n")); - test.Next(_L("Querying Event View For Null Fields")); + TheTest.Next(_L("Querying Event View For Null Fields")); TestEventViewForNullFieldsL(*client); theLog.Write(_L8("Test 7 OK\n")); - test.Next(_L("Querying Recent View For Null Fields")); + TheTest.Next(_L("Querying Recent View For Null Fields")); TestRecentViewForNullFieldsL(*client); theLog.Write(_L8("Test 8 OK\n")); - test.Next(_L("Querying Duplicate View For Null Fields")); + TheTest.Next(_L("Querying Duplicate View For Null Fields")); TestDuplicateViewForNullFieldsL(*client); theLog.Write(_L8("Test 9 OK\n")); - test.Next(_L("Querying Event View For Flags")); + TheTest.Next(_L("Querying Event View For Flags")); TestEventViewForFlagsL(*client); theLog.Write(_L8("Test 10 OK\n")); - test.Next(_L("Querying Recent View For Flags")); + TheTest.Next(_L("Querying Recent View For Flags")); TestRecentViewForFlagsL(*client); theLog.Write(_L8("Test 11 OK\n")); - test.Next(_L("Querying Duplicate View For Flags")); + TheTest.Next(_L("Querying Duplicate View For Flags")); TestDuplicateViewForFlagsL(*client); theLog.Write(_L8("Test 12 OK\n")); - test.Next(_L("Removing Recent Events")); + TheTest.Next(_L("Removing Recent Events")); TestRemovingRecentEventsL(*client); theLog.Write(_L8("Test 13 OK\n")); - test.Next(_L("Removing Duplicate Events")); + TheTest.Next(_L("Removing Duplicate Events")); TestRemovingDuplicateEventsL(*client); theLog.Write(_L8("Test 14 OK\n")); - test.Next(_L("Multiple Views")); + TheTest.Next(_L("Multiple Views")); TestMultipleViews1L(*client); TestMultipleViews2L(*client); theLog.Write(_L8("Test 15 OK\n")); - test.Next(_L("Test _ALT Events In Recent List")); + TheTest.Next(_L("Test _ALT Events In Recent List")); TestAltEventsInRecentListL(*client); theLog.Write(_L8("Test 16 OK\n")); - test.Next(_L("Test filtering Events by time")); + TheTest.Next(_L("Test filtering Events by time")); // This TEST sets system's 'Home Time' TestFilterByTimeL(*client); theLog.Write(_L8("Test 17 OK\n")); - test.Next(_L("Test hidden change events")); + TheTest.Next(_L("Test hidden change events")); TestUtils::DeleteDatabaseL(); TestHiddenChangeEvents1L(*client); TestHiddenChangeEvents1aL(*client); @@ -6886,31 +6980,35 @@ TestHiddenChangeEvents7aL(*client); theLog.Write(_L8("Test 18 OK\n")); - test.Next(_L("Changing events and recent views")); + TheTest.Next(_L("Changing events and recent views")); TestChangeEventRecentView1L(*client); TestChangeEventRecentView2L(*client); TestChangeEventRecentViewAndPurgeL(*client); TestChangeEventRecentViewRemoveL(*client); theLog.Write(_L8("Test 19 OK\n")); - test.Next(_L("Test for DEF066296")); + TheTest.Next(_L("Test for DEF066296")); DEF066296L(*client); - test.Next(_L("Test for DEF087459")); + TheTest.Next(_L("Test for DEF087459")); DEF087459L(*client); theLog.Write(_L8("Test 20 OK\n")); - test.Next(_L("Event View With Filter List containing StartTime and EndTime")); + TheTest.Next(_L("Event View With Filter List containing StartTime and EndTime")); TestEventViewWithTimestampsInFilterListL(*client); theLog.Write(_L8("Test 21 OK\n")); - test.Next(_L("Test for DEF108741 - View change observer, error condition")); + TheTest.Next(_L("Test for DEF108741 - View change observer, error condition")); DEF108741L(*client); theLog.Write(_L8("Test 22 OK\n")); - test.Next(_L("Test Defect INC108225: Call history check for the CS & PS(VOIP) calls ")); + TheTest.Next(_L("Test Defect INC108225: Call history check for the CS & PS(VOIP) calls ")); TestNumberFieldINC108225L(*client); TestOtherFieldsINC108225L(*client); theLog.Write(_L8("Test 23 OK\n")); + TheTest.Next(_L("Test Defect DEF144552: CLogFilter doesn't work when Starttime is the same as EndTime")); + DEF144552L(*client); + theLog.Write(_L8("Test 24 OK\n")); + CleanupStack::PopAndDestroy(2); // client, notifier } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logviewfail.cpp --- a/loggingservices/eventlogger/test/src/t_logviewfail.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logviewfail.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,12 +14,10 @@ // #include -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log View Heap (Client) Failure Test Harness")); +RTest TheTest(_L("t_logviewfail")); const TLogContactItemId KTestContact = 0x123; _LIT(KTestStatus, "Test Status Text"); @@ -36,7 +34,7 @@ */ LOCAL_C void TestEventViewConstructWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0961-0001 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0961-0001 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -102,7 +100,7 @@ */ LOCAL_C void TestRecentViewConstructWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0962-0001 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0962-0001 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -172,7 +170,7 @@ */ LOCAL_C void TestDuplicateViewConstructWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0963-0001 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0963-0001 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -254,7 +252,7 @@ */ LOCAL_C void TestEventViewSetupWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0964-0001 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0964-0001 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -373,7 +371,7 @@ */ LOCAL_C void TestRecentViewSetupWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0965-0001 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0965-0001 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -529,7 +527,7 @@ */ LOCAL_C void TestDuplicateViewSetupWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0966 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0966 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -699,7 +697,7 @@ */ LOCAL_C void TestNavigationWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0967 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0967 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -912,7 +910,7 @@ */ LOCAL_C void TestViewCountWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0968 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0968 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -975,7 +973,7 @@ */ LOCAL_C void TestRecentViewRemoveWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0969 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0969 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -1105,7 +1103,7 @@ */ LOCAL_C void TestDuplicateViewRemoveWithHeapFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0970 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0970 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -1236,31 +1234,31 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGVIEWFAIL")); + TestUtils::Initialize(_L("t_logviewfail")); TestUtils::DeleteDatabaseL(); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); - test.Start(_L("Heap Failure in Client")); + TheTest.Start(_L("Heap Failure in Client")); - test.Next(_L("View Construction")); + TheTest.Next(_L("View Construction")); TestEventViewConstructWithHeapFailL(*client); TestRecentViewConstructWithHeapFailL(*client); TestDuplicateViewConstructWithHeapFailL(*client); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("View Setup")); + TheTest.Next(_L("View Setup")); TestEventViewSetupWithHeapFailL(*client); TestRecentViewSetupWithHeapFailL(*client); TestDuplicateViewSetupWithHeapFailL(*client); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("View Navigation")); + TheTest.Next(_L("View Navigation")); TestNavigationWithHeapFailL(*client); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Other")); + TheTest.Next(_L("Other")); TestViewCountWithHeapFailL(*client); TestRecentViewRemoveWithHeapFailL(*client); TestDuplicateViewRemoveWithHeapFailL(*client); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logviewfail2.cpp --- a/loggingservices/eventlogger/test/src/t_logviewfail2.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logviewfail2.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,12 +14,10 @@ // #include -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("File Failure Test Harness")); +RTest TheTest(_L("t_logviewfail2")); const TLogContactItemId KTestContact = 0x123; _LIT(KTestStatus, "Test Status Text"); @@ -35,7 +33,7 @@ */ LOCAL_C void TestEventViewSetupWithFileFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0971 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0971 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -90,7 +88,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -99,14 +97,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } __FILE_RESET; } - RDebug::Print(_L("Test-1 has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-1 has succeeded at iteration %d\n"), failCount); list->AppendL(filter); CleanupStack::Pop(); // filter @@ -145,7 +143,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -154,7 +152,7 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } @@ -165,7 +163,7 @@ list->ResetAndDestroy(); CleanupStack::PopAndDestroy(4); // list, view, event, active - RDebug::Print(_L("Test-2 has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-2 has succeeded at iteration %d\n"), failCount); } /** @@ -178,7 +176,7 @@ */ LOCAL_C void TestRecentViewSetupWithFileFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0972 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0972 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -229,7 +227,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -238,14 +236,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } __FILE_RESET; } - RDebug::Print(_L("Test-1 has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-1 has succeeded at iteration %d\n"), failCount); CLogFilterList* list = new(ELeave)CLogFilterList; CleanupStack::PushL(list); @@ -280,7 +278,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -289,14 +287,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } __FILE_RESET; } - RDebug::Print(_L("Test-2 has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-2 has succeeded at iteration %d\n"), failCount); list->AppendL(filter); CleanupStack::Pop(); // filter @@ -333,7 +331,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -342,7 +340,7 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } @@ -353,7 +351,7 @@ list->ResetAndDestroy(); CleanupStack::PopAndDestroy(4); // list, view, event, active - RDebug::Print(_L("Test-3 has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-3 has succeeded at iteration %d\n"), failCount); } /** @@ -367,7 +365,7 @@ */ LOCAL_C void TestDuplicateViewSetupWithFileFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0973 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0973 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -432,7 +430,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -441,14 +439,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } __FILE_RESET; } - RDebug::Print(_L("Test-1 has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-1 has succeeded at iteration %d\n"), failCount); CLogFilterList* list = new(ELeave)CLogFilterList; CleanupStack::PushL(list); @@ -483,7 +481,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -492,14 +490,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } __FILE_RESET; } - RDebug::Print(_L("Test-2 has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-2 has succeeded at iteration %d\n"), failCount); list->AppendL(filter); CleanupStack::Pop(); // filter @@ -536,7 +534,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -545,7 +543,7 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } @@ -556,7 +554,7 @@ list->ResetAndDestroy(); CleanupStack::PopAndDestroy(5); // list, duplicate, view, event, active - RDebug::Print(_L("Test-3 has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-3 has succeeded at iteration %d\n"), failCount); } /** @@ -570,7 +568,7 @@ */ LOCAL_C void TestNavigationWithFileFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0974 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0974 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -624,7 +622,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -633,14 +631,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } __FILE_RESET; } - RDebug::Print(_L("Test-1 (\"View Next\") has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-1 (\"View Next\") has succeeded at iteration %d\n"), failCount); failCount = 0; finished = EFalse; @@ -681,7 +679,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -690,14 +688,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } __FILE_RESET; } - RDebug::Print(_L("Test-2 (\"View Previous\") has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-2 (\"View Previous\") has succeeded at iteration %d\n"), failCount); failCount = 0; finished = EFalse; @@ -738,7 +736,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -747,14 +745,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } __FILE_RESET; } - RDebug::Print(_L("Test-3 (\"View First\") has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-3 (\"View First\") has succeeded at iteration %d\n"), failCount); failCount = 0; finished = EFalse; @@ -795,7 +793,7 @@ { if(active->iStatus.Int() != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrGeneral); } @@ -804,7 +802,7 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } @@ -814,7 +812,7 @@ CleanupStack::PopAndDestroy(4); // filter, view, event, active - RDebug::Print(_L("Test-4 (\"View Last\") has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("Test-4 (\"View Last\") has succeeded at iteration %d\n"), failCount); } /** @@ -827,7 +825,7 @@ */ LOCAL_C void TestViewCountWithFileFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0975 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0975 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -872,7 +870,7 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } @@ -882,7 +880,7 @@ CleanupStack::PopAndDestroy(4); // filter, view, event, active - RDebug::Print(_L("The test (\"View Count\") has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test (\"View Count\") has succeeded at iteration %d\n"), failCount); } /** @@ -895,7 +893,7 @@ */ LOCAL_C void TestRecentViewRemoveWithFileFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0976 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0976 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -966,7 +964,7 @@ CActiveScheduler::Start(); if(active->iStatus.Int() != KErrNone) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrNone); @@ -976,14 +974,14 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } } CleanupStack::PopAndDestroy(3); // view, event, active - RDebug::Print(_L("The test (\"View Remove\") has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test (\"View Remove\") has succeeded at iteration %d\n"), failCount); } /** @@ -996,7 +994,7 @@ */ LOCAL_C void TestDuplicateViewRemoveWithFileFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0977 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0977 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -1078,7 +1076,7 @@ CActiveScheduler::Start(); if(active->iStatus.Int() != KErrNone) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, active->iStatus.Int()); } TEST2(active->iStatus.Int(), KErrNone); @@ -1088,41 +1086,41 @@ { if(error != KErrGeneral) { - RDebug::Print(_L("Iter.step: %d, error %d\n"), failCount, error); + TheTest.Printf(_L("Iter.step: %d, error %d\n"), failCount, error); } TEST2(error, KErrGeneral); } } CleanupStack::PopAndDestroy(4); // duplicate, view, event, active - RDebug::Print(_L("The test (\"View Remove Duplicates\") has succeeded at iteration %d\n"), failCount); + TheTest.Printf(_L("The test (\"View Remove Duplicates\") has succeeded at iteration %d\n"), failCount); } void doTestsL() { - TestUtils::Initialize(_L("T_LOGVIEWFAIL2")); + TestUtils::Initialize(_L("t_logviewfail2")); TestUtils::DeleteDatabaseL(); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); - test.Start(_L("Event View Setup")); + TheTest.Start(_L("Event View Setup")); TestEventViewSetupWithFileFailL(*client); - test.Next(_L("Recent View Setup")); + TheTest.Next(_L("Recent View Setup")); TestRecentViewSetupWithFileFailL(*client); - test.Next(_L("Duplicated View Setup")); + TheTest.Next(_L("Duplicated View Setup")); TestDuplicateViewSetupWithFileFailL(*client); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("View Navigation")); + TheTest.Next(_L("View Navigation")); TestNavigationWithFileFailL(*client); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("View Count")); + TheTest.Next(_L("View Count")); TestViewCountWithFileFailL(*client); - test.Next(_L("View Remove")); + TheTest.Next(_L("View Remove")); TestRecentViewRemoveWithFileFailL(*client); - test.Next(_L("View Remove Duplicates")); + TheTest.Next(_L("View Remove Duplicates")); TestDuplicateViewRemoveWithFileFailL(*client); theLog.Write(_L8("Test 3 OK\n")); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logviewfail3.cpp --- a/loggingservices/eventlogger/test/src/t_logviewfail3.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logviewfail3.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,12 +14,10 @@ // #include -#include "TEST.H" +#include "t_logutil2.h" #include -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log View Heap (Server) Failure Test Harness")); +RTest TheTest(_L("t_logviewfail3")); const TLogContactItemId KTestContact = 0x123; _LIT(KTestStatus, "Test Status Text"); @@ -35,7 +33,7 @@ */ LOCAL_C void TestEventViewConstructWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0978 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0978 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -101,7 +99,7 @@ */ LOCAL_C void TestRecentViewConstructWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0979 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0979 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -169,7 +167,7 @@ */ LOCAL_C void TestDuplicateViewConstructWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0980 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0980 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -250,7 +248,7 @@ */ LOCAL_C void TestEventViewSetupWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0981 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0981 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -373,7 +371,7 @@ */ LOCAL_C void TestRecentViewSetupWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0982 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0982 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -526,7 +524,7 @@ */ LOCAL_C void TestDuplicateViewSetupWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0983 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0983 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -688,7 +686,7 @@ */ LOCAL_C void TestNavigationWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0984 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0984 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -892,7 +890,7 @@ */ LOCAL_C void TestViewCountWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0985 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0985 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -953,7 +951,7 @@ */ LOCAL_C void TestRecentViewRemoveWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0986 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0986 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -1078,7 +1076,7 @@ */ LOCAL_C void TestDuplicateViewRemoveWithLogServFailL(CLogClient& aClient) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0987 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0987 ")); CTestActive* active = new(ELeave)CTestActive; CleanupStack::PushL(active); @@ -1204,31 +1202,31 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGVIEWFAIL3")); + TestUtils::Initialize(_L("t_logviewfail3")); TestUtils::DeleteDatabaseL(); CLogClient* client = CLogClient::NewL(theFs); CleanupStack::PushL(client); - test.Start(_L("Heap Failure in Log Server")); + TheTest.Start(_L("Heap Failure in Log Server")); - test.Next(_L("View Construction")); + TheTest.Next(_L("View Construction")); TestEventViewConstructWithLogServFailL(*client); TestRecentViewConstructWithLogServFailL(*client); TestDuplicateViewConstructWithLogServFailL(*client); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("View Setup")); + TheTest.Next(_L("View Setup")); TestEventViewSetupWithLogServFailL(*client); TestRecentViewSetupWithLogServFailL(*client); TestDuplicateViewSetupWithLogServFailL(*client); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("View Navigation")); + TheTest.Next(_L("View Navigation")); TestNavigationWithLogServFailL(*client); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Other")); + TheTest.Next(_L("Other")); TestViewCountWithLogServFailL(*client); TestRecentViewRemoveWithLogServFailL(*client); TestDuplicateViewRemoveWithLogServFailL(*client); diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_logwrap.cpp --- a/loggingservices/eventlogger/test/src/t_logwrap.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/src/t_logwrap.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,11 +15,9 @@ #include #include -#include "TEST.H" +#include "t_logutil2.h" -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Log Wrapper Test Harness")); +RTest TheTest(_L("t_logwrap")); _LIT(KTestRemoteParty, "Remote Party"); _LIT(KTestDirection, "Direction"); @@ -43,7 +41,7 @@ */ LOCAL_C void TestBasicL(CLogBase& aClient, TBool aClientAvailable) { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1011 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1011 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -192,7 +190,7 @@ */ LOCAL_C void TestWrapperL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1012 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1012 ")); CTestActive* active = new(ELeave)CTestActive(); CleanupStack::PushL(active); @@ -229,7 +227,7 @@ */ LOCAL_C void TestHeapFailL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1013 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1013 ")); CLogWrapper* wrapper = NULL; #ifdef _DEBUG @@ -270,7 +268,7 @@ */ LOCAL_C void TestFileFailL() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1014 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1014 ")); CLogWrapper* wrapper = NULL; TInt failCount = 0; @@ -308,7 +306,7 @@ */ LOCAL_C void Test4INC047632L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1015 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1015 ")); #ifdef _DEBUG TestUtils::CopyCorruptDbL(); @@ -341,7 +339,7 @@ */ LOCAL_C void Test5INC114909L() { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4001 ")); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-4001 ")); #ifdef _DEBUG // Copy over the damaged database to be used. TestUtils::CopyCorruptDamagedDbL(); @@ -372,25 +370,25 @@ void doTestsL() { - TestUtils::Initialize(_L("T_LOGWRAP")); + TestUtils::Initialize(_L("t_logwrap")); - test.Start(_L("Wrapper")); + TheTest.Start(_L("Wrapper")); TestWrapperL(); theLog.Write(_L8("Test 1 OK\n")); - test.Next(_L("Heap Failure")); + TheTest.Next(_L("Heap Failure")); TestHeapFailL(); theLog.Write(_L8("Test 2 OK\n")); - test.Next(_L("File Failure")); + TheTest.Next(_L("File Failure")); TestFileFailL(); theLog.Write(_L8("Test 3 OK\n")); - test.Next(_L("Test4 for INC047632 - corrupt Logdbu.dat returns KErrEoF")); + TheTest.Next(_L("Test4 for INC047632 - corrupt Logdbu.dat returns KErrEoF")); Test4INC047632L(); theLog.Write(_L8("Test 4 for INC047632 OK\n")); - test.Next(_L("Test5 for INC114909 - test damaged Logdbu.dat is dealt with correctly ")); + TheTest.Next(_L("Test5 for INC114909 - test damaged Logdbu.dat is dealt with correctly ")); Test5INC114909L(); theLog.Write(_L8("Test 5 for INC114909 OK\n")); } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/t_maxnumberlength.CPP --- a/loggingservices/eventlogger/test/src/t_maxnumberlength.CPP Fri Apr 16 16:49:27 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -// Copyright (c) 2005-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: -// test code for INC041118 - Numberfield in logdatabase/engine is too small -// -// - -#include -#include -#include -#include "TEST.H" - -#undef test //there is a "test" macro which hides "RTest test" declaration. - -RTest test(_L("Maximum Phone Number Length Check")); - -_LIT(KTestEventDesc1, "Event Type Description"); -_LIT(KTestRemoteParty1, "Remote Party"); -_LIT(KTestDirection1, "Direction"); -_LIT(KTestStatus1, "Status"); -_LIT(KTestSubject1, "Subject"); - - -// These values are stored in "oldLogdb.dat" -_LIT(KTestEvent0, "00000"); -_LIT(KTestEvent1, "11111"); -_LIT(KTestEvent2, "22222"); - -const TUid KTestEventUid = {0x10005393}; -const TLogDurationType KTestDurationType1 = 1; -const TLogDuration KTestDuration1 = 0x1234; -const TLogContactItemId KTestContact1 = 0x1234; -const TLogLink KTestLink1 = 0x1234; -_LIT8(KTestData1, "ABCDEFGH"); -const TLogFlags KTestFlags1 = 0x5; - - -// with this value the test will ONLY pass with the new database -_LIT(KTestNumberMax, - "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"); - -// This test needs a number > 32 to check that database has been converted -_LIT(KTestNumber50, "01234567890123456789012345678901234567890123456789"); -_LIT(KTestNumberMin, "0"); - -// this coresponds to an event already stored in oldLogDb.dat -const TInt KoldId = 3; -_LIT(KTestOldDbNumber, "012345678901234567"); - - -/** -@SYMTestCaseID SYSLIB-LOGENG-CT-1336 -@SYMTestCaseDesc Tests for adding events to the log engine database -@SYMTestPriority High -@SYMTestActions Check for event ID assigned by log engine -@SYMTestExpectedResults Test must not fail -@SYMREQ REQ0000 -*/ -TInt TestAddEventL(CLogClient& aClient, const TDesC &aNumber) - { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1336 ")); - TInt returnId = KLogNullId; - - CTestActive* active = new(ELeave)CTestActive(); - CleanupStack::PushL(active); - - // create a new event - CLogEvent* event = CLogEvent::NewL(); - CleanupStack::PushL(event); - - // Reset - TTime now; - now.UniversalTime(); - - // load the event with test values - event->SetEventType(KTestEventUid); - event->SetRemoteParty(KTestRemoteParty1); - event->SetDirection(KTestDirection1); - event->SetDurationType(KTestDurationType1); - event->SetDuration(KTestDuration1); - event->SetStatus(KTestStatus1); - event->SetSubject(KTestSubject1); - event->SetNumber(aNumber); - event->SetContact(KTestContact1); - event->SetLink(KTestLink1); - event->SetDataL(KTestData1); - event->SetFlags(KTestFlags1); - - // add the event to the logeng database - active->StartL(); - aClient.AddEvent(*event, active->iStatus); - - CActiveScheduler::Start(); - TEST(!active->IsActive()); - aClient.Cancel(); - TEST2(active->iStatus.Int(), KErrNone); - - // check that an ID has been assigned - returnId = event->Id(); - TEST(returnId != KLogNullId); - - TEST(event->Time() >= now); - TEST(event->Description() == KTestEventDesc1); - - CleanupStack::PopAndDestroy(2); // event, active - - // return the event id which has been assigned by the - // log engine - return returnId; - } - -/** -@SYMTestCaseID SYSLIB-LOGENG-CT-1337 -@SYMTestCaseDesc Tests for getting the event from the log engine database -@SYMTestPriority High -@SYMTestActions Tests for CLogClient::GetEvent() function -@SYMTestExpectedResults Test must not fail -@SYMREQ REQ0000 -*/ -void TestGetEventL(CLogClient& aClient, TInt aTheId, const TDesC& aNumber) - - { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1337 ")); - CTestActive* active = new(ELeave)CTestActive(); - CleanupStack::PushL(active); - - CLogEvent* event = CLogEvent::NewL(); - CleanupStack::PushL(event); - - // set the id of the event to be fetched - event->SetId(aTheId); - - active->StartL(); - aClient.GetEvent(*event, active->iStatus); - CActiveScheduler::Start(); - aClient.Cancel(); - TEST2(active->iStatus.Int(), KErrNone); - - TEST(event->Id() == aTheId); - TEST(event->Time() > TTime(0)); - TEST(event->Description() == KTestEventDesc1); - TEST(event->EventType() == KTestEventUid); - TEST(event->RemoteParty() == KTestRemoteParty1); - TEST(event->Direction() == KTestDirection1); - TEST(event->DurationType() == KTestDurationType1); - TEST(event->Duration() == KTestDuration1); - TEST(event->Status() == KTestStatus1); - TEST(event->Subject() == KTestSubject1); - TEST(event->Contact() == KTestContact1); - TEST(event->Link() == KTestLink1); - TEST(event->Data() == KTestData1); - TEST(event->Flags() == KTestFlags1); - - // this is the important test - // check the number has not been truncated - TEST(event->Number() == aNumber); - - TPtrC eventStatus = event->Subject(); - TPtrC eventNumber = event->Number(); - test.Printf(_L("Id:%d No:%S Sub:%S Con:0x%x \n"), - event->Id(), &eventNumber, &eventStatus, event->Contact()); - - CleanupStack::PopAndDestroy(2); // event, active - } - - -/** -Test code for INC041118 - Numberfield in logdatabase/engine is too small -This is the main part of the test - -@SYMTestCaseID SYSLIB-LOGENG-CT-1019 -@SYMTestCaseDesc Tests for number field in logdatabase/engine is too small -@SYMTestPriority High -@SYMTestActions Add an event to the log engine database.When the database is opened it should be - converted to new format.Check by reading the event and checking the number length - Check with maximum and minimum number field -@SYMTestExpectedResults Test must not fail -@SYMREQ REQ0000 -*/ -void TestStartupL() - { - test.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1019 ")); - TestUtils::CopyOldDbL(); - - // add an event to the log engine database. - // When the database is opened it should be checked for the old numberfield length - // and converted to the new format if required. (It will be required, as old db has been copied) - CLogClient* client = CLogClient::NewL(theFs); - CleanupStack::PushL(client); - User::After(1000000); - test.Next(_L("check database conversion")); - TInt eventId = TestAddEventL(*client, KTestNumber50 ); - - // check that the database has been converted to the new format - // by reading back an event the checking that number is the - // correct length - TestGetEventL(*client, eventId, KTestNumber50); - - // check using Max - test.Next(_L("check a maxium length number")); - eventId = TestAddEventL(*client, KTestNumberMax ); - TestGetEventL(*client, eventId, KTestNumberMax); - - // check using Min - test.Next(_L("check a mimium length number")); - eventId = TestAddEventL(*client, KTestNumberMin ); - TestGetEventL(*client, eventId, KTestNumberMin); - - // When OldLogdbu.dat was created, using TestBuildTestDbL() below, - // 4 events were stored. Check that these can still be accessed. - // Note: There was a problem here with old events being purged after 30 days - // This was fixed by setting TLogConfig::iMaxEventAge = 0 in OldLogdb.dat - test.Next(_L("check all events in the old database")); - TestGetEventL(*client, 0, KTestEvent0); - TestGetEventL(*client, 1, KTestEvent1); - TestGetEventL(*client, 2, KTestEvent2); - TestGetEventL(*client, KoldId, KTestOldDbNumber); - - CleanupStack::PopAndDestroy(); // client - } - -// Test code for INC041118 - Numberfield in logdatabase/engine is too small -void doTestsL() - { - TestUtils::Initialize(_L("T_MAXNUMBERLENGTH")); -#ifdef _DEBUG - test.Start(_L("T_MaxNumberLength Set/Check Phone Number Maximum Length")); - - TestStartupL(); - theLog.Write(_L8("Test T_MAXNUMBERLENGTH OK\n")); -#else - test.Start(_L("This test works only in debug mode, otherwise the LogEng server cannot be stopped. See TestUtils::CopyOldDbL()")); -#endif//_DEBUG - } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/src/test.cpp --- a/loggingservices/eventlogger/test/src/test.cpp Fri Apr 16 16:49:27 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1002 +0,0 @@ -// Copyright (c) 2004-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: -// - -#include -#include "TEST.H" - -#undef test //there is a "test" macro which hides "RTest test" declaration. - -_LIT(KHelperExeName, "t_LogHiCapHelper.exe"); - -//====================================================================================================== - -TPtrC FileName(const TText* aFile) - { - TPtrC p(aFile); - TInt ix=p.LocateReverse('\\'); - if (ix<0) - ix=p.LocateReverse('/'); - if (ix>=0) - p.Set(p.Mid(1+ix)); - return p; - } - -//====================================================================================================== - -void LogTestBoolExpr(TBool aRes, const TText* aFile, TInt aLine) - { - if(!aRes) - { - TPtrC fname(FileName(aFile)); - RDebug::Print(_L("*** Boolean expression evaluated to false, file: %S-%d\r\n"), &fname, aLine); - test(EFalse, aLine); - } - } - -void LogCheck(TInt aValue, TInt aExpected, const TText* aFile, TInt aLine) - { - if(aValue != aExpected) - { - TPtrC fname(FileName(aFile)); - RDebug::Print(_L("*** Expected error: %d, got: %d, file: %S-%d\r\n"), aExpected, aValue, &fname, aLine); - test(EFalse, aLine); - } - } - -void LogCheckU(TUint aValue, TUint aExpected, const TText* aFile, TInt aLine) - { - if(aValue != aExpected) - { - TPtrC fname(FileName(aFile)); - RDebug::Print(_L("*** Expected error: %u, got: %u, file: %S-%d\r\n"), aExpected, aValue, &fname, aLine); - test(EFalse, aLine); - } - } - -//====================================================================================================== - -void LogLeave(TInt aErr, const TText* aFile, const TInt aLine) - { - TPtrC fname(FileName(aFile)); - RDebug::Print(_L("*** LogEng test leave, err=%d, file: %S-%d\r\n"), aErr, &fname, aLine); - User::Leave(aErr); - } - -//====================================================================================================== - -void LogPanic(const TDesC& aCategory, TInt aErr, const TText* aFile, TInt aLine) - { - TPtrC fname(FileName(aFile)); - RDebug::Print(_L("*** LogEng test panic'd with err=%d, category=%S, file: %S-%d\r\n"), aErr, &aCategory, &fname, aLine); - User::Panic(aCategory, aErr); - } - -//====================================================================================================== - -#ifdef LOGGING_ENABLED - -void Log::New() - { - _LIT(KNewLogText, "===== NEW LOG ====="); - // - RFileLogger logger; - TInt ret=logger.Connect(); - if (ret==KErrNone) - { - logger.CreateLog(KLogFolder, KLogFileName, EFileLoggingModeOverwrite); - logger.Write(KNewLogText); - } - logger.Close(); - } - -void Log::Write(const TDesC& aText) - { - PruneLogFile(); - - RFileLogger logger; - TInt ret=logger.Connect(); - if (ret==KErrNone) - { - logger.SetDateAndTime(EFalse,EFalse); - logger.CreateLog(KLogFolder, KLogFileName,EFileLoggingModeAppend); - TBuf buf; - TTime now; - now.HomeTime(); - TDateTime dateTime; - dateTime = now.DateTime(); - buf.Format(KTimeFormat,dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond()); - buf.AppendFormat(KTextFormat,&aText); - - logger.Write(buf); - } - - logger.Close(); - } - -void Log::WriteFormat(TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - - PruneLogFile(); - - TBuf<2*KLogEngLogBufferSize> buf; - buf.SetMax(); - buf.FillZ(); - TTime now; - now.HomeTime(); - TDateTime dateTime; - dateTime = now.DateTime(); - buf.Format(KTimeFormat,dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond()); - buf.AppendFormatList(aFmt, list ); - - RFileLogger logger; - TInt ret=logger.Connect(); - if (ret==KErrNone) - { - logger.SetDateAndTime(EFalse,EFalse); - logger.CreateLog(KLogFolder, KLogFileName,EFileLoggingModeAppend); - logger.Write(buf); - } - - logger.Close(); - } - -void Log::PruneLogFile() - { - const TInt KMaxLogSize = 1024 * 500; - _LIT(KDriveLetter, "C:\\Logs\\"); - // - TFileName fileName(KDriveLetter); - fileName.Append(KLogFolder); - fileName.Append(KLogFileName); - // - RFs fsSession; - if (fsSession.Connect() == KErrNone) - { - TEntry entry; - if (fsSession.Entry(fileName, entry) == KErrNone) - { - // Check size and delete if its too big - if (entry.iSize >= KMaxLogSize) - fsSession.Delete(fileName); // ignore error - } - } - fsSession.Close(); - } - -#endif - -// Globals -GLDEF_D CTrapCleanup* theCleanup; -GLDEF_D CActiveScheduler *testScheduler; -GLDEF_D RFs theFs; -GLDEF_D TFileName theLogName; -GLDEF_D RFile theLog; -GLDEF_D RLogTestSession theLogServ; - -//********************************** -// CTestActive -//********************************** - -CTestActive::CTestActive(TInt aPriority) -: CActive(aPriority) - { - CActiveScheduler::Add(this); - iDelayTime=0; - } - -CTestActive::~CTestActive() - { - Cancel(); - } - -void CTestActive::DoCancel() - { - TRequestStatus* s=&iStatus; - User::RequestComplete(s, KErrNone); - } - -void CTestActive::StartL() - { - iDelayCompletion=EFalse; - iDelayTime=0; - iStatus = KRequestPending; - SetActive(); - } - -void CTestActive::StartL(TInt aDelay) - { - iDelayCompletion=ETrue; - iDelayTime=aDelay; - iStatus = KRequestPending; - SetActive(); - } - -void CTestActive::RunL() - { - if(iDelayCompletion && iDelayTime) - { - // Wait for events in other threads to have a go.... - User::After(iDelayTime); - iDelayTime=0; - iStoredStatus=iStatus; - SetActive(); - TRequestStatus* s=&iStatus; - User::RequestComplete(s, KErrNone); - } - else - { - if(iDelayCompletion) - iStatus=iStoredStatus; - - LOGTEXT("CTestActive::RunL() - Stopping the scheduler"); - CActiveScheduler::Stop(); - } - } - -//********************************** -// CTestTimer -//********************************** - -CTestTimer::CTestTimer() -: CTimer(EPriorityLow) - {} - -void CTestTimer::RunL() - { - LOGTEXT("CTestTimer::RunL() - Stopping the scheduler"); - CActiveScheduler::Stop(); - } - -CTestTimer* CTestTimer::NewL() - { - CTestTimer* self = new(ELeave) CTestTimer(); - CleanupStack::PushL(self); - self->ConstructL(); // CTimer - CActiveScheduler::Add(self); - CleanupStack::Pop(); - return self; - } - -//********************************** -// TestUtils -//********************************** - -void TestUtils::Initialize(const TDesC& aName) - { - test.Title(); - test.Printf(_L("%S\r\n"), &aName); - User::RenameThread(aName); - } - -TBool TestUtils::FileExists(const TDesC& aFile) - { - TEntry entry; - return theFs.Entry(aFile, entry) == KErrNone; - } - -//Loads t_loghihelper process and passes for execution to t_loghihelper "aCommandLineArg" command line. -//t_loghihelper will run, execute the command and die, returning the result of the command execution. -//TestUtils::ExecuteRemoteL() will leave if error and return the result of the remote cmd execution to the caller. -TInt TestUtils::ExecuteRemoteL(const TDesC& aCommandLineArg) - { - RProcess process; - LEAVE_IF_ERROR(process.Create(KHelperExeName, aCommandLineArg)); - - TRequestStatus status; - process.Logon(status); - process.Resume(); - - User::WaitForRequest(status); - TInt exitReason = process.ExitReason(); - - process.Close(); - LEAVE_IF_ERROR(exitReason); - - return exitReason; - } - -//Runs t_loghihelper. t_loghihelper will execute the "delete LogEng database" command. -//The "delete LogEng database" is a complex operation. The request is sent via the backup server -//which will send a request to the LogEng server to release the LogEng database file locks and close the file. -//After that the database will be deleted. -//In the same call the LogEng server will restarted and the LogEng server will re-create the database during the -//server startup. -// -//If "aCloseBeforeDelete" flag is false, then the database wil be only deleted. -//The default value of "aCloseBeforeDelete" is true: the database will be closed, deleted and re-created. -//But some of the LogEng tests create a CBaBackupSessionWrapper object and call CloseFileL() with the logeng -//database name as a parameter. In this case, if another process, as t_loghicaphelper for example, attempts -//to call CloseFileL() with the same file name as a parameter, then the caller will get KErrServerBusy error. -//See how CBaBackupSessionWrapper::CloseFileL() is implemented on the server side. -void TestUtils::DeleteDatabaseL(TBool aCloseBeforeDelete) - { - _LIT(KCmdLine1, "-delete_db1"); - _LIT(KCmdLine2, "-delete_db2"); - (void)ExecuteRemoteL(aCloseBeforeDelete ? KCmdLine1 : KCmdLine2); - } - -//Runs t_loghihelper. t_loghihelper will check and return whether the LogEng database is open or not. -TBool TestUtils::IsDatabaseOpenL() - { - _LIT(KCmdLine, "-db_is_open"); - TInt result = ExecuteRemoteL(KCmdLine); - return result != 0; - } - -//Runs t_loghihelper. t_loghihelper will add an event type to the LogEng database. -void TestUtils::AddEventTypeL() - { - _LIT(KCmdLine, "-add_event_type"); - (void)ExecuteRemoteL(KCmdLine); - } - -//Runs t_loghihelper. t_loghihelper will add an event to the LogEng database. -TInt TestUtils::AddEventL() - { - _LIT(KCmdLine, "-add_event"); - return ExecuteRemoteL(KCmdLine); - } - -//Runs t_loghihelper. t_loghihelper will add events to the LogEng database. -void TestUtils::AddViewTestEventsL() - { - _LIT(KCmdLine, "-add_view_test_events"); - (void)ExecuteRemoteL(KCmdLine); - } - -//Runs t_loghihelper. t_loghihelper will return the size of the LogEng database. -TInt TestUtils::DatabaseSizeL() - { - _LIT(KCmdLine, "-db_size"); - return ExecuteRemoteL(KCmdLine); - } - -//Runs t_loghihelper. t_loghihelper will replace the LogEng database with a corrupted database (for testing purposes). -//The LogEng server will be stopped before that. The function can be used only in debug mode. -#ifdef _DEBUG -void TestUtils::CopyCorruptDbL() - { - - _LIT(KCmdLine, "-copy_corrupt"); - (void)ExecuteRemoteL(KCmdLine); - } - -//Runs t_loghihelper. t_loghihelper will replace the LogEng database with a corrupted database (for testing purposes). -//The LogEng server will be stopped before that. The function can be used only in debug mode. -void TestUtils::CopyCorruptDamagedDbL() - { - - _LIT(KCmdLine, "-copy_corrupt_damaged"); - (void)ExecuteRemoteL(KCmdLine); - } - -//Runs t_loghihelper. t_loghihelper will replace the LogEng database with an old format database -//(no SimId column, phone number length is different). The LogEng server will be stopped before that. -//The function can be used only in debug mode. -void TestUtils::CopyOldDbL() - { - _LIT(KCmdLine, "-copy_old"); - (void)ExecuteRemoteL(KCmdLine); - } -#else //_DEBUG -void TestUtils::CopyCorruptDbL() - { - RDebug::Print(_L("TestUtils::CopyCorruptDbL() has a meaningfull implementation in debug builds only.\n")); - } - -void TestUtils::CopyCorruptDamagedDbL() - { - RDebug::Print(_L("TestUtils::CopyCorruptDamagedDbL() has a meaningfull implementation in debug builds only.\n")); - } - -void TestUtils::CopyOldDbL() - { - RDebug::Print(_L("TestUtils::CopyOldDbL() has a meaningfull implementation in debug builds only.\n")); - } - -#endif//_DEBUG - -//Runs t_loghihelper. t_loghihelper will re-create the LogEng database and check whether LogEng client can connect to the server. -void TestUtils::TestInvalidSchemaL() - { - _LIT(KCmdLine, "-invalid_schema"); - (void)ExecuteRemoteL(KCmdLine); - } - -//Runs t_loghihelper. t_loghihelper checks whether the phone number mathcing is enabled. -TBool TestUtils::MatchingEnabledL() - { - _LIT(KCmdLine, "-is_matching_enabled"); - return ExecuteRemoteL(KCmdLine) != 0; - } - -//Creates HBufC object and puts it on the cleanup stack. -//The buffer will be filled with (' ' + pos) characters, where pos is the character position in the buffer. -HBufC* TestUtils::CreateBufLC(TInt aLength) - { - HBufC* buf = HBufC::NewLC(aLength); - TPtr ptr = buf->Des(); - for(TInt pos=0;posDes(); - for(TInt pos=0;posAfter(aDelay); - - CTestActive* wait = new(ELeave)CTestActive; - CleanupStack::PushL(wait); - wait->StartL(); - - // Wait for key press - test.Console()->Read(wait->iStatus); - CActiveScheduler::Start(); - - // If timer still active a key was pressed - TBool keyPressed = timer->IsActive(); - - if (keyPressed) - { - // Get the key pressed - aKeyCode = test.Console()->KeyCode(); - - // Cancel timer - timer->Cancel(); - } - else - { - // Cancel wait for character - test.Console()->ReadCancel(); - User::WaitForRequest(wait->iStatus); - } - - CleanupStack::PopAndDestroy(2); // wait, timer - return keyPressed; - } - -//Used for LogEng server side heap failure testing. -#ifdef _DEBUG -void TestUtils::SetLogServHeapFailureL(RHeap::TAllocFail aType, TInt aRate) - { - //this function doesn't have any effect on UREL builds - //get rid of warnings in release builds - aType = aType; - aRate = aRate; - if (!theLogServ.Handle()) - LEAVE_IF_ERROR(theLogServ.Connect()); - - TIpcArgs ipcArgs(aType,aRate) ; - LEAVE_IF_ERROR(theLogServ.Send(ELogSetHeapFail, ipcArgs)); - } -#else -void TestUtils::SetLogServHeapFailureL(RHeap::TAllocFail, TInt) - { - } -#endif//_DEBUG - -//********************************** -// CLogViewChangeObserver -//********************************** - -CLogViewChangeObserver* CLogViewChangeObserver::NewLC() - { - CLogViewChangeObserver* self = new(ELeave) CLogViewChangeObserver(); - CleanupStack::PushL(self); - return self; - } - -CLogViewChangeObserver::~CLogViewChangeObserver() - { - Cancel(); - delete iChanges; - } - -CLogViewChangeObserver::CLogViewChangeObserver() -: CActive(EPriorityStandard) - { - CActiveScheduler::Add(this); - } - - -CLogChangeDefinition* CLogViewChangeObserver::WaitForChangesLC(TStopType aType, TInt aCount) - { - __ASSERT_ALWAYS(!iSchedulerStarted, User::Invariant()); - Reset(); - // - iExpectedChangeCount = aCount; - iType = aType; - if (aType != EStopOnChanges) - SetActive(); - // - iSchedulerStarted = ETrue; - CActiveScheduler::Start(); - iSchedulerStarted = EFalse; - // - CLogChangeDefinition* ret = iChanges; - TEST(iChanges != NULL); - iChanges = NULL; - CleanupStack::PushL(ret); - return ret; - } - -CLogChangeDefinition* CLogViewChangeObserver::WaitForChangesLC(TCallBack aCallBack, TStopType aType, TInt aCount) - { - iHaveCallBack = ETrue; - iCallBack = aCallBack; - return WaitForChangesLC(aType, aCount); - } - -void CLogViewChangeObserver::HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount) - { - AddChangeL(ELogChangeTypeEventAdded, aId, aViewIndex); - if (aChangeIndex == aTotalChangeCount-1) - CheckForSchedulerStop(); - } - -void CLogViewChangeObserver::HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount) - { - AddChangeL(ELogChangeTypeEventChanged, aId, aViewIndex); - if (aChangeIndex == aTotalChangeCount-1) - CheckForSchedulerStop(); - } - -void CLogViewChangeObserver::HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount) - { - AddChangeL(ELogChangeTypeEventDeleted, aId, aViewIndex); - if (aChangeIndex == aTotalChangeCount-1) - CheckForSchedulerStop(); - } - -void CLogViewChangeObserver::RunL() - { - __ASSERT_ALWAYS(iType == EStopOnRunL || iType == EStopOnBoth, User::Invariant()); - iHaveFinishedOperation = ETrue; - CheckForSchedulerStop(); - } - -void CLogViewChangeObserver::DoCancel() - { - TRequestStatus* s=&iStatus; - User::RequestComplete(s, KErrCancel); - } - -void CLogViewChangeObserver::Reset() - { - iExpectedChangeCount = 0; - iHaveFinishedOperation = EFalse; - iHaveObtainedChanges = EFalse; - iSchedulerStarted = EFalse; - iType = EStopOnChanges; - delete iChanges; - iChanges = NULL; - } - -void CLogViewChangeObserver::CheckForSchedulerStop() - { - if(iSchedulerStarted) - { - if (iHaveCallBack) - { - iCallBack.CallBack(); - iCallBack.iFunction = NULL; - iCallBack.iPtr = NULL; - iHaveCallBack = EFalse; - } - // - TBool stopScheduler = EFalse; - switch(iType) - { - case EStopOnChanges: - stopScheduler = iHaveObtainedChanges; - break; - case EStopOnRunL: - stopScheduler = iHaveFinishedOperation; - break; - case EStopOnBoth: - stopScheduler = (iHaveObtainedChanges && iHaveFinishedOperation); - break; - case EStopOnCount: - if (iChanges) - { - TEST(iChanges->Count() <= iExpectedChangeCount); - stopScheduler = (iChanges->Count() == iExpectedChangeCount); - } - case EDontStopScheduler: - break; - } - - if (stopScheduler) - { - LOGTEXT("CLogViewChangeObserver::CheckForSchedulerStop() - Stopping the scheduler"); - CActiveScheduler::Stop(); - } - } - } - -void CLogViewChangeObserver::AddChangeL(TLogDatabaseChangeType aType, TLogId aId, TInt aViewIndex) - { - CLogChangeDefinition* changes; - - if (iChanges) - changes = iChanges; - else - { - changes = CLogChangeDefinition::NewL(); - CleanupStack::PushL(changes); - } - // - changes->AddL(aId, aType, aViewIndex); - // - if (!iChanges) - { - delete iChanges; - iChanges = changes; - CleanupStack::Pop(changes); - } - // - iHaveObtainedChanges = ETrue; - } - -//********************************** -// CLogViewChangeObserverErrorTest -//********************************** -CLogViewChangeObserverErrorTest* CLogViewChangeObserverErrorTest::NewLC() - { - CLogViewChangeObserverErrorTest* self = new(ELeave) CLogViewChangeObserverErrorTest(); - CleanupStack::PushL(self); - return self; - } - -CLogViewChangeObserverErrorTest::CLogViewChangeObserverErrorTest() - {} - -void CLogViewChangeObserverErrorTest::HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount) - { - // DEF108741L - the error condition tested here is that a leave is dealt with - // gracefully without any panics. - - // Add a new event to the log - AddChangeL(ELogChangeTypeEventAdded, aId, aViewIndex); - if (aChangeIndex == aTotalChangeCount-1) - CheckForSchedulerStop(); - - // In the test case for DEF108741L this method will be effectively - // invoked 3 times. This code forces a leave on the middle event to - // ensure that the leave is dealt with and the rest of the test - // completes successfully. - if (aId == 1) - { - LEAVE(KErrGeneral); - } - } - -//********************************** -// CLogSchedulerTimer -//********************************** - -CLogSchedulerTimer* CLogSchedulerTimer::NewLC() - { - CLogSchedulerTimer* self = new(ELeave) CLogSchedulerTimer(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -CLogSchedulerTimer::~CLogSchedulerTimer() - { - Cancel(); - } - -CLogSchedulerTimer::CLogSchedulerTimer() -: CTimer(0) - { - CActiveScheduler::Add(this); - } - -void CLogSchedulerTimer::ConstructL() - { - CTimer::ConstructL(); - } - -void CLogSchedulerTimer::Wait(TTimeIntervalMicroSeconds32 aTime) - { - After(aTime); - CActiveScheduler::Start(); - } - -void CLogSchedulerTimer::RunL() - { - LOGTEXT("CLogSchedulerTimer::RunL() - Stopping the scheduler"); - CActiveScheduler::Stop(); - } - - - - -//********************************** -// CLogChangeNotifier -//********************************** - -CLogChangeNotifier* CLogChangeNotifier::NewL() - { - CLogChangeNotifier* self = new(ELeave)CLogChangeNotifier(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -CLogChangeNotifier::~CLogChangeNotifier() - { - Cancel(); - delete iClient; - } - -CLogChangeNotifier::CLogChangeNotifier() -: CActive(EPriorityStandard) - { - CActiveScheduler::Add(this); - } - -void CLogChangeNotifier::ConstructL() - { - iClient = CLogClient::NewL(theFs); - - iStart.UniversalTime(); - iClient->NotifyChange(10000000, iStatus); - SetActive(); - } - -void CLogChangeNotifier::RunL() - { - TTime now; - now.UniversalTime(); - TTimeIntervalSeconds seconds; - now.SecondsFrom(iStart, seconds); - - TBuf<256> buf; - const TInt error = iStatus.Int(); - if (error == KErrServerTerminated) - { - buf.Format(_L("KErrServerTerminated")); - User::InfoPrint(buf); - return; - } - - buf.Format(_L("%d seconds"), seconds.Int()); - User::InfoPrint(buf); - - iStart.UniversalTime(); - iClient->NotifyChange(10000000, iStatus); - SetActive(); - } - -void CLogChangeNotifier::DoCancel() - { - iClient->NotifyChangeCancel(); - } - -//********************************** -// Global -//********************************** - -void SetupSchedulerL() - { - testScheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL( testScheduler ); - CActiveScheduler::Install( testScheduler ); - } - -void CloseScheduler() - { - CleanupStack::PopAndDestroy(); // Scheduler - testScheduler = NULL; - } - -static void CreateLogL() - { - LEAVE_IF_ERROR(theFs.Connect()); - - theLogName.Copy(RProcess().FileName()); - TInt start = theLogName.LocateReverse('\\'); - TInt end = theLogName.LocateReverse('.'); - theLogName = theLogName.Mid(start + 1, end - start - 1); - - // create the log filename - theLogName.Insert(0, _L("C:\\")); -#if defined(__WINS__) - theLogName.Append(_L(".WINS.")); -#else - theLogName.Append(_L(".MARM.")); -#endif -#if defined(_UNICODE) - theLogName.Append(_L("UNICODE.")); -#else - theLogName.Append(_L("ASCII.")); -#endif -#if defined(_DEBUG) - theLogName.Append(_L("DEB.")); -#else - theLogName.Append(_L("REL.")); -#endif - theLogName.Append(_L("LOG")); - - // create the logfile - LEAVE_IF_ERROR(theLog.Replace(theFs, theLogName, EFileWrite|EFileShareExclusive)); - TBuf8<256> text; - text.Copy(theLogName); - theLog.Write(text); - theLog.Write(_L8("\nTest results\n")); - } - -static void CloseLog() - { - theLog.Write(_L8("Tests completed\n")); - test.Printf(_L("Results saved in %S\n"), &theLogName); - theLog.Close(); - theFs.Close(); - } - -void DeleteDataFile(const TDesC& aFullName) - { - RFs fsSession; - TInt err = fsSession.Connect(); - if(err == KErrNone) - { - TEntry entry; - if(fsSession.Entry(aFullName, entry) == KErrNone) - { - RDebug::Print(_L("Deleting \"%S\" file.\n"), &aFullName); - err = fsSession.SetAtt(aFullName, 0, KEntryAttReadOnly); - if(err != KErrNone) - { - RDebug::Print(_L("Error %d changing \"%S\" file attributes.\n"), err, &aFullName); - } - err = fsSession.Delete(aFullName); - if(err != KErrNone) - { - RDebug::Print(_L("Error %d deleting \"%S\" file.\n"), err, &aFullName); - } - } - fsSession.Close(); - } - else - { - RDebug::Print(_L("Error %d connecting file session. File: %S.\n"), err, &aFullName); - } - } - -static void Cleanup(void*) - { - TRAP_IGNORE(TestUtils::DeleteDatabaseL()); - _LIT(KCntModelFileName, "c:\\system\\data\\CntModel.ini"); - ::DeleteDataFile(KCntModelFileName); - _LIT(KContactsFileName, "c:\\system\\data\\Contacts.cdb"); - ::DeleteDataFile(KContactsFileName); - ::DeleteDataFile(theLogName); - } - -static void DoMainL() - { - ::SetupSchedulerL(); - TCleanupItem cleanup(&Cleanup, NULL); - CleanupStack::PushL(cleanup); - CreateLogL(); - ::doTestsL(); - CloseLog(); - CleanupStack::PopAndDestroy();//cleanup - ::CloseScheduler(); - } - -TInt E32Main() - { - __UHEAP_MARK; - - theCleanup = CTrapCleanup::New(); - if(!theCleanup) - { - _LIT(KLogHiCapHelperPanic, "LogTestPanic"); - User::Panic(KLogHiCapHelperPanic, KErrNoMemory); - } - - TRAPD(err, ::DoMainL()); - TEST2(err, KErrNone); - - delete theCleanup; - - test.Console()->SetPos(0, 13); - - test.End(); - test.Close(); - - __UHEAP_MARKEND; - - return KErrNone; - } - - diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_OrderById.MMP --- a/loggingservices/eventlogger/test/t_OrderById.MMP Fri Apr 16 16:49:27 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -// Copyright (c) 2004-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: -// - -TARGET t_orderbyid.exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -TARGETTYPE exe - -SOURCEPATH src -SOURCE t_OrderById.CPP -SOURCE test.cpp -SOURCE t_logservsession.cpp - -USERINCLUDE ../test/inc -USERINCLUDE ../Shared -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY logwrap.lib -LIBRARY logcli.lib -LIBRARY bafl.lib - - -VENDORID 0x70000001 - -SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logapi.mmp --- a/loggingservices/eventlogger/test/t_logapi.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logapi.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,20 +15,32 @@ #include "../group/LogEng.cfg" -TARGET t_logapi.exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -TARGETTYPE exe -SOURCEPATH ../test/src -SOURCE t_logapi.cpp test.cpp -SOURCE t_logservsession.cpp -USERINCLUDE ../test/inc -USERINCLUDE ../Shared +TARGET t_logapi.exe +TARGETTYPE exe + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + +USERINCLUDE ../test/inc +USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib edbms.lib estor.lib + +SOURCEPATH ../test/src +SOURCE t_logapi.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib +LIBRARY edbms.lib +LIBRARY estor.lib #ifdef MMPSWITCH_LOGGING_ENABLED -LIBRARY flogger.lib -MACRO LOGGING_ENABLED +LIBRARY flogger.lib +MACRO LOGGING_ENABLED #endif VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logapi2.mmp --- a/loggingservices/eventlogger/test/t_logapi2.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logapi2.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -23,8 +23,10 @@ USERINCLUDE ../LogServ/inc OS_LAYER_SYSTEMINCLUDE_SYMBIAN -SOURCEPATH src -SOURCE t_logapi2.cpp test.cpp +SOURCEPATH ../test/src +SOURCE t_logapi2.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp SOURCE t_logservsession.cpp SOURCEPATH ../LogServ/src diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logapi_helper.mmp --- a/loggingservices/eventlogger/test/t_logapi_helper.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logapi_helper.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -16,16 +16,18 @@ // TARGET t_logapi_helper.exe -CAPABILITY AllFiles TARGETTYPE exe -SOURCEPATH src -SOURCE t_logapi_helper.cpp +CAPABILITY AllFiles USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN +SOURCEPATH ../test/src +SOURCE t_logapi_helper.cpp +SOURCE t_logutil.cpp + LIBRARY euser.lib LIBRARY efsrv.lib LIBRARY bafl.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logbackup.mmp --- a/loggingservices/eventlogger/test/t_logbackup.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logbackup.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -13,17 +13,26 @@ // Description: // -TARGET t_logbackup.exe -TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logbackup.cpp test.cpp -SOURCE t_logservsession.cpp -USERINCLUDE ../test/inc -USERINCLUDE ../Shared +TARGET t_logbackup.exe +TARGETTYPE exe + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + +USERINCLUDE ../test/inc +USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logcli.lib logwrap.lib bafl.lib + +SOURCEPATH ../test/src +SOURCE t_logbackup.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logcli.lib +LIBRARY logwrap.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logbadclient.mmp --- a/loggingservices/eventlogger/test/t_logbadclient.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logbadclient.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -15,6 +15,7 @@ TARGET t_logbadclient.exe TARGETTYPE EXE + CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData USERINCLUDE . @@ -25,6 +26,7 @@ SOURCEPATH ../test/src SOURCE t_logbadclient.cpp +SOURCE t_logutil.cpp SOURCEPATH ../LogCli/src SOURCE logservcli.cpp diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logbench.mmp --- a/loggingservices/eventlogger/test/t_logbench.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logbench.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -17,17 +17,26 @@ // // -TARGET t_logbench.exe -TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logbench.cpp test.cpp -SOURCE t_logservsession.cpp -USERINCLUDE ../test/inc -USERINCLUDE ../Shared +TARGET t_logbench.exe +TARGETTYPE exe + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + +USERINCLUDE ../test/inc +USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib + +SOURCEPATH ../test/src +SOURCE t_logbench.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logcntmatch.mmp --- a/loggingservices/eventlogger/test/t_logcntmatch.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logcntmatch.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -23,7 +23,9 @@ OS_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCEPATH ../test/src -SOURCE t_logcntmatch.cpp test.cpp +SOURCE t_logcntmatch.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp SOURCE t_logservsession.cpp LIBRARY euser.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logcompat.mmp --- a/loggingservices/eventlogger/test/t_logcompat.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logcompat.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -24,8 +24,10 @@ USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -SOURCEPATH src -SOURCE t_logcompat.cpp test.cpp +SOURCEPATH ../test/src +SOURCE t_logcompat.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp SOURCE t_logservsession.cpp LIBRARY euser.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logcontact.mmp --- a/loggingservices/eventlogger/test/t_logcontact.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logcontact.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -22,8 +22,10 @@ USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -SOURCEPATH ../test/src -SOURCE t_logcontact.cpp test.cpp +SOURCEPATH ../test/src +SOURCE t_logcontact.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp SOURCE t_logservsession.cpp LIBRARY euser.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logenvcreate.mmp --- a/loggingservices/eventlogger/test/t_logenvcreate.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logenvcreate.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -18,10 +18,12 @@ CAPABILITY All -Tcb USERINCLUDE . +USERINCLUDE ../test/inc OS_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCEPATH ../test/src SOURCE t_logenvcreate.cpp +SOURCE t_logutil.cpp LIBRARY euser.lib LIBRARY efsrv.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logenvdestroy.mmp --- a/loggingservices/eventlogger/test/t_logenvdestroy.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logenvdestroy.mmp Mon May 03 14:09:14 2010 +0300 @@ -18,10 +18,12 @@ CAPABILITY All -Tcb USERINCLUDE . +USERINCLUDE ../test/inc OS_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCEPATH ../test/src SOURCE t_logenvdestroy.cpp +SOURCE t_logutil.cpp LIBRARY euser.lib LIBRARY efsrv.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logevent.mmp --- a/loggingservices/eventlogger/test/t_logevent.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logevent.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,15 +15,25 @@ TARGET t_logevent.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logevent.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib estor.lib bafl.lib logcli.lib + +SOURCEPATH ../test/src +SOURCE t_logevent.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY logcli.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logfile.mmp --- a/loggingservices/eventlogger/test/t_logfile.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logfile.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -22,8 +22,10 @@ USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -SOURCEPATH ../test/src -SOURCE t_logfile.cpp test.cpp +SOURCEPATH ../test/src +SOURCE t_logfile.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp SOURCE t_logservsession.cpp LIBRARY euser.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logfilter.mmp --- a/loggingservices/eventlogger/test/t_logfilter.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logfilter.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,21 +14,26 @@ // TARGET t_logfilter.exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData TARGETTYPE exe -SOURCEPATH ../test/src -SOURCE t_logfilter.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +SOURCEPATH ../test/src +SOURCE t_logfilter.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + LIBRARY euser.lib LIBRARY efsrv.lib LIBRARY logcli.lib LIBRARY logwrap.lib LIBRARY bafl.lib - VENDORID 0x70000001 SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logheap.mmp --- a/loggingservices/eventlogger/test/t_logheap.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logheap.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -16,14 +16,16 @@ TARGET t_logheap.exe TARGETTYPE exe +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData - -SOURCEPATH ../test/src -SOURCE t_logheap.cpp test.cpp +SOURCEPATH ../test/src +SOURCE t_logheap.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp SOURCE t_logservsession.cpp LIBRARY euser.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_loghicapability.mmp --- a/loggingservices/eventlogger/test/t_loghicapability.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_loghicapability.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -15,16 +15,24 @@ TARGET t_loghicapability.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logplatformsecurity.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +SOURCEPATH ../test/src +SOURCE t_logplatformsecurity.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib - +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_loghicaphelper.mmp --- a/loggingservices/eventlogger/test/t_loghicaphelper.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_loghicaphelper.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -14,17 +14,19 @@ // TARGET t_loghicaphelper.exe -CAPABILITY AllFiles WriteDeviceData WriteUserData TARGETTYPE exe -SOURCEPATH src -SOURCE t_loghicaphelper.cpp -SOURCE t_logservsession.cpp +CAPABILITY AllFiles WriteDeviceData WriteUserData USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN +SOURCEPATH ../test/src +SOURCE t_loghicaphelper.cpp +SOURCE t_logservsession.cpp +SOURCE t_logutil.cpp + LIBRARY euser.lib LIBRARY efsrv.lib LIBRARY logwrap.lib @@ -32,7 +34,6 @@ LIBRARY bafl.lib LIBRARY edbms.lib - VENDORID 0x70000001 SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_loglowcapability.mmp --- a/loggingservices/eventlogger/test/t_loglowcapability.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_loglowcapability.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -15,17 +15,27 @@ TARGET t_loglowcapability.exe TARGETTYPE exe + CAPABILITY None -SOURCEPATH ../test/src -SOURCE t_logplatformsecurity.cpp test.cpp -SOURCE t_logservsession.cpp + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib + +SOURCEPATH ../test/src +SOURCE t_logplatformsecurity.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib + MACRO LOWCAP - VENDORID 0x70000001 SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logmaxnumlen.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/t_logmaxnumlen.mmp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,41 @@ +// Copyright (c) 2004-2010 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: +// t_logmaxnumlen.mmp +// +// + +TARGET t_logmaxnumlen.exe +TARGETTYPE exe + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + +USERINCLUDE ../test/inc +USERINCLUDE ../Shared +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +SOURCEPATH ../test/src +SOURCE t_logmaxnumlen.cpp +SOURCE t_logutil2.cpp +SOURCE t_logutil.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib + +VENDORID 0x70000001 + +SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_lognotify.mmp --- a/loggingservices/eventlogger/test/t_lognotify.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_lognotify.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,15 +15,24 @@ TARGET t_lognotify.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_lognotify.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib + +SOURCEPATH ../test/src +SOURCE t_lognotify.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logorderbyid.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loggingservices/eventlogger/test/t_logorderbyid.mmp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,39 @@ +// Copyright (c) 2004-2010 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: +// + +TARGET t_logorderbyid.exe +TARGETTYPE exe + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + +USERINCLUDE ../test/inc +USERINCLUDE ../Shared +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +SOURCEPATH ../test/src +SOURCE t_logorderbyid.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib + +VENDORID 0x70000001 + +SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logpurge.mmp --- a/loggingservices/eventlogger/test/t_logpurge.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logpurge.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,16 +15,19 @@ TARGET t_logpurge.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logpurge.cpp -SOURCE test.cpp -SOURCE t_logservsession.cpp +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN +SOURCEPATH ../test/src +SOURCE t_logpurge.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + LIBRARY euser.lib LIBRARY efsrv.lib LIBRARY logwrap.lib diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logsecureview_hicap.mmp --- a/loggingservices/eventlogger/test/t_logsecureview_hicap.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logsecureview_hicap.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -13,24 +13,26 @@ // Description: // -TARGET t_logsecureview_hicap.exe -TARGETTYPE exe +TARGET t_logsecureview_hicap.exe +TARGETTYPE exe -CAPABILITY ReadUserData WriteDeviceData +CAPABILITY ReadUserData WriteDeviceData OS_LAYER_SYSTEMINCLUDE_SYMBIAN -USERINCLUDE ../test/inc -USERINCLUDE ../Shared +USERINCLUDE ../test/inc +USERINCLUDE ../Shared -SOURCEPATH ../test/src -SOURCE t_logsecureview.cpp test.cpp -SOURCE t_logservsession.cpp +SOURCEPATH ../test/src +SOURCE t_logsecureview.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp -LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY logwrap.lib -LIBRARY logcli.lib -LIBRARY bafl.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logsecureview_lowcap.mmp --- a/loggingservices/eventlogger/test/t_logsecureview_lowcap.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logsecureview_lowcap.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -13,22 +13,30 @@ // Description: // -TARGET t_logsecureview_lowcap.exe -TARGETTYPE exe +TARGET t_logsecureview_lowcap.exe +TARGETTYPE exe + +CAPABILITY ReadUserData + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +USERINCLUDE ../test/inc +USERINCLUDE inc ../Shared -CAPABILITY ReadUserData +SOURCEPATH ../test/src +SOURCE t_logsecureview.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib + +MACRO LOWCAP + VENDORID 0x70000001 SMPSAFE -SOURCEPATH src -SOURCE t_logsecureview.cpp test.cpp -SOURCE t_logservsession.cpp - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN -USERINCLUDE inc ../Shared - -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib -MACRO LOWCAP - - diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logservIPC.mmp --- a/loggingservices/eventlogger/test/t_logservIPC.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logservIPC.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -13,18 +13,23 @@ // Description: // -TARGET t_logservipc.exe -CAPABILITY ALL -TCB -TARGETTYPE exe +TARGET t_logservipc.exe +TARGETTYPE exe + +CAPABILITY ALL -TCB OS_LAYER_SYSTEMINCLUDE_SYMBIAN USERINCLUDE ../LogServ/inc USERINCLUDE ../Shared +USERINCLUDE ../test/inc -SOURCEPATH ../test/src -source t_logservIPC.cpp +SOURCEPATH ../test/src +source t_logutil.cpp +source t_logservIPC.cpp -library euser.lib logcli.lib -VENDORID 0x70000001 +LIBRARY euser.lib +LIBRARY logcli.lib -SMPSAFE \ No newline at end of file +VENDORID 0x70000001 + +SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logservercrash.mmp --- a/loggingservices/eventlogger/test/t_logservercrash.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logservercrash.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2004-2010 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" @@ -14,16 +14,26 @@ // TARGET t_logservercrash.exe +TARGETTYPE exe + // needed to kill another process CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData PowerMgmt -TARGETTYPE exe -SOURCEPATH ../test/src -SOURCE t_logservercrash.cpp test.cpp -SOURCE t_logservsession.cpp + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib bafl.lib logcli.lib + +SOURCEPATH ../test/src +SOURCE t_logservercrash.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY bafl.lib +LIBRARY logcli.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logsimid.mmp --- a/loggingservices/eventlogger/test/t_logsimid.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logsimid.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2009-2010 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" @@ -26,7 +26,9 @@ OS_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCEPATH src -SOURCE t_logsimid.cpp test.cpp +SOURCE t_logsimid.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp SOURCE t_logservsession.cpp SOURCEPATH ../LogServ/src diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logtype.mmp --- a/loggingservices/eventlogger/test/t_logtype.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logtype.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,15 +15,24 @@ TARGET t_logtype.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logtype.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib + +SOURCEPATH ../test/src +SOURCE t_logtype.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logview1.mmp --- a/loggingservices/eventlogger/test/t_logview1.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logview1.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,15 +15,25 @@ TARGET t_logview1.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logview1.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib estor.lib + +SOURCEPATH ../test/src +SOURCE t_logview1.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib +LIBRARY estor.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logview2.mmp --- a/loggingservices/eventlogger/test/t_logview2.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logview2.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -14,16 +14,26 @@ // TARGET t_logview2.exe +TARGETTYPE exe + CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -TARGETTYPE exe -SOURCEPATH ../test/src -SOURCE t_logview2.cpp test.cpp -SOURCE t_logservsession.cpp + USERINCLUDE ../test/inc USERINCLUDE ../Shared MW_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib tzclient.lib + +SOURCEPATH ../test/src +SOURCE t_logview2.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib +LIBRARY tzclient.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logviewfail.mmp --- a/loggingservices/eventlogger/test/t_logviewfail.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logviewfail.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,15 +15,24 @@ TARGET t_logviewfail.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logviewfail.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib +SOURCEPATH ../test/src +SOURCE t_logviewfail.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logviewfail2.mmp --- a/loggingservices/eventlogger/test/t_logviewfail2.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logviewfail2.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,15 +15,24 @@ TARGET t_logviewfail2.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logviewfail2.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib +SOURCEPATH ../test/src +SOURCE t_logviewfail2.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logviewfail3.mmp --- a/loggingservices/eventlogger/test/t_logviewfail3.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logviewfail3.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,15 +15,24 @@ TARGET t_logviewfail3.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logviewfail3.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib +SOURCEPATH ../test/src +SOURCE t_logviewfail3.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY logcli.lib +LIBRARY bafl.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_logwrap.mmp --- a/loggingservices/eventlogger/test/t_logwrap.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/eventlogger/test/t_logwrap.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,15 +15,24 @@ TARGET t_logwrap.exe TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH ../test/src -SOURCE t_logwrap.cpp test.cpp -SOURCE t_logservsession.cpp + +CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData + USERINCLUDE ../test/inc USERINCLUDE ../Shared OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib bafl.lib logcli.lib + +SOURCEPATH ../test/src +SOURCE t_logwrap.cpp +SOURCE t_logutil.cpp +SOURCE t_logutil2.cpp +SOURCE t_logservsession.cpp +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY logwrap.lib +LIBRARY bafl.lib +LIBRARY logcli.lib VENDORID 0x70000001 diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/eventlogger/test/t_maxnumberlength.MMP --- a/loggingservices/eventlogger/test/t_maxnumberlength.MMP Fri Apr 16 16:49:27 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -// Copyright (c) 2004-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: -// T_MAXPHNUMBERLENGTH1.MMP -// -// - -TARGET t_maxnumberlength.exe -TARGETTYPE exe -CAPABILITY WriteDeviceData ReadDeviceData WriteUserData ReadUserData -SOURCEPATH src -SOURCE t_maxnumberlength.CPP -SOURCE test.cpp -SOURCE t_logservsession.cpp - -USERINCLUDE ../test/inc -USERINCLUDE ../Shared -OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib logwrap.lib logcli.lib bafl.lib - - - -VENDORID 0x70000001 - -SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/rfilelogger/Logger/Src/Client.cpp --- a/loggingservices/rfilelogger/Logger/Src/Client.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/rfilelogger/Logger/Src/Client.cpp Mon May 03 14:09:14 2010 +0300 @@ -234,7 +234,7 @@ TBuf16 fileName; GetCPPModuleName(fileName, aFile); // Create a buffer for formatting - HBufC* buffer = HBufC::NewLC(KMaxLoggerLineLength*2); + HBufC* buffer = HBufC::New(KMaxLoggerLineLength*2); if(!buffer) return; // no memory TPtr ptr(buffer->Des()); @@ -289,7 +289,7 @@ } /*----------------- End of Maintaince warning section --------------------------*/ TRAPD(err,WriteL(ptr)); - CleanupStack::PopAndDestroy(buffer); + delete buffer; } diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/rfilelogger/Logger/Src/Server.Cpp --- a/loggingservices/rfilelogger/Logger/Src/Server.Cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/rfilelogger/Logger/Src/Server.Cpp Mon May 03 14:09:14 2010 +0300 @@ -369,7 +369,7 @@ // Text - aText // Start of string retrive/deformating - HBufC8* pBuf1 = HBufC8::NewL(KMaxLoggerLineLength*2); //(aDes.Length()+200); + HBufC8* pBuf1 = HBufC8::New(KMaxLoggerLineLength*2); //(aDes.Length()+200); if(!pBuf1) { return; // no memory @@ -389,12 +389,20 @@ SearchBuf.Set(aPtr.Mid(posI)); aCount[i]=SearchBuf.Find(KSeperation8)+posI; posI=aCount[i]+3; - if(aCount[i] -file=ABI_DIR\DEBUG_DIR\Te_RFileLoggerSuite.exe System\bin\te_RFileLoggerSuite.exe -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TestData\configs\te_RFileLoggerSuite.ini TestData\configs\te_RFileLoggerSuite.ini -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TestData\scripts\te_RFileLoggerSuite.script TestData\Scripts\te_RFileLoggerSuite.Script +file=ABI_DIR\DEBUG_DIR\Te_RFileLoggerSuite.exe system\bin\te_RFileLoggerSuite.exe +data=DATAZ_\testdata\configs\te_rfileloggersuite.ini testdata\configs\te_rfileloggersuite.ini +data=DATAZ_\testdata\scripts\te_rfileloggersuite.script testdata\Scripts\te_rfileloggersuite.script -#endif +#endif // __TE_RFILELOGGER_SUITE_IBY__ diff -r 3eacc0623088 -r 55f2396f6d25 loggingservices/rfilelogger/Logger/te_RFileLogger/src/addfield_logStep.cpp --- a/loggingservices/rfilelogger/Logger/te_RFileLogger/src/addfield_logStep.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/loggingservices/rfilelogger/Logger/te_RFileLogger/src/addfield_logStep.cpp Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,6 @@ #include "addfield_logStep.h" #include "Te_RFileLoggerSuiteDefs.h" -_LIT(K16BitText,"This is a short line of 16 Bit Text"); _LIT(K16BitFormatText,"logger string int = %d, string = %S"); _LIT(K16BitString,"The String16"); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/centralrepository/cenrepsrv/cachemgr.h --- a/persistentstorage/centralrepository/cenrepsrv/cachemgr.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/centralrepository/cenrepsrv/cachemgr.h Mon May 03 14:09:14 2010 +0300 @@ -30,7 +30,7 @@ The default value is approximately the size needed to cache everything during device boot-up @internalComponent */ - #define DEFAULT_CENTREP_CACHE_SIZE 100000 + #define DEFAULT_CENTREP_CACHE_SIZE 200000 #else #if DEFAULT_CENTREP_CACHE_SIZE <= 0 #error "DEFAULT_CENTREP_CACHE_SIZE macro value must be greater than 0" diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/centralrepository/cenrepsrv/srvrepos_noc.cpp --- a/persistentstorage/centralrepository/cenrepsrv/srvrepos_noc.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/centralrepository/cenrepsrv/srvrepos_noc.cpp Mon May 03 14:09:14 2010 +0300 @@ -988,24 +988,24 @@ iRepository = NULL; } -TInt CServerRepository::CheckAccessPolicyBeforeMoving(const TClientRequest& aMessage, const TServerSetting& aSourceSetting, - TUint32 aSourceKey, const TServerSetting& aTargetSetting, TUint32 aTargetKey, TUint32& aErrorKey) +TInt CServerRepository::CheckAccessPolicyBeforeMoving(const TClientRequest& aMessage, const TServerSetting* aSourceSetting, + TUint32 aSourceKey, const TServerSetting* aTargetSetting, TUint32 aTargetKey, TUint32& aErrorKey) { TInt error = KErrNone; - if (&aTargetSetting && !aTargetSetting.IsDeleted()) + if (aTargetSetting && !aTargetSetting->IsDeleted()) { error=KErrAlreadyExists; aErrorKey=aTargetKey; } - if (!aMessage.CheckPolicy(GetReadAccessPolicy(aSourceSetting), + if (!aMessage.CheckPolicy(GetReadAccessPolicy(*aSourceSetting), __PLATSEC_DIAGNOSTIC_STRING("CenRep: CServerRepository::MoveL - Attempt made to read a setting"))) { error = KErrPermissionDenied; aErrorKey = aSourceKey; } - else if (!aMessage.CheckPolicy(GetWriteAccessPolicy(aSourceSetting), + else if (!aMessage.CheckPolicy(GetWriteAccessPolicy(*aSourceSetting), __PLATSEC_DIAGNOSTIC_STRING("CenRep: CServerRepository::MoveL - Attempt made to delete a setting"))) { error = KErrPermissionDenied; @@ -1014,7 +1014,7 @@ else if (error == KErrAlreadyExists) { // set error to KErrPermissionDenied in preference to KErrAlreadyExists - if (!aMessage.CheckPolicy(GetWriteAccessPolicy(aTargetSetting), + if (!aMessage.CheckPolicy(GetWriteAccessPolicy(*aTargetSetting), __PLATSEC_DIAGNOSTIC_STRING("CenRep: CServerRepository::MoveL - Attempt made to create a setting"))) { error = KErrPermissionDenied; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/centralrepository/cenrepsrv/srvrepos_noc.h --- a/persistentstorage/centralrepository/cenrepsrv/srvrepos_noc.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/centralrepository/cenrepsrv/srvrepos_noc.h Mon May 03 14:09:14 2010 +0300 @@ -107,8 +107,8 @@ TInt CheckPermissions(RSettingPointerArray& aSettings, const TClientRequest& aMessage, const char* aDiagnostic,TBool aReadPolicy,TUint32& aErrId); - TInt CheckAccessPolicyBeforeMoving(const TClientRequest& aMessage, const TServerSetting& aSourceSetting, TUint32 aSourceKey, - const TServerSetting& aTargetSetting, TUint32 aTargetKey, TUint32& aErrorKey); + TInt CheckAccessPolicyBeforeMoving(const TClientRequest& aMessage, const TServerSetting* aSourceSetting, TUint32 aSourceKey, + const TServerSetting* aTargetSetting, TUint32 aTargetKey, TUint32& aErrorKey); TInt CheckMovePermissions(const RSettingPointerArray& aSourceSettings,const TClientRequest& aMessage,TUint aSourceToTarget,TUint32& aErrorKey) { @@ -121,7 +121,7 @@ TUint32 targetKey = sourceKey ^ aSourceToTarget; TServerSetting* targetSetting = GetSetting(targetKey); - error = CheckAccessPolicyBeforeMoving(aMessage, *sourceSetting, sourceKey, *targetSetting, targetKey, aErrorKey); + error = CheckAccessPolicyBeforeMoving(aMessage, sourceSetting, sourceKey, targetSetting, targetKey, aErrorKey); } return error; } diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/centralrepository/group/CentralRepositoryTests.bat --- a/persistentstorage/centralrepository/group/CentralRepositoryTests.bat Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/centralrepository/group/CentralRepositoryTests.bat Mon May 03 14:09:14 2010 +0300 @@ -1,5 +1,4 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). @rem All rights reserved. @rem This component and the accompanying materials are made available @rem under the terms of "Eclipse Public License v1.0" @@ -12,18 +11,21 @@ @rem Contributors: @rem @rem Description: -@rem +@rem Batch file to run all the Central Repository textshell RTests. +t_centrep_notifier_handler.exe +t_cenrep_cache.exe +t_cenrep_perf.exe t_cenrep.exe -t_cenrep_perf.exe -t_cenrep_rfs.exe t_cenreptrans.exe t_cenrep_platsec.exe t_cenrep_preq752.exe t_cenrep_transactions.exe t_cenrep_defects.exe +t_cenrep_meta.exe +t_cenrep_rfs.exe t_cenrep_back_rest.exe t_cenrep_back_rest_delete.exe t_oomcenrepsrv.exe -t_cenrep_cache.exe -t_cenrep_preq2112.exe \ No newline at end of file +t_cenrep_preq2112u.exe +t_cenrep_preq2112.exe diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/centralrepository/group/bld.inf --- a/persistentstorage/centralrepository/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/centralrepository/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2004-2010 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" @@ -14,14 +14,14 @@ // PRJ_EXPORTS -../include/centralrepository.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(centralrepository.h) +../include/centralrepository.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(centralrepository.h) #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../include/centralrepositoryinternal.h /epoc32/include/centralrepositoryinternal.h + #ifdef SYMBIAN_OLD_EXPORT_LOCATION + ../include/centralrepositoryinternal.h /epoc32/include/centralrepositoryinternal.h + #endif #endif -#endif -centralrepository.iby /epoc32/rom/include/centralrepository.iby -backup_registration.xml z:/private/10202be9/backup_registration.xml +centralrepository.iby /epoc32/rom/include/centralrepository.iby +backup_registration.xml z:/private/10202be9/backup_registration.xml PRJ_MMPFILES @@ -32,12 +32,34 @@ #endif // WINS #ifdef SYMBIAN_CENREPNOTIFIERHANDLER - //Core OS extension + // Core OS extension #include "../cenrepnotifierhandler/group/bld.inf" #endif // SYMBIAN_CENREPNOTIFIERHANDLER PRJ_TESTEXPORTS +// Stub sis file required by various tests. +../test/testexecute/SWI/data/centrepswiteststub.SIS z:/system/install/centrepswiteststub.sis + +CentralRepositoryTests.bat /epoc32/data/z/system/test/centralrepositorytests.bat +centrepswiteststub.iby /epoc32/rom/include/centrepswiteststub.iby +CentralRepositoryTests.iby /epoc32/rom/include/centralrepositorytests.iby +CentralRepositoryTechviewRTests.iby /epoc32/rom/include/centralrepositorytechviewrtests.iby +centreptesthelper.iby /epoc32/rom/include/centreptesthelper.iby +centreptestdata.iby /epoc32/rom/include/centreptestdata.iby + +// For pccenrep tests. +../pccenrep/include/centralrepository.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(x86tool/centralrepository.h) + +../test/testexecute/SWI/data/certstore/swicertstore.dat z:/resource/versions/swicertstore.dat + +#ifdef SYMBIAN_BAFL_SYSUTIL + //CenRepFotaTvRTests.iby and CentralRepositoryTechviewFlashPerformance.iby are manual tests only. + CenRepFotaTvRTests.iby /epoc32/rom/include/cenrepfotatvrtests.iby + CentralRepositoryTechviewFlashPerformance.iby /epoc32/rom/include/centralrepositorytechviewflashperformance.iby + ../test/t_cenrep_runtxtshellflashtests.bat /epoc32/data/z/system/test/t_cenrep_runtxtshellflashtests.bat + ../test/t_cenrep_runtvflashtests.bat /epoc32/data/z/system/test/t_cenrep_runtvflashtests.bat +#endif // SYMBIAN_BAFL_SYSUTIL ../test/00000100.crb z:/private/10202be9/00000100.crb ../test/00000005.cra z:/private/10202be9/00000005.cra @@ -152,10 +174,10 @@ ../test/RF2.sis z:/private/10202be9/rf2.sis ../test/RF3.sis z:/private/10202be9/rf3.sis ../test/RF4.sis z:/private/10202be9/rf4.sis -../test/testexecute/SWI/data/certstore/swicertstore.dat z:/resource/versions/swicertstore.dat #ifdef SYMBIAN_CENTREP_SUPPORT_MULTIROFS // Multi Rofs testing +centreptestdata_multirofs.iby /epoc32/rom/include/centreptestdata_multirofs.iby ../test/multirofs/testrepository/aaaa0000.txt z:/private/10202be9/aaaa0000.txt ../test/multirofs/testrepository/aaaa0000.txt{01-00} z:/private/10202be9/aaaa0000.txt[01-00] ../test/multirofs/testrepository/bbbb0000.txt z:/private/10202be9/bbbb0000.txt @@ -1400,34 +1422,8 @@ ../test/multirofs/2112_test_keyspaces/102869bc.cre{01-00} z:/private/10202be9/102869bc.cre[01-00] ../test/multirofs/2112_test_keyspaces/102869bd.cre{01-00} z:/private/10202be9/102869bd.cre[01-00] ../test/multirofs/2112_test_keyspaces/102869be.cre{01-00} z:/private/10202be9/102869be.cre[01-00] - #endif // SYMBIAN_CENTREP_SUPPORT_MULTIROFS -// Stub sis file required by various tests. -../test/testexecute/SWI/data/centrepswiteststub.SIS /epoc32/release/winscw/urel/z/system/install/centrepswiteststub.sis -../test/testexecute/SWI/data/centrepswiteststub.SIS /epoc32/release/winscw/udeb/z/system/install/centrepswiteststub.sis - -CentralRepositoryTests.bat /epoc32/data/z/system/test/centralrepositorytests.bat -centrepswiteststub.iby /epoc32/rom/include/centrepswiteststub.iby -CentralRepositoryTests.iby /epoc32/rom/include/centralrepositorytests.iby -CentralRepositoryTechviewRTests.iby /epoc32/rom/include/centralrepositorytechviewrtests.iby -centreptesthelper.iby /epoc32/rom/include/centreptesthelper.iby -centreptestdata.iby /epoc32/rom/include/centreptestdata.iby -#ifdef SYMBIAN_CENTREP_SUPPORT_MULTIROFS - centreptestdata_multirofs.iby /epoc32/rom/include/centreptestdata_multirofs.iby -#endif // SYMBIAN_CENTREP_SUPPORT_MULTIROFS - -#ifdef SYMBIAN_BAFL_SYSUTIL - //CenRepFotaTvRTests.iby and CentralRepositoryTechviewFlashPerformance.iby are manual tests only. - CenRepFotaTvRTests.iby /epoc32/rom/include/cenrepfotatvrtests.iby - CentralRepositoryTechviewFlashPerformance.iby /epoc32/rom/include/centralrepositorytechviewflashperformance.iby - ../test/t_cenrep_runtxtshellflashtests.bat /epoc32/data/z/system/test/t_cenrep_runtxtshellflashtests.bat - ../test/t_cenrep_runtvflashtests.bat /epoc32/data/z/system/test/t_cenrep_runtvflashtests.bat -#endif // SYMBIAN_BAFL_SYSUTIL - -// for pccenrep tests -../pccenrep/include/centralrepository.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(x86tool/centralrepository.h) - PRJ_TESTMMPFILES t_cenrep_helper.mmp support diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/centralrepository/group/centrepswiteststub.iby --- a/persistentstorage/centralrepository/group/centrepswiteststub.iby Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/centralrepository/group/centrepswiteststub.iby Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -16,6 +16,6 @@ #ifndef __CENTREPSWITESTSTUB_IBY__ #define __CENTREPSWITESTSTUB_IBY__ -data=EPOCROOT##Epoc32\release\winscw\udeb\z\System\Install\centrepswiteststub.sis System\Install\centrepswiteststub.sis +data=DATAZ_\system\install\centrepswiteststub.sis system\install\centrepswiteststub.sis #endif // __CENTREPSWITESTSTUB_IBY__ diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/dbms/tdbms/t_dbperf2.cpp --- a/persistentstorage/dbms/tdbms/t_dbperf2.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/dbms/tdbms/t_dbperf2.cpp Mon May 03 14:09:14 2010 +0300 @@ -1304,29 +1304,27 @@ const TDesC& file = findFile.File();//"file" variable contains the drive and the path. the file name in "file" is invalid in this case. (void)TheParse.Set(file, NULL, NULL); TPtrC driveName = TheParse.Drive(); - if(aPath.FindF(driveName) < 0) - { - goto cont; - } + if(aPath.FindF(driveName) >= 0) + { + TInt cnt = fileNameCol->Count(); + for(TInt i=0;i path; + path.Copy(aPath); + path.Append(entry.iName); + path.Append(_L("\\")); + PrintDiskUsage(path, aOffset + 4); + } + } + } // if(aPath.FindF(driveName) >= 0) - TInt cnt = fileNameCol->Count(); - for(TInt i=0;i path; - path.Copy(aPath); - path.Append(entry.iName); - path.Append(_L("\\")); - PrintDiskUsage(path, aOffset + 4); - } - } -cont: delete fileNameCol; fileNameCol = NULL; } while((err = findFile.FindWild(fileNameCol)) == KErrNone);//Get the next set of files diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/GROUP/BLD.INF --- a/persistentstorage/sql/GROUP/BLD.INF Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/GROUP/BLD.INF Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -62,6 +62,8 @@ t_sqloom2.mmp t_sqloom3.mmp t_sqloom4.mmp +t_sqloom5.mmp +t_sqloom6.mmp t_sqlpanic.mmp t_sqllang.mmp t_sqlmulti.mmp diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/GROUP/SqlSrv.mmp --- a/persistentstorage/sql/GROUP/SqlSrv.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/GROUP/SqlSrv.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -45,6 +45,9 @@ SMPSAFE +//CodeWarrior compilation options - disable the "illegal pragma" warning +OPTION CW -w noillpragmas + OS_LAYER_SYSTEMINCLUDE_SYMBIAN OS_LAYER_ESTLIB_SYSTEMINCLUDE USERINCLUDE ../INC diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/GROUP/sqltests.bat --- a/persistentstorage/sql/GROUP/sqltests.bat Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/GROUP/sqltests.bat Mon May 03 14:09:14 2010 +0300 @@ -1,5 +1,5 @@ @rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). @rem All rights reserved. @rem This component and the accompanying materials are made available @rem under the terms of "Eclipse Public License v1.0" @@ -24,6 +24,8 @@ T_SQLOOM2.EXE T_SQLOOM3.EXE T_SQLOOM4.EXE +T_SQLOOM5.EXE +T_SQLOOM6.EXE T_SQLMULTI.EXE T_SQLCOLLATE.EXE T_SQLTRANS.EXE diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/GROUP/sqltests.iby --- a/persistentstorage/sql/GROUP/sqltests.iby Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/GROUP/sqltests.iby Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -68,6 +68,8 @@ file=ABI_DIR\BUILD_DIR\T_SQLOOM2.EXE \TEST\T_SQLOOM2.EXE file=ABI_DIR\BUILD_DIR\T_SQLOOM3.EXE \TEST\T_SQLOOM3.EXE file=ABI_DIR\BUILD_DIR\T_SQLOOM4.EXE \TEST\T_SQLOOM4.EXE +file=ABI_DIR\BUILD_DIR\T_SQLOOM5.EXE \TEST\T_SQLOOM5.EXE +file=ABI_DIR\BUILD_DIR\T_SQLOOM6.EXE \TEST\T_SQLOOM6.EXE file=ABI_DIR\BUILD_DIR\T_SQLMULTI.EXE \TEST\T_SQLMULTI.EXE file=ABI_DIR\BUILD_DIR\T_SQLCOLLATE.EXE \TEST\T_SQLCOLLATE.EXE file=ABI_DIR\BUILD_DIR\T_SQLTRANS.EXE \TEST\T_SQLTRANS.EXE diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/GROUP/t_sqloom5.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/persistentstorage/sql/GROUP/t_sqloom5.mmp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,92 @@ +// Copyright (c) 2010 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: +// +#include +TARGET t_sqloom5.exe +TARGETTYPE EXE +CAPABILITY ProtServ AllFiles + +EPOCFIXEDPROCESS + +#ifdef WINSCW +EPOCHEAPSIZE 0x00020000 0x00600000 +#else +EPOCHEAPSIZE 0x00020000 0x02000000 +#endif + +EPOCSTACKSIZE 0x3000 + +UID 0 0x10281E17 + +MACRO SQLSRV_STARTUP_TEST + +USERINCLUDE . +USERINCLUDE ../INC +USERINCLUDE ../SRC/Common +USERINCLUDE ../SRC/Common/IPC +USERINCLUDE ../SRC/Common/Trace +USERINCLUDE ../SRC/Server +USERINCLUDE ../SRC/Server/Compact +USERINCLUDE ../SRC/Server/IPC +USERINCLUDE ../SRC/Security +USERINCLUDE ../SQLite +USERINCLUDE ../OsLayer +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE + +SOURCEPATH ../TEST +SOURCE t_sqloom5.cpp + +SOURCEPATH ../SRC/Common +SOURCE SqlBufFlat.cpp +SOURCE SqlUtil.cpp + +SOURCEPATH ../SRC/Security +SOURCE SqlSecurityImpl.cpp + +SOURCEPATH ../SRC/Server +SOURCE SqlSrvAuthorizer.cpp +SOURCE SqlBur.cpp +SOURCE SqlSrvCollation.cpp +SOURCE SqlSrvConfig.cpp +SOURCE SqlSrvCheckStatement.cpp +SOURCE SqlSrvMain.cpp +SOURCE SqlSrvDatabase.cpp +SOURCE SqlSrvDbSysSettings.cpp +SOURCE SqlSrvDriveSpace.cpp +SOURCE SqlSrvFileData.cpp +SOURCE SqlSrvStrings.cpp +SOURCE SqlSrvStatementUtil.cpp +SOURCE SqlSrvSecurityMap.cpp +SOURCE SqlSrvUtil.cpp +SOURCE SqlSrvResourceProfiler.cpp + +SOURCEPATH ../SRC/Server/Compact +SOURCE SqlCompact.cpp +SOURCE SqlCompactConn.cpp +SOURCE SqlCompactEntry.cpp +SOURCE SqlCompactTimer.cpp + +LIBRARY estlib.lib +LIBRARY charconv.lib +LIBRARY hal.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY abclient.lib +STATICLIBRARY sqlite.lib + +VENDORID 0x70000001 + +SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/GROUP/t_sqloom6.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/persistentstorage/sql/GROUP/t_sqloom6.mmp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,47 @@ +// Copyright (c) 2010 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: +// + +TARGET t_sqloom6.exe +TARGETTYPE EXE +CAPABILITY None + +EPOCSTACKSIZE 0x10000 + +USERINCLUDE . +USERINCLUDE ../INC +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE +USERINCLUDE ../OsLayer +#ifdef SYMBIAN_USE_SQLITE_VERSION_3_6_4 +USERINCLUDE ../SQLite364 +#else +USERINCLUDE ../SQLite +#endif + +SOURCEPATH ../TEST +SOURCE t_sqloom6.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY sqldb.lib +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY estlib.lib +LIBRARY hal.lib +STATICLIBRARY sqlite.lib + +VENDORID 0x70000001 + +SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/GROUP/t_sqlstartup.mmp --- a/persistentstorage/sql/GROUP/t_sqlstartup.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/GROUP/t_sqlstartup.mmp Mon May 03 14:09:14 2010 +0300 @@ -12,7 +12,7 @@ // // Description: // - +#include TARGET t_sqlstartup.exe TARGETTYPE EXE CAPABILITY ProtServ AllFiles @@ -61,6 +61,7 @@ SOURCE SqlSrvStatementUtil.cpp SOURCE SqlSrvSecurityMap.cpp SOURCE SqlSrvUtil.cpp +SOURCE SqlSrvResourceProfiler.cpp SOURCEPATH ../SRC/Server/Compact SOURCE SqlCompact.cpp diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/OsLayer/FileBuf64.cpp --- a/persistentstorage/sql/OsLayer/FileBuf64.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/OsLayer/FileBuf64.cpp Mon May 03 14:09:14 2010 +0300 @@ -37,7 +37,7 @@ { \ if(TheOsCallTimeDetailedProfileEnabled) \ { \ - ++iFileWriteCount, iFileWriteAmount += (amount); \ + ++iFileWriteCount; iFileWriteAmount += (amount); \ RDebug::Print(_L(" -- FWrite this=%X, Cnt=%d, Pos=%ld, Amt=%d, Ttl=%ld\r\n"), (TUint32)this, iFileWriteCount, pos, amount, iFileWriteAmount); \ } \ } while(0) diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/OsLayer/os_symbian.cpp --- a/persistentstorage/sql/OsLayer/os_symbian.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/OsLayer/os_symbian.cpp Mon May 03 14:09:14 2010 +0300 @@ -1320,12 +1320,25 @@ } /** -Replaces all invalid characters in aFileName. +Removes all invalid characters in aFileName. If the file name contains handles (so that's a private secure database related name), the additional information (handles, flags, object addresses) has to be excluded from the name in order to make it usable -by the file system. +by the file system. + +The private file name format is (see FhExtractAndStore() comments): + +"||" -@param aFileName Output parameter. The cleaned file name will be copied there. +Before opening or creating a file, SQLite will call TVfs::FullPathName() passing to the function the name of +the file and expecting the full file name (including path) as an output from the function. +After the TVfs::FullPathName() call, the full file name, returned to SQLite, will have the following format: + +"||" + +FhConvertToFileName() is called from TVfs::Open() and will remove the leading and trialing '|' characters from +the file name. + +@param aFileName Input/Output parameter. The cleaned file name will be copied there. @param aPrivateDir The SQL server private data cage. @see TVfs::Open() @@ -1352,7 +1365,7 @@ } /** -Extracts the read-only flag and RMessage address from aDbFileName and stores them in single COsLayerData instance. +Extracts the read-only flag and RMessage address from aDbFileName and stores them in the single COsLayerData instance. @param aDbFileName Input/output parameter. The file name. It will be reformatted and won't contain the already extracted data. @@ -2235,7 +2248,7 @@ else { if(fhStrType == EFhStr) - {//Not the main db file. Replace invalid characters in the file name + {//Not the main db file. Remove invalid characters in the file name ::FhConvertToFileName(fname, osLayerData.iSysPrivDir);//If fname does not have a path, iSysPrivDir will be used } TInt fmode = EFileRead; @@ -2618,9 +2631,11 @@ Memory allocation routine. +EXPORT_C required to match IMPORT_C in stdlib.h and avoid compiler warning + @internalComponent */ -extern "C" void* sqlite3SymbianMalloc(size_t aSize) +extern "C" EXPORT_C void* sqlite3SymbianMalloc(size_t aSize) { __MEM_CALL(EMemOpAlloc, aSize, 0); return Allocator().Alloc(aSize); @@ -2631,9 +2646,11 @@ Memory reallocation routine. +EXPORT_C required to match IMPORT_C in stdlib.h and avoid compiler warning + @internalComponent */ -extern "C" void* sqlite3SymbianRealloc(void* aPtr, size_t aSize) +extern "C" EXPORT_C void* sqlite3SymbianRealloc(void* aPtr, size_t aSize) { #ifdef _SQLPROFILER TInt size = Allocator().AllocLen(aPtr); @@ -2647,9 +2664,11 @@ Memory free routine. +EXPORT_C required to match IMPORT_C in stdlib.h and avoid compiler warning + @internalComponent */ -extern "C" void sqlite3SymbianFree(void* aPtr) +extern "C" EXPORT_C void sqlite3SymbianFree(void* aPtr) { #ifdef _SQLPROFILER TInt size = Allocator().AllocLen(aPtr); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/alter.c --- a/persistentstorage/sql/SQLite/alter.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/alter.c Mon May 03 14:09:14 2010 +0300 @@ -46,7 +46,7 @@ unsigned char const *zTableName = sqlite3_value_text(argv[1]); int token; - Token tname; + Token tname = {0,0,0}; /* Initialized to placate warning */ unsigned char const *zCsr = zSql; int len = 0; char *zRet; @@ -101,7 +101,7 @@ unsigned char const *zTableName = sqlite3_value_text(argv[1]); int token; - Token tname; + Token tname = {0,0,0}; /* Initialized to placate warning */ int dist = 3; unsigned char const *zCsr = zSql; int len = 0; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/attach.c --- a/persistentstorage/sql/SQLite/attach.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/attach.c Mon May 03 14:09:14 2010 +0300 @@ -144,8 +144,11 @@ sqlite3PagerLockingMode(pPager, db->dfltLockMode); sqlite3PagerJournalMode(pPager, db->dfltJournalMode); } + aNew->safety_level = 3; aNew->zName = sqlite3DbStrDup(db, zName); - aNew->safety_level = 3; + if( rc==SQLITE_OK && aNew->zName==0 ){ + rc = SQLITE_NOMEM; + } #if SQLITE_HAS_CODEC { diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/btree.c --- a/persistentstorage/sql/SQLite/btree.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/btree.c Mon May 03 14:09:14 2010 +0300 @@ -3021,7 +3021,7 @@ Pgno *pPgnoNext /* OUT: Next overflow page number */ ){ Pgno next = 0; - int rc; + int rc = SQLITE_OK; /* Initialized to placate warning */ assert( sqlite3_mutex_held(pBt->mutex) ); /* One of these must not be NULL. Otherwise, why call this function? */ diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/delete.c --- a/persistentstorage/sql/SQLite/delete.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/delete.c Mon May 03 14:09:14 2010 +0300 @@ -143,10 +143,10 @@ int isView; /* True if attempting to delete from a view */ int triggers_exist = 0; /* True if any triggers exist */ #endif - int iBeginAfterTrigger; /* Address of after trigger program */ - int iEndAfterTrigger; /* Exit of after trigger program */ - int iBeginBeforeTrigger; /* Address of before trigger program */ - int iEndBeforeTrigger; /* Exit of before trigger program */ + int iBeginAfterTrigger = 0; /* Address of after trigger program */ + int iEndAfterTrigger = 0; /* Exit of after trigger program */ + int iBeginBeforeTrigger = 0; /* Address of before trigger program */ + int iEndBeforeTrigger = 0; /* Exit of before trigger program */ u32 old_col_mask = 0; /* Mask of OLD.* columns in use */ sContext.pParse = 0; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/expr.c --- a/persistentstorage/sql/SQLite/expr.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/expr.c Mon May 03 14:09:14 2010 +0300 @@ -2737,7 +2737,7 @@ Expr opCompare; /* The X==Ei expression */ Expr cacheX; /* Cached expression X */ Expr *pX; /* The X expression */ - Expr *pTest; /* X==Ei (form A) or just Ei (form B) */ + Expr *pTest = 0; /* X==Ei (form A) or just Ei (form B) */ assert(pExpr->pList); assert((pExpr->pList->nExpr % 2) == 0); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/func.c --- a/persistentstorage/sql/SQLite/func.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/func.c Mon May 03 14:09:14 2010 +0300 @@ -911,7 +911,7 @@ flags = SQLITE_PTR_TO_INT(sqlite3_user_data(context)); if( flags & 1 ){ while( nIn>0 ){ - int len; + int len = 0; /* Initialized to placate warning. */ for(i=0; i0 ){ - int len; + int len = 0; /* Initialized to placate warning. */ for(i=0; ilru.pFirstSynced==0 && pPager->doNotSync) ){ - void *pData; + void *pData = 0; /* Initialized to placate warning */ if( pPager->nPage>=pPager->nHash ){ pager_resize_hash_table(pPager, pPager->nHash<256 ? 256 : pPager->nHash*2); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/printf.c --- a/persistentstorage/sql/SQLite/printf.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/printf.c Mon May 03 14:09:14 2010 +0300 @@ -263,7 +263,7 @@ char buf[etBUFSIZE]; /* Conversion buffer */ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */ etByte errorflag = 0; /* True if an error is encountered */ - etByte xtype; /* Conversion paradigm */ + etByte xtype = 0; /* Conversion paradigm */ char *zExtra; /* Extra memory used for etTCLESCAPE conversions */ #ifndef SQLITE_OMIT_FLOATING_POINT int exp, e2; /* exponent of real numbers */ diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/readme.txt --- a/persistentstorage/sql/SQLite/readme.txt Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/readme.txt Mon May 03 14:09:14 2010 +0300 @@ -110,3 +110,7 @@ - SQLITE 3.6.1 09,September,2008 Fixes. + +- SQLITE 3.6.1 24,February,2010 + DEF144603: SQL, SQLite attempts to dereference a NULL pointer during OOM test. + diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/select.c --- a/persistentstorage/sql/SQLite/select.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/select.c Mon May 03 14:09:14 2010 +0300 @@ -2467,7 +2467,7 @@ int regOutA; /* Address register for the output-A subroutine */ int regOutB; /* Address register for the output-B subroutine */ int addrOutA; /* Address of the output-A subroutine */ - int addrOutB; /* Address of the output-B subroutine */ + int addrOutB = 0; /* Address of the output-B subroutine */ int addrEofA; /* Address of the select-A-exhausted subroutine */ int addrEofB; /* Address of the select-B-exhausted subroutine */ int addrAltB; /* Address of the A>18; @@ -655,8 +672,8 @@ /* a: p2<<28 | p4<<14 | p6 (unmasked) */ if (!(a&0x80)) { - a &= (0x7f<<28)|(0x7f<<14)|(0x7f); - b &= (0x7f<<14)|(0x7f); + a &= SLOT_4_2_0; + b &= SLOT_2_0; b = b<<7; a |= b; s = s>>11; @@ -665,14 +682,14 @@ } /* CSE2 from below */ - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; p++; b = b<<14; b |= *p; /* b: p3<<28 | p5<<14 | p7 (unmasked) */ if (!(b&0x80)) { - b &= (0x7f<<28)|(0x7f<<14)|(0x7f); + b &= SLOT_4_2_0; /* moved CSE2 up */ /* a &= (0x7f<<14)|(0x7f); */ a = a<<7; @@ -689,7 +706,7 @@ /* moved CSE2 up */ /* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */ - b &= (0x7f<<14)|(0x7f); + b &= SLOT_2_0; b = b<<8; a |= b; @@ -767,8 +784,8 @@ /* a: p0<<28 | p2<<14 | p4 (unmasked) */ if (!(a&0x80)) { - a &= (0x7f<<28)|(0x7f<<14)|(0x7f); - b &= (0x7f<<28)|(0x7f<<14)|(0x7f); + a &= SLOT_4_2_0; + b &= SLOT_4_2_0; b = b<<7; *v = a | b; return 5; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite/vdbe.c --- a/persistentstorage/sql/SQLite/vdbe.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite/vdbe.c Mon May 03 14:09:14 2010 +0300 @@ -543,8 +543,10 @@ int rc = SQLITE_OK; /* Value to return */ sqlite3 *db = p->db; /* The database */ u8 encoding = ENC(db); /* The database encoding */ - Mem *pIn1, *pIn2, *pIn3; /* Input operands */ - Mem *pOut; /* Output operand */ + Mem *pIn1 = 0; /* Input operands */ + Mem *pIn2 = 0; /* Input operands */ + Mem *pIn3 = 0; /* Input operands */ + Mem *pOut = 0; /* Output operand */ u8 opProperty; int iCompare = 0; /* Result of last OP_Compare operation */ int *aPermute = 0; /* Permuation of columns for OP_Compare */ @@ -3532,7 +3534,7 @@ */ case OP_Delete: { int i = pOp->p1; - i64 iKey; + i64 iKey = 0; Cursor *pC; assert( i>=0 && inCursor ); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite364/attach.c --- a/persistentstorage/sql/SQLite364/attach.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite364/attach.c Mon May 03 14:09:14 2010 +0300 @@ -144,8 +144,11 @@ sqlite3PagerLockingMode(pPager, db->dfltLockMode); sqlite3PagerJournalMode(pPager, db->dfltJournalMode); } + aNew->safety_level = 3; aNew->zName = sqlite3DbStrDup(db, zName); - aNew->safety_level = 3; + if( rc==SQLITE_OK && aNew->zName==0 ){ + rc = SQLITE_NOMEM; + } #if SQLITE_HAS_CODEC { diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SQLite364/readme.txt --- a/persistentstorage/sql/SQLite364/readme.txt Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SQLite364/readme.txt Mon May 03 14:09:14 2010 +0300 @@ -110,3 +110,6 @@ - SQLITE 3.6.1 09,September,2008 Fixes. + +- SQLITE 3.6.4 24,February,2010 + DEF144603: SQL, SQLite attempts to dereference a NULL pointer during OOM test. diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp --- a/persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -39,7 +39,7 @@ static const TInt KCompactStartStepSize = 32 * 1024; /** -Calculates the amount of space that has to be removed from the database. +The aim of the function is to determine the maximum size of space to be freed, which fits within the time constraint. The decision is based on the time spent on the pervious compaction step. If the time is bigger than KCompactMaxStepTimeUs then the space will be reduced by factor of 2 (slow media), bet will never be less than KCompactMinStepSize. @@ -72,7 +72,8 @@ aStep *= 2; } if(aRemaining < aStep) - { + {//If, for example, aStep is 4000 bytes, aRemaining is 2000 bytes, then the step should be 2000, + //because that is what is left in the database as a free space. aStep = aRemaining; } return aStep; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Client/SqlStatementImpl.cpp --- a/persistentstorage/sql/SRC/Client/SqlStatementImpl.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Client/SqlStatementImpl.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for defect 1915 "SQL server panics when using long column type strings" // // Description: // @@ -18,8 +19,6 @@ //Constants -_LIT(KSemiColon,";"); - _LIT(KTextKWD, "TEXT"); _LIT(KCharKWD, "CHAR"); _LIT(KClobKWD, "CLOB"); @@ -449,42 +448,50 @@ TInt CSqlStatementImpl::DeclaredColumnType(TInt aColumnIndex, TSqlColumnType& aColumnType) { __SQLASSERT_ALWAYS((TUint)aColumnIndex < (TUint)iColumnCnt, ESqlPanicBadColumnIndex); - if(iDeclaredColumnTypes.Count() == 0 && iColumnCnt > 0) //initialise iDeclaredColumnTypes array if necessary + if(iDeclaredColumnTypes.Count() == 0) //initialise iDeclaredColumnTypes array if necessary { - TInt err = iDeclaredColumnTypes.Reserve(iColumnCnt);//We know what the array size should be - iColumnCnt + RSqlBufFlat declaredColumnTypeBuf; + TInt err = declaredColumnTypeBuf.SetCount(iColumnCnt); if(err != KErrNone) { + declaredColumnTypeBuf.Close(); return err; } - HBufC* colTypeNamesBuf = NULL;//Buffer for declared column type names, delimited by ';'. - TRAP(err, colTypeNamesBuf = GetDeclColumnTypesL()); + + //Resize buffer to minimise the chance that two IPC calls are required to get all the column type name data. + //Allocates enough space to contain the header cells (already created by calling SetCount()) and a data buffer + //which assumes an average column type name length of 20 characters plus 8-byte alignment padding + const TInt KBufSizePerColumn = 48; + TInt newSize = declaredColumnTypeBuf.Size() + iColumnCnt*KBufSizePerColumn; + + err = declaredColumnTypeBuf.ReAlloc(newSize); if(err != KErrNone) { - __SQLASSERT(!colTypeNamesBuf, ESqlPanicInternalError); - iDeclaredColumnTypes.Reset(); + declaredColumnTypeBuf.Close(); return err; } - //Iterate over the column type names and map each column type name to one of the TSqlColumnType enum item values. - //No error can occur from here till the end of the function code. - __SQLASSERT(colTypeNamesBuf != NULL, ESqlPanicInternalError); - TPtrC colTypeNames(*colTypeNamesBuf); - TInt colIdx = 0; - while(colTypeNames.Length() > 0) + + err = iSqlStmtSession.GetDeclColumnTypes(declaredColumnTypeBuf); + if(err != KErrNone) + { + declaredColumnTypeBuf.Close(); + return err; + } + + err = iDeclaredColumnTypes.Reserve(iColumnCnt);//We know what the array size should be - iColumnCnt + if(err != KErrNone) { - TInt pos = colTypeNames.Find(KSemiColon); - if(pos < 0) - { - break; - } - TPtrC colTypeName(colTypeNames.Ptr(), pos); - if(pos == colTypeNames.Length() - 1) - { - colTypeNames.Set(NULL, 0); - } - else - { - colTypeNames.Set(colTypeNames.Ptr() + pos + 1, colTypeNames.Length() - (pos + 1)); - } + declaredColumnTypeBuf.Close(); + return err; + } + + //Iterate over the column type names buffer and map each column type name to one of the TSqlColumnType enum item values. + TSqlBufRIterator declColumnTypeBufIt; + declColumnTypeBufIt.Set(declaredColumnTypeBuf); + TInt colIdx = 0; + while(declColumnTypeBufIt.Next()) + { + TPtrC colTypeName(declColumnTypeBufIt.Text()); TSqlColumnType colType = ESqlInt; if(colTypeName.FindF(KCharKWD) >= 0 || colTypeName.FindF(KTextKWD) >= 0 || colTypeName.FindF(KClobKWD) >= 0) { @@ -501,10 +508,10 @@ err = iDeclaredColumnTypes.Append(colType); __SQLASSERT(err == KErrNone, ESqlPanicInternalError);//memory for the array elements has been reserved already ++colIdx; - }//end of - while(colTypeNames.Length() > 0) + } //end of - while(declColumnTypeBufIt.Next()) __SQLASSERT(colIdx == iColumnCnt, ESqlPanicInternalError); - delete colTypeNamesBuf; - }//end of - if(iDeclaredColumnTypes.Count() == 0 && iColumnCnt > 0) + declaredColumnTypeBuf.Close(); + } //end of - if(iDeclaredColumnTypes.Count() == 0 && iColumnCnt > 0) aColumnType = iDeclaredColumnTypes[aColumnIndex]; return KErrNone; } @@ -863,15 +870,3 @@ return KErrNone; } - -/** -Returns a buffer containing a ";" separated list with declared types of statement's columns. -The caller is responsible for deleting the result buffer. - -@return HBufC buffer - column types list. -*/ -HBufC* CSqlStatementImpl::GetDeclColumnTypesL() - { - return iSqlStmtSession.GetDeclColumnTypesL(iColumnCnt); - } - diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Client/SqlStatementImpl.h --- a/persistentstorage/sql/SRC/Client/SqlStatementImpl.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Client/SqlStatementImpl.h Mon May 03 14:09:14 2010 +0300 @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for Bug 1915 "SQL server panics when using long column type strings" // // Description: // @@ -141,8 +142,6 @@ inline MStreamBuf* ColumnSourceL(TInt aColumnIndex); inline MStreamBuf* ParamSinkL(TSqlSrvFunction aFunction, TInt aParamIndex); - HBufC* GetDeclColumnTypesL(); - private: inline CSqlStatementImpl(); template TInt Construct(CSqlDatabaseImpl& aDatabase, const DES& aSqlStmt); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Client/SqlStmtSession.cpp --- a/persistentstorage/sql/SRC/Client/SqlStmtSession.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Client/SqlStmtSession.cpp Mon May 03 14:09:14 2010 +0300 @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for Bug 1915 "SQL server panics when using long column type strings" // // Description: // @@ -131,25 +132,20 @@ } /** -Sends a command to the server for retrieving a string with ";" separated declared types of columns -The caller is responsible for deleting the result buffer. - -@param aColumnCount The number of the columns which the statement has. -@return A pointer to a heap based HBufC object, containing the column names, separated with ";". +Sends a command to the server for retrieving the declared types of columns Usage of the IPC call arguments: -Arg 0: [out] Input buffer max length -Arg 1: [in/out] Data buffer, will be filled with the declared types of columns, separated with ";" -*/ -HBufC* RSqlStatementSession::GetDeclColumnTypesL(TInt aColumnCount) +Arg 0: [out] buffer length in bytes +Arg 1: [in/out] buffer +*/ +TInt RSqlStatementSession::GetDeclColumnTypes(RSqlBufFlat& aDeclColumnTypeBuf) { - //The longest DBMS data type, represented as text, is "LONG VARBINARY" - 14 characters. - //So we can safely assume that 20 characters buffer space per DBMS column type is enough. - const TInt KLongestDbmsTypeLength = 20; - HBufC* colTypeBuf = HBufC::NewLC(aColumnCount * KLongestDbmsTypeLength); - TPtr ptr = colTypeBuf->Des(); - TInt err = DbSession().SendReceive(::MakeMsgCode(ESqlSrvStmtDeclColumnTypes, ESqlSrvStatementHandle, iHandle), TIpcArgs(ptr.MaxLength(), &ptr)); - __SQLLEAVE_IF_ERROR(err); - CleanupStack::Pop(colTypeBuf); - return colTypeBuf; + aDeclColumnTypeBuf.Reset(); + TPtr8& ptr = aDeclColumnTypeBuf.BufPtr(); + TInt err = DbSession().SendReceive(::MakeMsgCode(ESqlSrvStmtDeclColumnTypes, ESqlSrvStatementHandle, iHandle), TIpcArgs(ptr.MaxLength(), &ptr)); + if(err > KSqlClientBufOverflowCode) + { + err = Retry(aDeclColumnTypeBuf, err - KSqlClientBufOverflowCode, ESqlDeclColumnTypesBuf); + } + return err; } diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Client/SqlStmtSession.h --- a/persistentstorage/sql/SRC/Client/SqlStmtSession.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Client/SqlStmtSession.h Mon May 03 14:09:14 2010 +0300 @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for Bug 1915 "SQL server panics when using long column type strings" // // Description: // @@ -97,8 +98,8 @@ inline MStreamBuf* ColumnSourceL(TInt aColumnIndex); inline MStreamBuf* ParamSinkL(TSqlSrvFunction aFunction, TInt aParamIndex); - HBufC* GetDeclColumnTypesL(TInt aColumnCount); - + TInt GetDeclColumnTypes(RSqlBufFlat& aDeclColumnTypeBuf); + private: TInt DoBindNext(TSqlSrvFunction aFunction, TIpcArgs& aIpcArgs, RSqlBufFlat& aColumnBuf); TInt Retry(RSqlBufFlat& aBufFlat, TInt aSize, TSqlBufFlatType aWhat); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Common/SqlMap.inl --- a/persistentstorage/sql/SRC/Common/SqlMap.inl Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Common/SqlMap.inl Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2004-2010 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" @@ -132,6 +132,13 @@ { iDestructor.Destroy(pair.iKey, pair.iData); iSet.Remove(idx); +#ifdef _DEBUG +//This is used prevent the failure of the resource allocation checking in debug mode. + if(iSet.Count() == 0) + { + iSet.Reset(); + } +#endif } return; } diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Common/SqlUtil.h --- a/persistentstorage/sql/SRC/Common/SqlUtil.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Common/SqlUtil.h Mon May 03 14:09:14 2010 +0300 @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for Bug 1915 "SQL server panics when using long column type strings" // // Description: // @@ -65,7 +66,8 @@ { ESqlColumnNamesBuf, ESqlParamNamesBuf, - ESqlColumnValuesBuf + ESqlColumnValuesBuf, + ESqlDeclColumnTypesBuf }; /** diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Common/Trace/UTraceSql.h --- a/persistentstorage/sql/SRC/Common/Trace/UTraceSql.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Common/Trace/UTraceSql.h Mon May 03 14:09:14 2010 +0300 @@ -44,8 +44,7 @@ @SymTraceMacro */ -#undef SYMBIAN_TRACE_SQL_ERR - +//#define SYMBIAN_TRACE_SQL_ERR /** Enable this macro to compile in the SQL trace points that trace exported functions and certain porting layer functions entry and exit. From the timestamps of these trace, the total time spent @@ -54,8 +53,7 @@ @SymTraceMacro */ -#undef SYMBIAN_TRACE_SQL_FUNC - +//#define SYMBIAN_TRACE_SQL_FUNC /** Enable this macro to compile in the SQL trace points that trace the following internal events. - IPC calls send to and serviced by the SQL Server @@ -66,8 +64,7 @@ @SymTraceMacro */ -#undef SYMBIAN_TRACE_SQL_EVENTS - +//#define SYMBIAN_TRACE_SQL_EVENTS #endif //SQL_ENABLE_TRACE ////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -130,7 +127,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////// UTrace Related Macro Functions and Class Declarations //////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef SYMBIAN_TRACE_SQL_ERR +#if defined SYMBIAN_TRACE_SQL_ERR && defined SQL_ENABLE_TRACE //This macro should be used to trace errors occurring within Symbian SQL. //To use the macro, insert the full UTF statement as the macro parameter @@ -143,7 +140,7 @@ #endif //SYMBIAN_TRACE_SQL_ERR -#ifdef SYMBIAN_TRACE_SQL_FUNC +#if defined SYMBIAN_TRACE_SQL_FUNC && defined SQL_ENABLE_TRACE /** This class is used to help trace function entry and exits within Symbian SQL @@ -170,7 +167,7 @@ #define SQLUTRACE_PROFILER(x) do {} while(0) #endif //SYMBIAN_TRACE_SQL_FUNC -#ifdef SYMBIAN_TRACE_SQL_EVENTS +#if defined SYMBIAN_TRACE_SQL_EVENTS && defined SQL_ENABLE_TRACE //This macro should be used to trace events occurring within Symbian SQL. //To use the macro, insert the full UTF statement as the macro parameter diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/Compact/SqlCompact.cpp --- a/persistentstorage/sql/SRC/Server/Compact/SqlCompact.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompact.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -24,7 +24,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** -Initializes the background compaction stettings with their default values. +Initializes the background compaction settings with their default values. */ TSqlCompactSettings::TSqlCompactSettings() : iStepLength(KSqlCompactStepLengthMs), @@ -59,7 +59,7 @@ Creates a new CSqlCompactor instance. @param aConnFactoryL MSqlCompactConn factory function. -@param aCompactStepInterval The time intrerval (ms) between the background compaction steps. +@param aCompactStepInterval The time interval (ms) between the background compaction steps. @return A pointer to the created CSqlCompactor instance @@ -119,7 +119,7 @@ /** If an entry referring to a database with name aFullName does not exist in the container, a new entry will be created, a connection with the database established. -If an entry with the specidfied name already exists, no new entry wil be created, the reference counter of the existing one +If an entry with the specified name already exists, no new entry wil be created, the reference counter of the existing one will be incremented. @param aFullName The full database name, including the path. @@ -130,7 +130,7 @@ errors categorised as ESqlDbError, and other system-wide error codes. @panic SqlDb 4 In _DEBUG mode. Too short or too long database name (aFullName parameter) -@panic SqlDb 7 In _DEBUG mode. An entry with the specidfied name has been found but the entry is NULL. +@panic SqlDb 7 In _DEBUG mode. An entry with the specified name has been found but the entry is NULL. */ void CSqlCompactor::AddEntryL(const TDesC& aFullName, const TSqlCompactSettings& aSettings) { @@ -156,7 +156,8 @@ /** Decrements the reference counter of the specified entry. -If the counter reaches zero, the entry will be destroyed and removed form the container, the database connection - closed. +If the counter reaches zero, the entry will be destroyed and removed from the container, +the database connection - closed. @param aFullName The full database name, including the path. */ diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/Compact/SqlCompact.h --- a/persistentstorage/sql/SRC/Server/Compact/SqlCompact.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompact.h Mon May 03 14:09:14 2010 +0300 @@ -1,5 +1,5 @@ /** -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 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" @@ -18,7 +18,7 @@ * Only one instance of that class should be created by the server. * The CSqlCompactor single instance manages a set of reference counted per-database entries and a CTimer compaction object. * The MSqlCompactConn interface acts as an abstraction layer between the compaction entries and the -* real object which functions are used to perform the compaction. +* real object with member functions that are used to perform the compaction. * * */ @@ -118,7 +118,7 @@ aFreePageCallback.iThreshold must be set to be in Kb. If the function call completes successfully and the free pages space is above the threshold, the aFreePageCallback.iThreshold will be set to contain the free pages count. - Otherwise aFreePageCallback.iThreshold will be initizized with zero. + Otherwise aFreePageCallback.iThreshold will be initialized with zero. @return A pointer to the created MSqlCompactConn interface. diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.cpp --- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -27,11 +27,11 @@ @param aFullName The full database name, including the path. @param aFreePageCallback A reference to an object containing the free pages threshold and the callback - that needs to be called when the free page count reaches ot is above the threshold. + that needs to be called when the free page count reaches or is above the threshold. aFreePageCallback.iThreshold must be set to be in Kb. If the function call completes successfully and the free pages space is above the threshold, the aFreePageCallback.iThreshold will be set to contain the free pages count. - Otherwise aFreePageCallback.iThreshold will be initizized with zero. + Otherwise aFreePageCallback.iThreshold will be initialized with zero. @return A pointer to the created CSqlCompactConn instance @@ -106,11 +106,11 @@ @param aFullName The full database name, including the path. @param aFreePageCallback Input/Output parameter. A reference to an object containing the free pages threshold and - the callback that needs to be called when the free page count reaches ot is above the threshold. + the callback that needs to be called when the free page count reaches or is above the threshold. aFreePageCallback.iThreshold must be set to be in Kb. If the function call completes successfully and the free pages space is above the threshold, the aFreePageCallback.iThreshold will be set to contain the free pages count. - Otherwise aFreePageCallback.iThreshold will be initizized with zero. + Otherwise aFreePageCallback.iThreshold will be initialized with zero. @leave KErrNoMemory, an out of memory condition has occurred, KErrArgument, invalid data in the aFreePageCallback object; @@ -129,13 +129,13 @@ TBuf8 fname; (void)::UTF16ToUTF8Z(aFullName, fname);//The file is first open by the main connection. - //The conversion here should always succeeds. + //The conversion here should always succeed. //Even in a case of a conversion failure, the next line will report a failure. __SQLLEAVE_IF_ERROR(::CreateDbHandle8(fname, iHandle)); TInt pageSize = PageSizeL(); - TInt64 freePageThersholdKb = aFreePageCallback.iThreshold;//"TInt64" because the calculation of the pages may cause an overflow on the next line - aFreePageCallback.iThreshold = (freePageThersholdKb * 1024) / pageSize;//the threshold can be 0 + TInt64 freePageThresholdKb = aFreePageCallback.iThreshold;//"TInt64" because the calculation of the pages may cause an overflow on the next line + aFreePageCallback.iThreshold = (freePageThresholdKb * 1024) / pageSize;//the threshold can be 0 TBuf8 dbName; dbName.Copy(KMainDb8); @@ -145,7 +145,7 @@ TInt64 freePageCount = FreePageCountL();//"TInt64" because the calculation of the free space may cause an overflow on the next line TInt freePageSpaceKb = (freePageCount * pageSize) / 1024; //Set iThreshold with the free pages count, if right now the database has free space above the threshold. - aFreePageCallback.iThreshold = freePageSpaceKb >= freePageThersholdKb ? freePageCount : 0; + aFreePageCallback.iThreshold = freePageSpaceKb >= freePageThresholdKb ? freePageCount : 0; } /** @@ -199,11 +199,11 @@ @param aFullName The full name of the database to be compacted (including the path). @param aFreePageCallback A reference to an object containing the free pages threshold and the callback - that needs to be called when the free page count reaches ot is above the threshold. + that needs to be called when the free page count reaches or is above the threshold. aFreePageCallback.iThreshold must be set to be in Kb. If the function call completes successfully and the free pages space is above the threshold, the aFreePageCallback.iThreshold will be set to contain the free pages count. - Otherwise aFreePageCallback.iThreshold will be initizized with zero. + Otherwise aFreePageCallback.iThreshold will be initialized with zero. @return A pointer to the created MSqlCompactConn interface. diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.h --- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -45,7 +45,7 @@ static CSqlCompactConn* NewL(const TDesC& aFullName, TSqlFreePageCallback& aFreePageCallback); virtual ~CSqlCompactConn(); virtual void Release(); - virtual TInt Compact(TInt aPageCount, TInt& aProcessedPageCOunt, TInt aLength); + virtual TInt Compact(TInt aPageCount, TInt& aProcessedPageCount, TInt aLength); void Invariant() const; private: diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/Compact/SqlCompactEntry.cpp --- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactEntry.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactEntry.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -32,7 +32,7 @@ @param aSettings Background compaction settings/thresholds @param aTimer The background compaction timer object -When the free pages threshold reach certain the threshold, the background compaction +When the free pages threshold is reached, the background compaction for this entry will be kicked-off. @return A pointer to the created CSqlCompactEntry instance @@ -210,14 +210,7 @@ __SQLASSERT(processedPageCount >= 0, ESqlPanicInternalError); if(err == KErrNone) { - if(processedPageCount > 0) - { - iPageCount -= processedPageCount; - } - else - { - iPageCount = 0; - } + iPageCount -= processedPageCount; __SQLASSERT(iPageCount >= 0, ESqlPanicInternalError); } if(iPageCount <= 0) diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/Compact/SqlCompactTimer.h --- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactTimer.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactTimer.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -30,13 +30,13 @@ /** A CTimer derived class that performs the background compaction. -The CSqlCompactTimer class maintains a queue of CSqlCompactTimer objects waiting to be compacted +The CSqlCompactTimer class maintains a queue of CSqlCompactEntry objects waiting to be compacted (the databases). -The class offers methods for adding/removing CSqlCompactTimer objects to/from the queue and a Restart() +The class offers methods for adding/removing CSqlCompactEntry objects to/from the queue and a Restart() method that can be used to delay the next compaction step, improving this way the SQL server responsiveness to client requests. -The CSqlCompactTimer objects needed compaction will be added at the fromt of the queue. +The CSqlCompactEntry objects needing compaction will be added at the front of the queue. Every time when timer's RunL() method gets executed, the last element from the queue will be picked-up and one compaction step will be performed. When the CSqlCompactEntry object completes the compaction, it will remove itself from the queue. diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlBur.cpp --- a/persistentstorage/sql/SRC/Server/SqlBur.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlBur.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -90,10 +90,7 @@ Cancel(); // release the pub/sub property - iProperty.Close(); - - // make sure the file list is released - iFileList.Reset(); + iBurProperty.Close(); // the file list array iFileList.Close(); @@ -111,7 +108,7 @@ void CSqlBackupClient::ConstructL() { // attach to backup/restore publish/subscribe property - __SQLLEAVE_IF_ERROR(iProperty.Attach(KUidSystemCategory,KUidBackupRestoreKey)); + __SQLLEAVE_IF_ERROR(iBurProperty.Attach(KUidSystemCategory,KUidBackupRestoreKey)); // add us to the scheduler CActiveScheduler::Add(this); @@ -121,12 +118,12 @@ StartL(); } -/** Nuke outstanding requests +/** +Cancel the outstanding B&R request */ void CSqlBackupClient::DoCancel() { - // lose any oustanding reqs - iProperty.Cancel(); + iBurProperty.Cancel(); } /** Not implemented @@ -152,7 +149,7 @@ */ void CSqlBackupClient::NotifyChange() { - iProperty.Subscribe(iStatus); + iBurProperty.Subscribe(iStatus); SetActive(); } @@ -165,7 +162,7 @@ void CSqlBackupClient::TestBurStatusL() { TInt status; - if(iProperty.Get(status)!=KErrNotFound) + if(iBurProperty.Get(status)!=KErrNotFound) { status&=KBURPartTypeMask; switch(status) @@ -811,14 +808,8 @@ // calculate the checksum for(TInt i=0;i> 63); + total += ptr[i]; } }; CleanupStack::PopAndDestroy(block); @@ -835,10 +826,19 @@ //Attention!!! This function won't work properly if aInBuf parameter contains odd number of bytes!!! //(a legacy problem, if it is a problem at all, because the B&R engine probably sends the data in chunks with even size) // +//How the function works. It is called during the restore process and aInBuf parameter contains a block of raw +//data sent by the B&R server. The calling function, RestoreBaseDataSectionL(), uses a state +//machine to processes the incoming data. At particular moment RestoreBaseDataSectionL() will process the data header +//and will have to read "aDataLen" 16-bit characters at position "aInBufReadPos". If there are "aDataLen" characters +//at position "aInBufReadPos" and enough free space in "aOutBuf", CopyBufData() will copy all of them, +//otherwise CopyBufData() will copy as much characters as possible (in which case RestoreBaseDataSectionL() will +//stay in the same state, waiting for more data from the B&R server). +// void CSqlBackupClient::CopyBufData(const TDesC8& aInBuf, TInt& aInBufReadPos, TDes& aOutBuf, TInt aDataLen) { __SQLASSERT(aInBufReadPos >= 0, ESqlPanicBadArgument); - __SQLASSERT(aDataLen > 0, ESqlPanicBadArgument); + __SQLASSERT(aDataLen > 0, ESqlPanicBadArgument); + __SQLASSERT(!(aInBuf.Length() & 0x01), ESqlPanicInternalError); TInt needed = (aDataLen - aOutBuf.Length()) << K8to16bitShift; TInt available = aInBuf.Size() - aInBufReadPos; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlBur.h --- a/persistentstorage/sql/SRC/Server/SqlBur.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlBur.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -142,7 +142,7 @@ }; CActiveBackupClient *iActiveBackupClient; - RProperty iProperty; + RProperty iBurProperty;//B&R property published by the B&R server. SQL server subscribes for notifications. MSqlSrvBurInterface *iInterface; // the SQL server RArray iFileList; // which is populated by the SQL server RFile64 iFile; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvConfig.h --- a/persistentstorage/sql/SRC/Server/SqlSrvConfig.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvConfig.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -94,7 +94,7 @@ TSqlSrvConfig::InitL() should be used once for loading the config parameter values from the SQL server comfiguration file. TSqlSrvConfig::GetConfigParamsL() can be used for retrieving correctly initialized TSqlSrvConfigParams object. -The rules described in the tabble above will be used for producing correct set of config parameter values in +The rules described in the table above will be used for producing correct set of config parameter values in the created TSqlSrvConfigParams object. There are exceptions from the rules and these are: diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvDatabase.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvDatabase.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvDatabase.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -391,6 +391,7 @@ TSqlCompactDbPair compactDbPair; while(compactDbIt.Next(compactDbPair)) { + __SQLASSERT(compactDbPair.iData, ESqlPanicInvalidObj); ::SqlServer().Compactor().ReleaseEntry(*compactDbPair.iData); } iCompactDbMap.Close(); @@ -405,6 +406,37 @@ //The security policy map owns iSecureDbName and iSecurityPolicy and is responsible for //iSecureDbName and iSecurityPolicy destruction. } + //The next step of the "resource release" process is to walk over iAttachDbMap entries, get the data part of + //the found TSqlAttachDbPair objects, which is secure database name used as a key in iSecurityMap, and remove + //the related entry from iSecurityMap. If the database is closed in normal circumstances, the iAttachDbMap + //has no entries. But if the database client forgets to detach the used attached databases or if the Detach() call + //fails (for example, with KErrNoMemory error), then at this point iAttachDbMap has one or more entries. + //That means there are still some attached databases to this connection. This is not a problem, SQLite will take + //care of them. The problem is that there are related entries in iSecurityMap map, owned by CSqlServer object, + //and they won't be removed from the map till CSqlServer object is alive. This causes problems in OOM tests and in + //real life of the device. + //For example, one database client opens "c:[11111111]a.db" and attaches "c:[11111111]b.db": + // - c:[11111111]a.db database has been opened successfully. iSecurityMap has 1 entry: + // {"c:[11111111]a.db", }. + // - c:[11111111]b.db is attached to c:[11111111]a.db with name "db2". There will be 1 entry in iAttachDbMap: + // {"db2", "c:[11111111]a.db"} + // and a new entry will be added to iSecurityMap: + // {"c:[11111111]b.db", }. 2 entries in total in iSecurityMap. + // - The database client attempts to detach the attached database but the opertaion fails during the execution + // of the DETACH sql statement. Both maps are intact. + // - The database client attempts to close the database. The previous implementation of CSqlSrvDatabase::~CSqlSrvDatabase() + // would only remove "c:[11111111]a.db" entry from iSecurityMap and close the iAttachDbMap map. + // The result: no opened or attached databases but there will be one entry in iSecurityMap: "c:[11111111]b.db". + // OOM tests will report a memory leak in this case. On a real device, if "c:[11111111]b.db" gets deleted and + // recreated again, unexpected memory leak will occur in CSqlSrvDatabase::ConstructCreateSecureL() because + // the code there "expects" that is the first time when a "c:[11111111]b.db" entry is added to iSecurityMap. + TSqlAttachDbMapIterator it(iAttachDbMap); + TSqlAttachDbPair attachDbPair; + while(it.Next(attachDbPair)) + { + __SQLASSERT(attachDbPair.iData, ESqlPanicInvalidObj); + ::SqlServer().SecurityMap().Remove(attachDbPair.iData); + } iAttachDbMap.Close(); ::CloseDbHandle(iDbHandle); } @@ -731,7 +763,7 @@ TInt err = FinalizeAttachedDb(aDbName); if(err == KErrNone) { - TRAP(err, RemoveFromMapsL(aDbName));//ignore the error + TRAP_IGNORE(RemoveFromMapsL(aDbName)); } else { @@ -893,10 +925,7 @@ { TAttachCleanup* cleanup = reinterpret_cast (aCleanup); __SQLASSERT(cleanup != NULL, ESqlPanicBadArgument); - if(cleanup) - { - (void)cleanup->iSelf.FinalizeAttachedDb(cleanup->iDbName); - } + (void)cleanup->iSelf.FinalizeAttachedDb(cleanup->iDbName); } /** @@ -1042,6 +1071,7 @@ aMapKey = ::CreateStrCopyLC(aMapKey); CSqlSecurityPolicy* securityPolicy = aAttachedDb ? ::LoadAttachedDbSecurityPolicyLC(aFileData) : ::LoadDbSecurityPolicyLC(iDbHandle); + __SQLASSERT(!::SqlServer().SecurityMap().Entry(aMapKey), ESqlPanicObjExists); __SQLLEAVE_IF_ERROR(::SqlServer().SecurityMap().Insert(aMapKey, securityPolicy)); CleanupStack::Pop(2);//iSecurityMap owns aMapKey and securityPolicy objects aSecurityPolicy = securityPolicy; @@ -1115,6 +1145,7 @@ const TUint8* mapKey = ::CreateStrCopyLC(iFileNameBuf); const TUint8* mapData = SecurityMapKeyL(aDbFileName); mapData = ::CreateStrCopyLC(mapData); + __SQLASSERT(!iAttachDbMap.Entry(mapKey), ESqlPanicObjExists); __SQLLEAVE_IF_ERROR(iAttachDbMap.Insert(mapKey, mapData)); CleanupStack::Pop(2);//iAttachDbMap owns mapKey amd mapData. } @@ -1326,6 +1357,7 @@ HBufC* data = aDbFileName.Alloc(); if(key && data) { + __SQLASSERT(!iCompactDbMap.Entry(key), ESqlPanicObjExists); err = iCompactDbMap.Insert(key, data);//returns the index of the new entry } if(err < 0) //If either "key" or "data" or both is NULL, then "err" is KErrNoMemory and the next "if" will be executed. @@ -1375,10 +1407,7 @@ { CSqlSrvDatabase* self = reinterpret_cast (aCleanup); __SQLASSERT(self != NULL, ESqlPanicBadArgument); - if(self) - { - self->ReleaseCompactEntry(KMainDb16); - } + self->ReleaseCompactEntry(KMainDb16); } /** @@ -1438,6 +1467,7 @@ CleanupStack::PushL(aSecurityPolicy); const TUint8* mapKey = SecurityMapKeyL(aFileData.FileName()); mapKey = ::CreateStrCopyLC(mapKey); + __SQLASSERT(!::SqlServer().SecurityMap().Entry(mapKey), ESqlPanicObjExists); __SQLLEAVE_IF_ERROR(::SqlServer().SecurityMap().Insert(mapKey, aSecurityPolicy)); CleanupStack::Pop(2);//iSecurityMap owns mapKey and aSecurityPolicy. iSecureDbName = mapKey; @@ -1564,6 +1594,7 @@ const TUint8* mapKey = NULL; //Load database security policy, update the security policy map UpdateSecurityMapL(EFalse, aFileData, mapKey, iSecurityPolicy); + iSecureDbName = mapKey;//used in CSqlSrvDatabase destructor. mapKey = NULL;//it is not used //Check that the caller has at least one of {Schema, Read, Write} policies. BasicSecurityPolicyCheckL(*iSecurityPolicy); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvDbSysSettings.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -337,6 +337,7 @@ stored table version or config file version is invalid or the stored compaction mode is invalid. KErrOverflow, aCollationDllName is not large enough to store the name of the collation dll that is stored in the settings table. + KErrNoMemory, an out of memory condition has occurred. Note that the function may also leave with other system-wide error codes or SQL errors of ESqlDbError type @panic SqlDb 2 In _DEBUG mode if iDbHandle is NULL (uninitialized TSqlDbSysSettings object). @@ -356,7 +357,8 @@ //Move to the first record TInt err = ::StmtNext(stmtHandle); __SQLLEAVE_IF_ERROR(err); - //Check that it is a valid row + //Check that it is a valid row. The error is checked on the previous line. + //The "if" bellow will check whether there is a valid record or not. if(err != KSqlAtRow) { __SQLLEAVE(KErrGeneral); @@ -378,21 +380,22 @@ __SQLLEAVE(KErrGeneral); } - //The "CollationDllName" column exists and its value can be read + //The "CollationDllName" column exists and its value can be read. + //The column type might be different than SQLITE_TEXT - malformed database. + if(sqlite3_column_type(stmtHandle, KCollationDllNameColIdx) != SQLITE_TEXT) + { + __SQLLEAVE(KErrGeneral); + } const void* ptr = sqlite3_column_text16(stmtHandle, KCollationDllNameColIdx); - if(ptr) - { - TPtrC16 src(reinterpret_cast (ptr)); - if(src.Length() > aCollationDllName.MaxLength()) - { - __SQLLEAVE(KErrOverflow); - } - aCollationDllName.Copy(src); - } - else - { - __SQLLEAVE(KErrGeneral); - } + //Null column value - this might be an indication of an "out of memory" problem, if the column text + //is in UTF8 format. (sqlite3_column_text16() may allocate memory for UTF8->UTF16 conversion) + __SQLLEAVE_IF_NULL(ptr); + TPtrC16 src(reinterpret_cast (ptr)); + if(src.Length() > aCollationDllName.MaxLength()) + { + __SQLLEAVE(KErrOverflow); + } + aCollationDllName.Copy(src); } if(aSettingsVersion > ESqlSystemVersion3) { @@ -853,8 +856,16 @@ { __SQLASSERT(aStmtHandle != NULL, ESqlPanicBadArgument); aObjType = sqlite3_column_int(aStmtHandle, KObjTypeColIdx); + //The "ObjectName" column type might be different than SQLITE_TEXT - malformed database. + if(sqlite3_column_type(aStmtHandle, KObjNameColIdx) != SQLITE_TEXT) + { + __SQLLEAVE(KErrGeneral); + } + const void* text = sqlite3_column_text16(aStmtHandle, KObjNameColIdx); + //Null column value - this might be an indication of an "out of memory" problem, if the column text + //is in UTF8 format. (sqlite3_column_text16() may allocate memory for UTF8->UTF16 conversion) + __SQLLEAVE_IF_NULL(text); TInt len = (TUint)sqlite3_column_bytes16(aStmtHandle, KObjNameColIdx) / sizeof(TUint16); - const void* text = sqlite3_column_text16(aStmtHandle, KObjNameColIdx); aObjName.Set(reinterpret_cast (text), len); aPolicyType = sqlite3_column_int(aStmtHandle, KObjPolicyTypeColIdx); len = sqlite3_column_bytes(aStmtHandle, KObjPolicyDataColIdx); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -192,16 +192,28 @@ @panic SqlDb 4 In _DEBUG mode. Invalid aFileNameArgNum value. @panic SqlDb 7 In _DEBUG mode. Invalid TSqlSrvFileData object. Not initialized system drive and path. */ -void TSqlSrvFileData::SetL(const RMessage2& aMessage, TInt aFileNameLen, TInt aFileNameArgNum, const TDesC8* aConfigStr) +void TSqlSrvFileData::SetL(const RMessage2& aMessage, TInt aFileNameLen, TInt aFileNameArgNum, +#ifdef SQLSRV_STARTUP_TEST + const TDesC& aDbFileName, +#endif + const TDesC8* aConfigStr) { __SQLASSERT((TUint)aFileNameArgNum < KMaxMessageArguments, ESqlPanicBadArgument); __SQLASSERT(iSysDrivePrivatePath.DriveAndPath().Length() > 0, ESqlPanicInternalError); - + if(aFileNameLen < 1 || aFileNameLen > KMaxFileName) { __SQLLEAVE(KErrBadName); } +#ifdef SQLSRV_STARTUP_TEST + //To prevent compiler warning + aMessage.Int0(); + aFileNameArgNum = aFileNameArgNum; + // + iFileName.Copy(aDbFileName); +#else aMessage.ReadL(aFileNameArgNum, iFileName); +#endif SQLPROFILER_REPORT_IPC(ESqlIpcRead, (aFileNameLen * sizeof(TText))); TParse parsedFileName; __SQLLEAVE_IF_ERROR(parsedFileName.Set(iFileName, 0, 0));//prophylactic check, leave if the file name cannot be parsed diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvFileData.h --- a/persistentstorage/sql/SRC/Server/SqlSrvFileData.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvFileData.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -72,7 +72,11 @@ public: inline void InitL(RFs& aFs, const TDriveName& aSysDriveName, const TDesC& aServerPrivatePath, const TDesC& aConfigFileName, const CDbConfigFiles* aDbConfigFiles); - void SetL(const RMessage2& aMessage, TInt aFileNameLen, TInt aFileNameArgNum, const TDesC8* aConfigStr = NULL); + void SetL(const RMessage2& aMessage, TInt aFileNameLen, TInt aFileNameArgNum, +#ifdef SQLSRV_STARTUP_TEST + const TDesC& aDbFileName, +#endif + const TDesC8* aConfigStr = NULL); void SetFromHandleL(const RMessage2& aMessage, const TDesC& aDbFileName, TBool aCreated, TBool aReadOnly, const TDesC8* aConfigStr = NULL); inline RFs& Fs() const; @@ -129,7 +133,7 @@ const TDesC& aConfigFileName, const CDbConfigFiles* aDbConfigFiles) { iFs = aFs; - iSysDrivePrivatePath.Set(aSysDriveName, &aServerPrivatePath, 0); + __SQLLEAVE_IF_ERROR(iSysDrivePrivatePath.Set(aSysDriveName, &aServerPrivatePath, 0)); iConfig.InitL(aFs, aConfigFileName); iConfig.GetConfigParamsL(KNullDesC8, iConfigParams);//iConfigParams initialized with the config file params //(because an empty configuration string is passed as an argument) diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvMain.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvMain.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvMain.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -30,7 +30,10 @@ #include #endif -static CSqlServer* TheServer = NULL;//The single CSqlServer instance +#ifndef SQLSRV_STARTUP_TEST +static +#endif +CSqlServer* TheServer = NULL;//The single CSqlServer instance _LIT(KMatchAllDbFiles, "*"); _LIT(KDefaultICollationDllName, ""); @@ -296,10 +299,7 @@ //the SQL server startup code. StartL(KSqlSrvName); #endif -#ifdef _SQLPROFILER - TheSqlSrvStartTime.UniversalTime(); SQLPROFILER_SERVER_START(); -#endif //Configure the SQLite library __SQLLEAVE_IF_ERROR(sqlite3_config(SQLITE_CONFIG_LOOKASIDE, KSqliteLookAsideCellSize, KSqliteLookAsideCellCount)); //Open SQLITE library - this must be the first call after StartL() (os_symbian.cpp, "TheAllocator" initialization rellated). @@ -420,7 +420,12 @@ */ TBool CSqlServer::Check(const TSecurityPolicy& aPolicy) const { +#ifdef SQLSRV_STARTUP_TEST + aPolicy.Package();//to prevent compiler warning + return ETrue; +#else return aPolicy.CheckPolicy(CServer2::Message()); +#endif } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -60,12 +60,6 @@ static TBool TheSqlSrvProfilerSqlTraceEnabled = EFalse; /** -When the SQL server boots, TheSqlSrvStartTime will be initialized with the current time then. -@internalComponent -*/ -TTime TheSqlSrvStartTime = 0; - -/** When KSqlSrvProfilerDbName is with non-zero length, then only traces coming from database identified by KSqlSrvProfilerDbName name are printed out. @internalComponent @@ -80,11 +74,6 @@ TInt TheSqlSrvProfilerFileSync = 0; TInt TheSqlSrvProfilerFileSetSize = 0; -static TInt TheSqlSrvProfilerFileRead1 = 0; -static TInt TheSqlSrvProfilerFileWrite1 = 0; -static TInt TheSqlSrvProfilerFileSync1 = 0; -static TInt TheSqlSrvProfilerFileSetSize1 = 0; - //Set it to true if you want traces to be stored into a file. static TBool TheSqlSrvProfilerTraceToFile = EFalse; @@ -627,15 +616,25 @@ return us; } -//Calculates the time since the SQL server boot in microseconds. +//Calculates the time since the first time this function has been called. static TInt64 SqlTimeFromStartUs() { + struct TStartTime + { + inline TStartTime() + { + iTime.UniversalTime(); + } + TTime iTime; + }; + static TStartTime startTime; TTime time; time.UniversalTime(); - TTimeIntervalMicroSeconds us = time.MicroSecondsFrom(TheSqlSrvStartTime); - if(us.Int64() < 0) + TTimeIntervalMicroSeconds us = time.MicroSecondsFrom(startTime.iTime); + const TInt64 KMaxDiff = 999999999999LL;//999999999999 is the max number that can be printed out using %12ld format spec + if(us.Int64() < 0 || us.Int64() >= KMaxDiff) { - TheSqlSrvStartTime = time; + startTime.iTime = time; us = 0; } return us.Int64(); @@ -643,7 +642,7 @@ //Tracing data buffer -const TInt KSqlSrvProfilePrnBufSize = 230; +const TInt KSqlSrvProfilePrnBufSize = 300; static TBuf TheSqlSrvProfileTraceBuf; static TBuf8 TheSqlSrvProfileTraceBuf8; @@ -663,7 +662,7 @@ TTime time; time.UniversalTime(); TDateTime dt = time.DateTime(); - TheSqlSrvProfileTraceBuf8.Format(_L8("%08X¬%012ld¬TME¬%02d:%02d:%02d.%06d¬Prep8=%08d¬Prep16=%08d¬Ex8=%08d¬Ex16=%08d"), + TheSqlSrvProfileTraceBuf8.Format(_L8("% 8X¬%012ld¬TME¬%02d:%02d:%02d:%06d¬Prep8=%08d¬Prep16=%08d¬Ex8=%08d¬Ex16=%08d"), 0, timeDiff, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond(), TheSqlSrvProfilerPreparedCnt8, TheSqlSrvProfilerPreparedCnt16, TheSqlSrvProfilerExecutedCnt8, TheSqlSrvProfilerExecutedCnt16); @@ -716,6 +715,7 @@ { if(TheSqlSrvProfilerTraceEnabled) { + TheSqlSrvProfilerFileRead = TheSqlSrvProfilerFileWrite = TheSqlSrvProfilerFileSync = TheSqlSrvProfilerFileSetSize = 0; if(TheSqlSrvProfilerTraceLevel == 0) { return; @@ -725,10 +725,6 @@ return; } ++aIpcCounter; - TheSqlSrvProfilerFileRead1 = TheSqlSrvProfilerFileRead; - TheSqlSrvProfilerFileWrite1 = TheSqlSrvProfilerFileWrite; - TheSqlSrvProfilerFileSync1 = TheSqlSrvProfilerFileSync; - TheSqlSrvProfilerFileSetSize1 = TheSqlSrvProfilerFileSetSize; aStartTicks = User::FastCounter(); } } @@ -762,7 +758,7 @@ } if(ipcCallIdx >= 0 || (ipcCallIdx == KErrNotFound && TheSqlSrvProfilerTraceLevel == 2)) { - TheSqlSrvProfileTraceBuf.Format(_L("%08X¬%012ld¬IPC¬%08u¬%20.20S¬%012ld¬%010d¬%08d¬%04d¬%04d¬%04d¬%04d¬rc=%d"), + TheSqlSrvProfileTraceBuf.Format(_L("% 8X¬%012ld¬IPC¬%08u¬%20.20S¬%012ld¬%010d¬%08d¬%04d¬%04d¬%04d¬%04d¬rc=%d"), aDbHandle, timeFromStart, aIpcCounter, @@ -770,10 +766,10 @@ ttlExecTime, executionTime, count, - TheSqlSrvProfilerFileRead - TheSqlSrvProfilerFileRead1, - TheSqlSrvProfilerFileWrite - TheSqlSrvProfilerFileWrite1, - TheSqlSrvProfilerFileSync - TheSqlSrvProfilerFileSync1, - TheSqlSrvProfilerFileSetSize - TheSqlSrvProfilerFileSetSize1, + TheSqlSrvProfilerFileRead, + TheSqlSrvProfilerFileWrite, + TheSqlSrvProfilerFileSync, + TheSqlSrvProfilerFileSetSize, aRetCode); SqlSrvProfilePrintf(ESqlSrvProfilerNonSqlTrace); } @@ -792,7 +788,7 @@ TPtrC ipcCallName; (void)SqlIpcTraceIdxAndName(aFuncCode, ipcCallName); TInt64 timeFromStart = SqlTimeFromStartUs(); - TheSqlSrvProfileTraceBuf.Format(_L("%08X¬%012ld¬ERR¬%08u¬%20.20S¬err=%d"), + TheSqlSrvProfileTraceBuf.Format(_L("% 8X¬%012ld¬ERR¬%08u¬%20.20S¬err=%d"), aDbHandle, timeFromStart, aIpcCounter, @@ -827,13 +823,13 @@ _LIT(KEmptyStr, ""); if(pos == 0) { - line.Format(_L("%08X¬%012ld¬SQL¬%12.12S¬"), aDbHandle, timeFromStart, aPrepare ? &KPrepare : &KExec); + line.Format(_L("% 8X¬%012ld¬SQL¬%12.12S¬"), aDbHandle, timeFromStart, aPrepare ? &KPrepare : &KExec); } else { if(!TheSqlSrvProfilerTraceToFile) { - line.Format(_L("%08X¬%012ld¬SQL¬%12.12S¬"), aDbHandle, timeFromStart, &KEmptyStr); + line.Format(_L("% 8X¬%012ld¬SQL¬%12.12S¬"), aDbHandle, timeFromStart, &KEmptyStr); } } TInt l = Min(len, (line.MaxLength() - line.Length())); @@ -872,13 +868,13 @@ _LIT(KEmptyStr, ""); if(pos == 0) { - line.Format(_L("%08X¬%012ld¬SQL¬%12.12S¬"), aDbHandle, timeFromStart, aPrepare ? &KPrepare : &KExec); + line.Format(_L("% 8X¬%012ld¬SQL¬%12.12S¬"), aDbHandle, timeFromStart, aPrepare ? &KPrepare : &KExec); } else { if(!TheSqlSrvProfilerTraceToFile) { - line.Format(_L("%08X¬%012ld¬SQL¬%12.12S¬"), aDbHandle, timeFromStart, &KEmptyStr); + line.Format(_L("% 8X¬%012ld¬SQL¬%12.12S¬"), aDbHandle, timeFromStart, &KEmptyStr); } } TInt l = Min(len, (line.MaxLength() - line.Length())); @@ -908,7 +904,7 @@ return; } TInt64 timeFromStart = SqlTimeFromStartUs(); - TheSqlSrvProfileTraceBuf.Format(_L("%08X¬%012ld¬CRE¬%S"), + TheSqlSrvProfileTraceBuf.Format(_L("% 08X¬%012ld¬CRE¬%S"), aDbHandle, timeFromStart, &aDbName); @@ -930,7 +926,7 @@ return; } TInt64 timeFromStart = SqlTimeFromStartUs(); - TheSqlSrvProfileTraceBuf.Format(_L("%08X¬%012ld¬OPN¬%S"), + TheSqlSrvProfileTraceBuf.Format(_L("% 8X¬%012ld¬OPN¬%S"), aDbHandle, timeFromStart, &aDbName); @@ -948,7 +944,7 @@ return; } TInt64 timeFromStart = SqlTimeFromStartUs(); - TheSqlSrvProfileTraceBuf.Format(_L("%08X¬%012ld¬CSE"), + TheSqlSrvProfileTraceBuf.Format(_L("% 8X¬%012ld¬CSE"), aDbHandle, timeFromStart); SqlSrvProfilePrintf(ESqlSrvProfilerNonSqlTrace); @@ -990,7 +986,7 @@ RDebug::Print(_L("SQL trace file creation failed with err=%d"), err); } } - TheSqlSrvProfileTraceBuf.Format(_L("%08X¬%012ld¬SRV¬START"), 0, timeFromStart); + TheSqlSrvProfileTraceBuf.Format(_L("% 8X¬%012ld¬SRV¬START"), 0, timeFromStart); SqlSrvProfilePrintf(ESqlSrvProfilerNonSqlTrace); } @@ -998,7 +994,7 @@ void SqlPrintServerStop() { TInt64 timeFromStart = SqlTimeFromStartUs(); - TheSqlSrvProfileTraceBuf.Format(_L("%08X¬%012ld¬SRV¬STOP"), 0, timeFromStart); + TheSqlSrvProfileTraceBuf.Format(_L("% 8X¬%012ld¬SRV¬STOP"), 0, timeFromStart); SqlSrvProfilePrintf(ESqlSrvProfilerNonSqlTrace); if(TheSqlSrvProfilerTraceToFile) { diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.h --- a/persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvResourceProfiler.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -64,10 +64,6 @@ ////////////////////////// IPC & SQL tracing related ///////////////////////////////// -//Every time, when the SQL server starts, the time is stored in TheSqlSrvStartTime variable. -//It is used later to calculate and trace the time offset of particular trace. -extern TTime TheSqlSrvStartTime; - //Level 1 IPC calls count. IPC calls types included: // ESqlSrvDbExec8, ESqlSrvDbExec16, ESqlSrvDbScalarFullSelect16, ESqlSrvStmtExec, // ESqlSrvStmtAsyncExec, ESqlSrvStmtBindExec, ESqlSrvStmtAsyncBindExec, ESqlSrvStmtNext, diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvSecurityMap.h --- a/persistentstorage/sql/SRC/Server/SqlSrvSecurityMap.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvSecurityMap.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -183,6 +183,7 @@ typedef class TLinearOrder TSqlCompactDbLinearOrder; typedef class RSqlMap RSqlCompactDbMap; typedef class TSqlMapIterator TSqlCompactDbMapIterator; +typedef TSqlMapIterator TSqlAttachDbMapIterator; ///////////////////////////////////////////////////////////////////////////////////////////////////////// diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvSession.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvSession.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvSession.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for defect 1915 "SQL server panics when using long column type strings" // // Description: // @@ -27,6 +28,8 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma BullseyeCoverage off + #ifdef _DEBUG const TInt KDelayedDbHeapFailureMask = 0x1000; @@ -80,9 +83,16 @@ //Executes the heap simulation failure. inline void CSqlSrvSession::DbSetAllocFail(TInt aHeapFailureMode, TInt aFailedAllocNumber) { - User::__DbgSetAllocFail(RHeap::EUser, - static_cast (aHeapFailureMode & (KDelayedDbHeapFailureMask - 1)), - aFailedAllocNumber); + TInt mode = aHeapFailureMode & (KDelayedDbHeapFailureMask - 1); + if(mode >= RAllocator::EBurstRandom && mode <= RAllocator::EBurstFailNext) + { + const TUint KBurst = 50; + User::__DbgSetBurstAllocFail(RHeap::EUser, static_cast (mode), aFailedAllocNumber, KBurst); + } + else + { + User::__DbgSetAllocFail(RHeap::EUser, static_cast (mode), aFailedAllocNumber); + } } //Executes the delayed heap simulation failure, if the connection is in test mode @@ -90,9 +100,16 @@ { if(iDbResourceTestMode & KDelayedDbHeapFailureMask) { - User::__DbgSetAllocFail(RHeap::EUser, - static_cast (iDbResourceTestMode & (KDelayedDbHeapFailureMask - 1)), - iFailedAllocNumber); + TInt mode = iDbResourceTestMode & (KDelayedDbHeapFailureMask - 1); + if(mode >= RAllocator::EBurstRandom && mode <= RAllocator::EBurstFailNext) + { + const TUint KBurst = 50; + User::__DbgSetBurstAllocFail(RHeap::EUser, static_cast (mode), iFailedAllocNumber, KBurst); + } + else + { + User::__DbgSetAllocFail(RHeap::EUser, static_cast (mode), iFailedAllocNumber); + } } } @@ -125,6 +142,8 @@ #endif//_DEBUG +#pragma BullseyeCoverage on + /////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -399,7 +418,7 @@ StmtColumnValueL(aMessage, handle); break; case ESqlSrvStmtDeclColumnTypes: - StmtDeclColumnTypesL(aMessage, handle); + retCode = StmtDeclColumnTypesL(aMessage, handle); break; ////////////////////// stream operations ////////////////////////////////// case ESqlSrvStreamRead: @@ -511,18 +530,20 @@ Arg 2: [in] PPPPCCCC, where PPPP is the security policy length, CCCC is the config string length. Arg 3: [in] security policies buffer | config string -@leave KErrArgument If config string length or security policy length is invalid (negative length or too big length) @panic SqlDb 1 Client panic. iDatabase is not NULL (it has been created already) +@panic SqlDb 4 Client panic. Negative or too big config string length +@panic SqlDb 4 Client panic. Negative security policy length, or zero length if the request is to create a secure database */ void CSqlSrvSession::DbCreateObjectL(const RMessage2& aMessage, TSqlSrvFunction aFunction) { __SQLPANIC_CLIENT(!iDatabase, aMessage, ESqlPanicObjExists); const TInt KSecurityPolicyLen = (aMessage.Int2() & 0x7fff0000) >> 16; + //If the security policy length is negative then this is a programming error. + __SQLPANIC_CLIENT(KSecurityPolicyLen >= 0, aMessage, ESqlPanicBadArgument); const TInt KConfigStringLen = aMessage.Int2() & 0xffff; - if(KSecurityPolicyLen < 0 || (TUint)KConfigStringLen > KSqlSrvMaxConfigStrLen) - { - __SQLLEAVE(KErrArgument); - } + //If KConfigStringLen is invalid then this is a programming error. + //If the client sends a too big config string - this is handled in the client side session. + __SQLPANIC_CLIENT((TUint)KConfigStringLen <= KSqlSrvMaxConfigStrLen, aMessage, ESqlPanicBadArgument); RBuf8 securityAndConfigBuf; CleanupClosePushL(securityAndConfigBuf); if((KSecurityPolicyLen + KConfigStringLen) > 0) @@ -550,7 +571,8 @@ break; case ESqlSrvDbCreateSecure: { - if(!fileData.IsSecureFileNameFmt() || KSecurityPolicyLen == 0) + __SQLPANIC_CLIENT(KSecurityPolicyLen > 0, aMessage, ESqlPanicBadArgument); + if(!fileData.IsSecureFileNameFmt()) { __SQLLEAVE(KErrArgument); } @@ -1483,22 +1505,26 @@ } /** +Processes the request for retrieving the statement declared column type names. + +If the client side buffer size is not big enough, the function returns the size + KSqlClientBufOverflowCode. +In this case the client must increase the buffer and try again to get the buffer only + Usage of the IPC call arguments: Arg 0: [in] input buffer max length in 16-bit characters -Arg 1: [in/out] buffer +Arg 1: [out] ipc buffer, declared column type names */ -void CSqlSrvSession::StmtDeclColumnTypesL(const RMessage2& aMessage, TInt aStmtHandle) - { +TInt CSqlSrvSession::StmtDeclColumnTypesL(const RMessage2& aMessage, TInt aStmtHandle) + { CSqlSrvStatement& stmt = ::SqlSessObjFind(iStatements, aStmtHandle, aMessage); - HBufC* colTypesBuf = stmt.GetDeclColumnTypesL(); - CleanupStack::PushL(colTypesBuf); - if(colTypesBuf->Des().Length() > aMessage.Int0()) + const RSqlBufFlat& declColumnTypesBuf = stmt.GetDeclColumnTypesL(); + TInt size = declColumnTypesBuf.Size(); + if(size <= aMessage.Int0()) { - __SQLLEAVE(KErrOverflow); + aMessage.WriteL(1, declColumnTypesBuf.BufDes()); + return 0; } - aMessage.WriteL(1, colTypesBuf->Des()); - SQLPROFILER_REPORT_IPC(ESqlIpcWrite, (colTypesBuf->Des().Length() * sizeof(TText))); - CleanupStack::PopAndDestroy(colTypesBuf); + return size + KSqlClientBufOverflowCode; } @@ -1524,14 +1550,13 @@ aStreamBuf->PushL(); iIpcStreams.AllocL(); TInt size = aStreamBuf->SizeL(); + __SQLASSERT(size >= 0, ESqlPanicInternalError); TPckgBuf ipcBuf; - if(size > 0) // read the first buffer-full - { - TInt len = Min(size, KIpcBufSize); - aStreamBuf->ReadL(ipcBuf().iData, len); - } + // read the first buffer-full + TInt len = Min(size, KIpcBufSize); + aStreamBuf->ReadL(ipcBuf().iData, len); TInt handle = 0; - if(size < 0 || size > KIpcBufSize) + if(size > KIpcBufSize) { // create the stream object HIpcStream* ipcStream = new (ELeave) HIpcStream(aStreamBuf, KIpcBufSize); handle = iIpcStreams.Add(ipcStream); @@ -1542,12 +1567,9 @@ { CleanupStack::PopAndDestroy(aStreamBuf); } - if(size >= 0) - { - ipcBuf().iExt = size; - aMessage.WriteL(2, ipcBuf); - SQLPROFILER_REPORT_IPC(ESqlIpcWrite, size); - } + ipcBuf().iExt = size; + aMessage.WriteL(2, ipcBuf); + SQLPROFILER_REPORT_IPC(ESqlIpcWrite, size); return handle; } @@ -1668,11 +1690,11 @@ TSqlSrvHandleType handleType = static_cast (msgCode & KSqlSrvHandleTypeMask); aHandle = (msgCode & KSqlSrvHandleMask) >> KSqlSrvHandleShiftBits; __SQLPANIC_CLIENT(aHandle > 0, aMessage, ESqlPanicBadArgument); - if(aFunction >= ESqlSrvStmtClose && aFunction < ESqlSrvStreamBase) + if(aFunction < ESqlSrvStreamBase) { __SQLPANIC_CLIENT(handleType == ESqlSrvStatementHandle, aMessage, ESqlPanicBadArgument); } - else if(aFunction > ESqlSrvStreamBase) + else { __SQLPANIC_CLIENT(handleType == ESqlSrvStreamHandle, aMessage, ESqlPanicBadArgument); } @@ -1727,7 +1749,7 @@ TPtrC8 val; if(aColType == ESqlText) { - TPtrC textVal = aStmt.ColumnText(0); + TPtrC textVal = aStmt.ColumnTextL(0); val.Set(reinterpret_cast (textVal.Ptr()), textVal.Length() * sizeof(TUint16)); } else diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvSession.h --- a/persistentstorage/sql/SRC/Server/SqlSrvSession.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvSession.h Mon May 03 14:09:14 2010 +0300 @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for Bug 1915 "SQL server panics when using long column type strings" // // Description: // @@ -107,7 +108,7 @@ void StmtGetBufFlatL(const RMessage2& aMessage, TInt aStmtHandle); void StmtColumnValueL(const RMessage2& aMessage, TInt aStmtHandle); void DoStmtBindL(const RMessage2& aMessage, CSqlSrvStatement& aStmt); - void StmtDeclColumnTypesL(const RMessage2& aMessage, TInt aStmtHandle); + TInt StmtDeclColumnTypesL(const RMessage2& aMessage, TInt aStmtHandle); //Helper methods TInt NewOutputStreamL(const RMessage2& aMessage, MStreamBuf* aStreamBuf); TDes8& ReadString8ZL(const RMessage2& aMessage, TInt aArgNum, TInt aByteLen); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvStatement.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvStatement.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvStatement.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for defect 1915 "SQL server panics when using long column type strings" // // Description: // @@ -28,7 +29,7 @@ //This is the name prefix which will be given to the nameless parameters. //For example, if the SQL string is: // SELECT * FROM A WHERE ColA1 = ? AND ColA2 = ? -//then the names which will be give to the parameters will be: +//then the names which will be given to the parameters will be: //"?0" and "?1" _LIT(KNamelessParameter, "?"); @@ -90,7 +91,7 @@ bound statement is about to be finalized. That means, when the "stream close" operation on the client side makes an attempt to synch the HSqlSrvStmtParamBuf object, no attempt should be made to bound the parameter data, because the statement object is gone. -After this call the bound statement objects seases to exist. +After this call the bound statement objects ceases to exist. Actions, performed by this method: - if the buffer type is "simple bind", the buffer will be destroyed. No reason to keep it alive, there is no bound IPC @@ -200,7 +201,7 @@ /** Sets SQL statement parameter values. -Only parameters, which values are set by the client, will be processed. +Only parameters, whose values are set by the client, will be processed. @param aParamBuf Flat buffer with parameter values. @@ -277,7 +278,7 @@ /** Collects column names in a flat buffer and returns a reference to the buffer. -@return A const reference to a flat buffer containing the column values. +@return A const reference to a flat buffer containing the column names. @leave KErrNoMemory, an out of memory condition has occurred. @@ -306,7 +307,7 @@ /** Collects parameter names in a flat buffer and returns a reference to the buffer. -@return A const reference to a flat buffer containing the column values. +@return A const reference to a flat buffer containing the parameter names. @leave KErrNoMemory, an out of memory condition has occurred. @@ -382,13 +383,22 @@ case SQLITE_TEXT: { TInt charLength = (TUint)sqlite3_column_bytes16(iStmtHandle, colIdx) / sizeof(TUint16); + //"charLength == 0" - this might be an indication of an "out of memory" problem, if the column text is in UTF8 format. + //(sqlite3_column_bytes16() may allocate memory for UTF8->UTF16 conversion) + if(charLength == 0 && sqlite3_errcode(sqlite3_db_handle(iStmtHandle)) == SQLITE_NOMEM) + { + __SQLLEAVE(KErrNoMemory); + } if(charLength >= KSqlMaxDesLen) { it.SetAsNotPresent(ESqlText, charLength); } else - { - __SQLLEAVE_IF_ERROR(it.SetText(TPtrC16(reinterpret_cast (sqlite3_column_text16(iStmtHandle, colIdx)), charLength))); + {//sqlite3_column_bytes16() already allocated the needed memory if a UTF8->UTF16 conversion + //had to be performed. The sqlite3_column_text16() on the next line is guaranteed to succeed. + const TUint16* text = reinterpret_cast (sqlite3_column_text16(iStmtHandle, colIdx)); + __SQLASSERT(text != NULL, ESqlPanicInternalError); + __SQLLEAVE_IF_ERROR(it.SetText(TPtrC16(text, charLength))); } } break; @@ -434,8 +444,11 @@ __SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj); TInt colType = sqlite3_column_type(iStmtHandle, aColumnIndex); if(colType == SQLITE_TEXT) - { + {//Since the first called function after the Next() operation is always CSqlSrvStatement::ColumnValuesL(), then + //sqlite3_column_bytes16() (called from ColumnValuesL()) already allocated the needed memory if a UTF8->UTF16 + //conversion had to be performed. The sqlite3_column_text16() on the next line is guaranteed to succeed. const void* text = sqlite3_column_text16(iStmtHandle, aColumnIndex); + __SQLASSERT(text != NULL, ESqlPanicInternalError); TInt length = sqlite3_column_bytes16(iStmtHandle, aColumnIndex); aColumnSource.Set(reinterpret_cast (text), length); } @@ -645,10 +658,12 @@ @see RSqlStatement +@leave KErrNoMemory, an out of memory condition has occurred. + @panic SqlDb 2 In _DEBUG mode. Invalid (not created) CSqlSrvStatement object. @panic SqlDb 4 In _DEBUG mode. Invalid aColIdx value. */ -TPtrC CSqlSrvStatement::ColumnText(TInt aColIdx) const +TPtrC CSqlSrvStatement::ColumnTextL(TInt aColIdx) const { __SQLASSERT(iStmtHandle != NULL, ESqlPanicInvalidObj); __SQLASSERT((TUint)aColIdx < iColumnCount, ESqlPanicBadArgument); @@ -657,7 +672,17 @@ if(colType == SQLITE_TEXT) { TInt charLength = (TUint)sqlite3_column_bytes16(iStmtHandle, aColIdx) / sizeof(TUint16); - res.Set(reinterpret_cast (sqlite3_column_text16(iStmtHandle, aColIdx)), charLength); + //"charLength == 0" - this might be an indication of an "out of memory" problem, if the column text is in UTF8 format. + //(sqlite3_column_bytes16() may allocate memory for UTF8->UTF16 conversion) + if(charLength == 0 && sqlite3_errcode(sqlite3_db_handle(iStmtHandle)) == SQLITE_NOMEM) + { + __SQLLEAVE(KErrNoMemory); + } + //sqlite3_column_bytes16() already allocated the needed memory if a UTF8->UTF16 conversion + //had to be performed. The sqlite3_column_text16() on the next line is guaranteed to succeed. + const TUint16* text = reinterpret_cast (sqlite3_column_text16(iStmtHandle, aColIdx)); + __SQLASSERT(text != NULL, ESqlPanicInternalError); + res.Set(text, charLength); } return res; } @@ -688,37 +713,52 @@ } /** -This function is used by the DBMS emulation library only. -The function retrieves the declared column types from the SQLITE library, compiles them in a single string -and then returns the string to the caller. +Retrieves the declared column types using the SQLITE library storing in a +flat buffer and returns a reference to the buffer. + +@return A const reference to a flat buffer containing the declared column type names. -The function also initializes iColumnText8 array, where particular array element with index "idx" will -be set to 1, if the column with index "idx" is a 8-bit text column. +@leave KErrNoMemory, an out of memory condition has occurred; -@return A pointer to a heap allocated HBufC object with the delcared column types. The caller is responsible - for the HBufC object destruction. +@panic SqlDb 2 In _DEBUG mode. Invalid (not created) CSqlSrvStatement object. */ -HBufC* CSqlSrvStatement::GetDeclColumnTypesL() +const RSqlBufFlat& CSqlSrvStatement::GetDeclColumnTypesL() { - HBufC* buf = HBufC::NewL(iColumnCount * 20);//20 as length is enough for a single column type text - TPtr ptr = buf->Des(); - for(TInt i=0;i (-1); + __SQLLEAVE_IF_ERROR(iBufFlat.SetCount(iColumnCount)); + TSqlBufWIterator it; + it.Set(iBufFlat); + TInt colIdx = -1; + while(it.Next()) { - const TUint16* declTypeTxt = reinterpret_cast (sqlite3_column_decltype16(iStmtHandle, i)); - if(declTypeTxt) - { - TPtrC type(declTypeTxt, User::StringLength(declTypeTxt)); - ptr.Append(type); - } - ptr.Append(TChar(';')); + ++colIdx;//the first SQLITE column index is 0 + const TUint16* declTypeTxt = reinterpret_cast (sqlite3_column_decltype16(iStmtHandle, colIdx)); + TPtrC ptr(KNullDesC); + if(declTypeTxt) + { + ptr.Set(declTypeTxt, User::StringLength(declTypeTxt)); + } + else + { + //If sqlite3_column_decltype16() returns NULL but sqlite3_column_decltype() doesn't, then it is an "out of memory" condition + if(sqlite3_column_decltype(iStmtHandle, colIdx)) + { + __SQLLEAVE(KErrNoMemory); + } + } + __SQLLEAVE_IF_ERROR(it.SetText(ptr)); } - return buf; + iBufFlatType = ESqlDeclColumnTypesBuf; + return iBufFlat; } + /** -Creates a new HSqlSrvStmtParamBuf object. +Creates a new HSqlSrvStmtParamBuf object for the parameter with index "aParamIndex" or +reuses the existing one. -@param aParameterIndex Parameter index, zero based. +@param aParamIndex Parameter index, zero based. @param aDataType Parameter value type - binary, text8 or text16. @param aIsStreamBuf True if the param data will be retrieved from an IPC stream @@ -746,7 +786,7 @@ /** This function will extend the iParamBufArray array (filling the new array items with NULL), if it is needed - -to ensure that there is enough place for the buffer for the parameter identified by aParamIndex. +to ensure that there is enough place in the buffer for the parameter identified by aParamIndex. @param aParamIndex The parameter index diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvStatement.h --- a/persistentstorage/sql/SRC/Server/SqlSrvStatement.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvStatement.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for defect 1915 "SQL server panics when using long column type strings" // // Description: // @@ -223,10 +224,10 @@ TInt ColumnInt(TInt aColIdx) const; TInt64 ColumnInt64(TInt aColIdx) const; TReal ColumnReal(TInt aColIdx) const; - TPtrC ColumnText(TInt aColIdx) const; + TPtrC ColumnTextL(TInt aColIdx) const; TPtrC8 ColumnBinary(TInt aColIdx) const; - HBufC* GetDeclColumnTypesL(); + const RSqlBufFlat& GetDeclColumnTypesL(); HSqlSrvStmtParamBuf* GetParamBufL(TInt aParamIndex, HSqlSrvStmtParamBuf::TDataType aDataType, HSqlSrvStmtParamBuf::TBufType aBufType); void BindParamBufL(TInt aParamIndex); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvStatement.inl --- a/persistentstorage/sql/SRC/Server/SqlSrvStatement.inl Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvStatement.inl Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -20,7 +20,7 @@ Creates a new HSqlSrvStmtParamBuf instance. @param aStatement A reference to the CSqlSrvStatement object, which needs the parameter data. - @param aParameterIndex Parameter index, zero based. + @param aParamIndex Parameter index, zero based. @param aDataType Parameter value type - binary, text8 or text16. @param aBufType IPC stream buffer or a simple "bind param" buffer diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp --- a/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -205,9 +205,9 @@ __SQLASSERT(aDbHandle != NULL, ESqlPanicInvalidObj); sqlite3_stmt* stmtHandle = NULL; const void* stmtTail = NULL; - //sqlite3_prepare16_v2() expects parameter #3 to be one of the following: - // - byte length of the sql statement, excluding terminating zero; - // - negative value - zero-terminated sql statement; + //sqlite3_prepare16_v2() expects parameter #3 to be one of the following: + // - byte length of the sql statement (parameter #2), excluding terminating zero; + // - negative value - the sql statement (parameter #2) is zero-terminated; TInt err = sqlite3_prepare16_v2(aDbHandle, aSql.Ptr(), aSql.Length() * sizeof(TUint16) - sizeof(TUint16), &stmtHandle, &stmtTail); __SQLASSERT(err == SQLITE_OK ? !stmtTail || User::StringLength((const TUint16*)stmtTail) == 0 : !stmtHandle, ESqlPanicInternalError); if(stmtHandle) //stmtHandle can be NULL for statements like this: ";". @@ -383,9 +383,9 @@ static TInt DoPrepareStmt16(sqlite3* aDbHandle, const TDesC& aStmt, sqlite3_stmt** aStmtHandle, TBool& aHasTail) { const void* stmtTail = NULL; - //sqlite3_prepare16_v2() expects parameter #3 to be one of the following: - // - byte length of the sql statement, excluding terminating zero; - // - negative value - zero-terminated sql statement; + //sqlite3_prepare16_v2() expects parameter #3 to be one of the following: + // - byte length of the sql statement (parameter #2), excluding terminating zero; + // - negative value - the sql statement (parameter #2) is zero-terminated; TInt err = sqlite3_prepare16_v2(aDbHandle, aStmt.Ptr(), aStmt.Length() * sizeof(TUint16) - sizeof(TUint16), aStmtHandle, &stmtTail); aHasTail = stmtTail && static_cast (stmtTail)[0] != 0; PRINT_ERRMSG16(err != SQLITE_OK, aDbHandle, "DoPrepareStmt16()", aStmt); @@ -402,9 +402,9 @@ static TInt DoPrepareStmt8(sqlite3* aDbHandle, const TUint8* aStmt, sqlite3_stmt** aStmtHandle, TBool& aHasTail) { const char* stmtTail = NULL; - //sqlite3_prepare_v2() expects parameter #3 to be one of the following: - // - byte length of the sql statement; - // - negative value - zero-terminated sql statement; + //sqlite3_prepare_v2() expects parameter #3 to be one of the following: + // - byte length of the sql statement (parameter #2), excluding terminating zero; + // - negative value - the sql statement (parameter #2) is zero-terminated; TInt err = sqlite3_prepare_v2(aDbHandle, reinterpret_cast (aStmt), -1, aStmtHandle, &stmtTail); aHasTail = stmtTail && stmtTail[0] != 0; PRINT_ERRMSG8(err != SQLITE_OK, aDbHandle, "DoPrepareStmt8()", TPtrC8(aStmt, aStmt ? User::StringLength(aStmt) : 0)); @@ -414,7 +414,8 @@ return err; } -//This function accepts as arguments the SQLITE error, the length of non-parsed part of the SQL statement +//This function accepts as arguments the SQLITE error code, +//"aHasTail" boolean flag set to true if the SQL string contains more than one SQL statement //and the statement handle. // //It checks the arguments and returns an error if: @@ -436,7 +437,8 @@ return KErrNone; } -//This function accepts as arguments the SQLITE error, the length of non-parsed part of the SQL statement +//This function accepts as arguments the SQLITE error code, +//"aHasTail" boolean flag set to true if the SQL string contains more than one SQL statement //and the statement handle. // //It checks the arguments and leaves if: @@ -956,9 +958,9 @@ sqlite3_stmt* stmtHandle = NULL; const char* stmtTail = NULL; aProcessedPageCount = 0; - //sqlite3_prepare16() expects parameter #3 to be one of the following: - // - byte length of the sql statement, excluding terminating zero; - // - negative value - zero-terminated sql statement; + //sqlite3_prepare_v2() expects parameter #3 to be one of the following: + // - byte length of the sql statement (parameter #2), excluding terminating zero; + // - negative value - the sql statement (parameter #2) is zero-terminated; TInt err = sqlite3_prepare_v2(aDbHandle, (const char*)sql.Ptr(), sql.Length() - sizeof(TUint8), &stmtHandle, &stmtTail); __SQLASSERT(err == SQLITE_OK ? !stmtTail || User::StringLength((const TUint8*)stmtTail) == 0 : !stmtHandle, ESqlPanicInternalError); if(stmtHandle) //stmtHandle can be NULL for statements like this: ";". diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqlapi.cpp --- a/persistentstorage/sql/TEST/t_sqlapi.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqlapi.cpp Mon May 03 14:09:14 2010 +0300 @@ -280,31 +280,41 @@ TEST2(fs.Connect(), KErrNone); TFileName privatePath; TEST2(fs.PrivatePath(privatePath), KErrNone); - fs.Close(); //Private shared database file on an existing drive (C:). //Very long database file name. - const TInt KMaxFileName2 = KMaxFileName - 40;//"-40" because the SQLITE engine creates a journal file if begins - //a transaction. The name of the journal file is - //"-journal.". It is obvious that if the - //database file name is too long but still valid and its creation - //succeeds, the journal file creation may fail because the journal - //file name becomes too long - TBuf dbPath; + TBuf<50>filesysname; + fs.FileSystemName(filesysname,(TInt) EDriveC); + fs.Close(); + + RDebug::Print(_L("file system name = %S"), &filesysname); + TInt maxFileName = KMaxFileName -40;//"-40" because the SQLITE engine creates a journal file if begins + //a transaction. The name of the journal file is + //"-journal.". It is obvious that if the + //database file name is too long but still valid and its creation + //succeeds, the journal file creation may fail because the journal + //file name becomes too long + + if(filesysname.CompareF(_L("HVFS")) == 0) + { + maxFileName = KMaxFileName -150;//The test will panic in PlatSim when the file name is too long. This line should be removed when platsim team fixes the file system defect. + } + HBufC* dbPath = HBufC::NewLC(maxFileName); _LIT(KExt, ".DB"); - dbPath.Copy(_L("C:")); - dbPath.Append(KSecureUid.Name()); - TInt len = KMaxFileName2 + 1 - (dbPath.Length() + KExt().Length() + privatePath.Length()); + dbPath->Des().Copy(_L("C:")); + dbPath->Des().Append(KSecureUid.Name()); + TInt len = maxFileName + 1 - (dbPath->Length() + KExt().Length() + privatePath.Length()); + while(--len) { - dbPath.Append(TChar('A')); + dbPath->Des().Append(TChar('A')); } - dbPath.Append(KExt); - TEST(dbPath.Length() == (KMaxFileName2 - privatePath.Length())); - rc = db.Create(dbPath, securityPolicy); + dbPath->Des().Append(KExt); + TEST(dbPath->Length() == (maxFileName - privatePath.Length())); + rc = db.Create(dbPath->Des(), securityPolicy); + TEST2(rc, KErrNone); db.Close(); - rc2 = RSqlDatabase::Delete(dbPath); - TEST2(rc, KErrNone); + rc2 = RSqlDatabase::Delete(dbPath->Des()); TEST2(rc2, KErrNone); // Private database with config @@ -320,17 +330,19 @@ //Public shared database file on an existing drive (C:). //Very long database file name. - dbPath.Copy(_L("C:\\TEST\\D")); - len = KMaxFileName2 + 1 - (dbPath.Length() + KExt().Length()); + dbPath->Des().Copy(_L("C:\\TEST\\D")); + len = maxFileName + 1 - (dbPath->Length() + KExt().Length()); while(--len) { - dbPath.Append(TChar('A')); + dbPath->Des().Append(TChar('A')); } - dbPath.Append(KExt); - TEST(dbPath.Length() == KMaxFileName2); - rc = db.Create(dbPath); + dbPath->Des().Append(KExt); + TEST(dbPath->Length() == maxFileName); + rc = db.Create(dbPath->Des()); db.Close(); - rc2 = RSqlDatabase::Delete(dbPath); + rc2 = RSqlDatabase::Delete(dbPath->Des()); + + CleanupStack::PopAndDestroy(dbPath); TEST2(rc, KErrNone); TEST2(rc2, KErrNone); @@ -1341,7 +1353,7 @@ TBuf8<1> buf2; rc = stmt.ColumnBinary(1, buf2); TEST2(rc, KErrOverflow); - + stmt.Close(); //Deallocate buf @@ -1355,6 +1367,195 @@ } /** +@SYMTestCaseID PDS-SQL-CT-4191 +@SYMTestCaseDesc The test creates a test database and inserts one record using a stream. + MStreamBuf::SeekL() is used to modify the parameter data at specific positions. + Then the test executes a SELECT statement to read the just written record. + MStreamBuf::SeekL() is used to read the column content at specific positions + (the same positions used during the record write operation). The read byte values must + match the written byte values. +@SYMTestPriority High +@SYMTestActions RSqlColumnReadStream::ColumnBinary() and RSqlParamWriteStream::BindBinary() - MStreamBuf::SeekL() test. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145125 +*/ +void StreamSeekTestL() + { + RSqlDatabase db; + CleanupClosePushL(db); + TInt rc = db.Create(KTestDbName1); + TEST2(rc, KErrNone); + rc = db.Exec(_L("CREATE TABLE A(Fld1 INTEGER, Fld2 BLOB)")); + TEST(rc >= 0); + //Write a record to the database using a stream. MStreamBuf::SeekL() is used to modify the content at a specific position. + RSqlStatement stmt; + CleanupClosePushL(stmt); + rc = stmt.Prepare(db, _L("INSERT INTO A(Fld1, Fld2) VALUES(1, ?)")); + TEST2(rc, KErrNone); + + RSqlParamWriteStream strm1; + CleanupClosePushL(strm1); + rc = strm1.BindBinary(stmt, 0); + TEST2(rc, KErrNone); + + for(TInt i=0;i<256;++i) + { + strm1 << (TUint8)i; + } + + const TInt KStreamOffset = 10; + const TUint8 KByte = 'z'; + _LIT8(KData, "QWERTYUIOPASDFG"); + + MStreamBuf* strm1buf = strm1.Sink(); + TEST(strm1buf != NULL); + + strm1buf->SeekL(MStreamBuf::EWrite, EStreamBeginning, 0); + strm1buf->WriteL(&KByte, 1); + + strm1buf->SeekL(MStreamBuf::EWrite, EStreamMark, KStreamOffset); + strm1buf->WriteL(&KByte, 1); + + strm1buf->SeekL(MStreamBuf::EWrite, EStreamEnd, 0); + strm1buf->WriteL(KData().Ptr(), KData().Length()); + + strm1buf->SeekL(MStreamBuf::EWrite, EStreamEnd, -4 * KStreamOffset); + strm1buf->WriteL(&KByte, 1); + + strm1.CommitL(); + CleanupStack::PopAndDestroy(&strm1); + + rc = stmt.Exec(); + TEST2(rc, 1); + CleanupStack::PopAndDestroy(&stmt); + + //Read the record using a stream. MStreamBuf::SeekL() is used to read the content at a specific position. + CleanupClosePushL(stmt); + rc = stmt.Prepare(db, _L("SELECT Fld2 FROM A WHERE Fld1 = 1")); + TEST2(rc, KErrNone); + rc = stmt.Next(); + TEST2(rc, KSqlAtRow); + + RSqlColumnReadStream strm2; + CleanupClosePushL(strm2); + rc = strm2.ColumnBinary(stmt, 0); + TEST2(rc, KErrNone); + + TUint8 byte = 0; + MStreamBuf* strm2buf = strm2.Source(); + TEST(strm1buf != NULL); + + strm2buf->SeekL(MStreamBuf::ERead, EStreamBeginning, 0); + rc = strm2buf->ReadL(&byte, 1); + TEST2(rc, 1); + TEST2(byte, KByte); + + strm2buf->SeekL(MStreamBuf::ERead, EStreamMark, KStreamOffset); + rc = strm2buf->ReadL(&byte, 1); + TEST2(rc, 1); + TEST2(byte, KByte); + + strm2buf->SeekL(MStreamBuf::ERead, EStreamEnd, -KData().Length()); + TUint8 buf[20]; + rc = strm2buf->ReadL(buf, KData().Length()); + TEST2(rc, KData().Length()); + TPtrC8 bufptr(buf, rc); + TEST(bufptr == KData); + + strm2buf->SeekL(MStreamBuf::ERead, EStreamEnd, -4 * KStreamOffset); + rc = strm2buf->ReadL(&byte, 1); + TEST2(rc, 1); + TEST2(byte, KByte); + + CleanupStack::PopAndDestroy(&strm2); + CleanupStack::PopAndDestroy(&stmt); + + CleanupStack::PopAndDestroy(&db); + rc = RSqlDatabase::Delete(KTestDbName1); + TEST2(rc, KErrNone); + } + +/** +@SYMTestCaseID PDS-SQL-CT-4174 +@SYMTestCaseDesc Test for DEF144937: SQL, SQL server, the code coverage can be improved in some areas. +@SYMTestPriority High +@SYMTestActions The test creates a test database with a table with 3 records. + The first record has a BLOB column with 0 length. + The second record has a BLOB column with length less than KSqlMaxDesLen + (in debug mode) in which case no IPC call is needed to be made in order + to access the column value via stream. + The third record has a BLOB column with length exactly KSqlMaxDesLen + in which case an IPC call will be made in order to retrieve the column value, + but the column value will be copied directly to the client - no stream object is created. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144937 +*/ +void ColumnBinaryStreamTest2() + { + RSqlDatabase db; + TInt rc = db.Create(KTestDbName1); + TEST2(rc, KErrNone); + + enum {KSqlBufSize = 128}; + + //Create a table + _LIT8(KSqlStmt1, "CREATE TABLE A(Fld1 INTEGER, Fld2 BLOB);"); + ExecSqlStmtOnDb >(db, KSqlStmt1(), KErrNone); + + //Insert one record where the BLOB length is 0. + //Insert second record where the BLOB length is smaller than the max inline column length - KSqlMaxDesLen. + //Insert third record where the BLOB length is exactly the max inline column length - KSqlMaxDesLen. + _LIT8(KSqlStmt2, "INSERT INTO A VALUES(1, '');INSERT INTO A VALUES(2, x'0102030405');INSERT INTO A VALUES(3, x'0102030405060708');"); + ExecSqlStmtOnDb >(db, KSqlStmt2(), KErrNone); + + RSqlStatement stmt; + rc = stmt.Prepare(db, _L("SELECT Fld2 FROM A")); + TEST2(rc, KErrNone); + + TBuf8<16> databuf; + + rc = stmt.Next(); + TEST2(rc, KSqlAtRow); + //ColumnBinary() does not make an IPC call because the BLOB length is 0. + RSqlColumnReadStream strm; + rc = strm.ColumnBinary(stmt, 0); + TEST2(rc, KErrNone); + TRAP(rc, strm.ReadL(databuf, stmt.ColumnSize(0))); + strm.Close(); + TEST2(rc, KErrNone); + TEST2(databuf.Length(), 0); + + rc = stmt.Next(); + TEST2(rc, KSqlAtRow); + //ColumnBinary() does not make an IPC call because the BLOB length is less than the max inline + //column length - KSqlMaxDesLen. + rc = strm.ColumnBinary(stmt, 0); + TEST2(rc, KErrNone); + TRAP(rc, strm.ReadL(databuf, stmt.ColumnSize(0))); + strm.Close(); + TEST2(rc, KErrNone); + TEST(databuf == _L8("\x1\x2\x3\x4\x5")); + + rc = stmt.Next(); + TEST2(rc, KSqlAtRow); + //ColumnBinary() makes an IPC call (in _DEBUG mode) because: + // - the column length is exactly KSqlMaxDesLen. + // - but at the same time the column length is equal to KIpcBufSize (in debug mode). + rc = strm.ColumnBinary(stmt, 0); + TEST2(rc, KErrNone); + TRAP(rc, strm.ReadL(databuf, stmt.ColumnSize(0))); + strm.Close(); + TEST2(rc, KErrNone); + TEST(databuf == _L8("\x1\x2\x3\x4\x5\x6\x7\x8")); + + stmt.Close(); + db.Close(); + + rc = RSqlDatabase::Delete(KTestDbName1); + TEST2(rc, KErrNone); + } + +/** @SYMTestCaseID SYSLIB-SQL-CT-1608 @SYMTestCaseDesc Setting long text parameter values test. @SYMTestPriority High @@ -2159,7 +2360,7 @@ void DoTestsL() { - TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1601 Create/Open/Close database tests ")); + TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1601 Create/Open/Close database tests ")); OpenCloseDatabaseTest(); TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1602 SetIsolationLevel() database tests ")); @@ -2194,12 +2395,18 @@ TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1621 RSqlColumnReadStream test. Long binary column ")); ColumnBinaryStreamTest(); + TheTest.Next (_L(" @SYMTestCaseID:PDS-SQL-CT-4174 CSqlSrvSession::NewOutputStreamL() coverage test")); + ColumnBinaryStreamTest2(); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1608 RSqlParamWriteStream test. Long text parameter ")); TextParameterStreamTest(); TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1622 RSqlParamWriteStream test. Long binary parameter ")); BinaryParameterStreamTest(); + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-CT-4191 MStreamBuf::SeekL() test")); + StreamSeekTestL(); + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1634 RSqlStatement test. Nameless parameter ")); NamelessParameterTest(); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqlattach.cpp --- a/persistentstorage/sql/TEST/t_sqlattach.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqlattach.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -290,6 +290,12 @@ err = TheDb.Detach(dbName3); TEST2(err, KSqlErrGeneral); + //Attach a non-existing database + _LIT(KAttachDbFile5, "c:\\test\\zxcvbnm987654321.db"); + _LIT(KAttachDb5, "zxcvbnm987654321"); + err = TheDb.Attach(KAttachDbFile5, KAttachDb5); + TEST2(err, KErrNotFound); + TheDb.Close(); } diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqlcompact3.cpp --- a/persistentstorage/sql/TEST/t_sqlcompact3.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqlcompact3.cpp Mon May 03 14:09:14 2010 +0300 @@ -121,7 +121,7 @@ void CompactConfigTest1L() { //Create a test database with "manual" compaction mode - _LIT8(KConfigStr1, "encoding=utf8;compaction=manual"); + _LIT8(KConfigStr1, "encoding=utf-8;compaction=manual"); TInt err = TheDb.Create(KTestDbName1, &KConfigStr1); TEST2(err, KErrNone); //Check the vacuum mode. The SQLite vacuum mode should be "incremental" @@ -166,7 +166,7 @@ void CompactConfigTest2L() { //Create a test database with "auto" compaction mode - _LIT8(KConfigStr1, "encoding=utf8;compaction=auto"); + _LIT8(KConfigStr1, "encoding=utf-8;compaction=auto"); TInt err = TheDb.Create(KTestDbName1, &KConfigStr1); TEST2(err, KErrNone); //Check the vacuum mode. The SQLite vacuum mode should be "auto" @@ -177,7 +177,7 @@ //Create a test database with "synchronous" compaction mode err = RSqlDatabase::Delete(KTestDbName1); TEST2(err, KErrNone); - _LIT8(KConfigStr3, "encoding=utf8;compaction=synchronous"); + _LIT8(KConfigStr3, "encoding=utf-8;compaction=synchronous"); err = TheDb.Create(KTestDbName1, &KConfigStr3); TEST2(err, KErrNone); //Check the vacuum mode. The SQLite vacuum mode should be "auto" @@ -221,7 +221,7 @@ void CompactConfigTest3L() { //Create a test database with "background" compaction mode - _LIT8(KConfigStr1, "encoding=utf8;compaction=background"); + _LIT8(KConfigStr1, "encoding=utf-8;compaction=background"); TInt err = TheDb.Create(KTestDbName1, &KConfigStr1); TEST2(err, KErrNone); //Check the vacuum mode. The SQLite vacuum mode should be "incremental" @@ -278,7 +278,7 @@ err = RSqlDatabase::Delete(KTestDbName1); TEST2(err, KErrNone); //Create a test database with invalid configuration string - _LIT8(KConfigStr1, "encoding=utf8;compaction=backgrund"); + _LIT8(KConfigStr1, "encoding=utf-8;compaction=backgrund"); err = TheDb.Create(KTestDbName1, &KConfigStr1); TEST2(err, KErrNone); //Check the vacuum mode. The SQLite vacuum mode should be KSqlDefaultVacuum @@ -324,7 +324,7 @@ void CompactConfigTest5L() { //Create a private test database with "auto" compaction mode - _LIT8(KConfigStr1, "encoding=utf8;compaction=auto"); + _LIT8(KConfigStr1, "encoding=utf-8;compaction=auto"); TInt err = TheDb.Create(KTestPrivDbName, &KConfigStr1); TEST2(err, KErrNone); //Check the vacuum mode. The SQLite vacuum mode should be "auto" @@ -456,7 +456,7 @@ { //Create a secure test database with "auto" compaction mode. RSqlSecurityPolicy securityPolicy = CreateTestSecurityPolicy(); - _LIT8(KConfigStr1, "encoding=utf8;compaction=auto"); + _LIT8(KConfigStr1, "encoding=utf-8;compaction=auto"); TInt err = TheDb.Create(KTestSecureDbName, securityPolicy, &KConfigStr1); TEST2(err, KErrNone); securityPolicy.Close(); @@ -521,7 +521,7 @@ void CompactConfigTest7L() { //Create a test database with "auto" compaction mode. - _LIT8(KConfigStr1, "encoding=utf8;compaction = auto"); + _LIT8(KConfigStr1, "encoding=utf-8;compaction = auto"); TInt err = TheDb.Create(KTestDbName1, &KConfigStr1); TEST2(err, KErrNone); //Check the vacuum mode. The SQLite vacuum mode should be "auto" @@ -539,7 +539,7 @@ compact = scalarQuery2.SelectIntL(_L("PRAGMA auto_vacuum")); TEST2(compact, KAutoVacuum); //Open a third connection to the same database - "background" compaction mode config string - _LIT8(KConfigStr2, " encoding = utf8 ; ; ; compaction = background "); + _LIT8(KConfigStr2, " encoding = utf-8 ; ; ; compaction = background "); RSqlDatabase db3; err = db3.Open(KTestDbName1, &KConfigStr2); TEST2(err, KErrNone); @@ -577,7 +577,7 @@ compact = scalarQuery2.SelectIntL(_L("PRAGMA auto_vacuum")); TEST2(compact, KIncrementalVacuum); //Open a third connection to the same database - "auto" compaction mode config string - _LIT8(KConfigStr4, " encoding = utf16 ; compaction = auto ; ; ; "); + _LIT8(KConfigStr4, " encoding = utf-16 ; compaction = auto ; ; ; "); err = db3.Open(KTestDbName1, &KConfigStr4); TEST2(err, KErrNone); //Check the vacuum mode. The SQLite vacuum mode should be "incremental" diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqlcompact4.cpp --- a/persistentstorage/sql/TEST/t_sqlcompact4.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqlcompact4.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -433,13 +433,17 @@ //Nonexisting attached database err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, _L("aaa")); TEST2(err, KSqlErrGeneral); - //Very long name of a nonexisting attached database - TBuf fname; - fname.SetLength(fname.MaxLength()); - fname.Fill(0xDD); - err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, fname); - TEST2(err, KErrBadName); - // + //Very long name of a nonexisting attached database + TBuf fname; + fname.SetLength(fname.MaxLength()); + fname.Fill(0xDD); + err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, fname); + TEST2(err, KErrBadName); + //Invalid attached database name + fname.Copy(_L("c:\\|aaa|.db")); + err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, fname); + TEST2(err, KSqlErrGeneral); + // TheDb.Close(); (void)RSqlDatabase::Delete(TheTestDbName); } diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqlconfig.cpp --- a/persistentstorage/sql/TEST/t_sqlconfig.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqlconfig.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -430,8 +430,8 @@ (void)RSqlDatabase::Delete(KTestDbName2); (void)RSqlDatabase::Delete(KTestDbName); //Create 2 databases with different configuration parameters - _LIT8(KCfgStr2_1, "cache_size = 50; page_size = 512; encoding = UTF-16"); - _LIT8(KCfgStr2_2, "cache_size = 80; page_size = 4096; encoding = UTF-8"); + _LIT8(KCfgStr2_1, "cache_size = 50; page_size = 512; encoding = \"UTF-16\""); + _LIT8(KCfgStr2_2, "cache_size = 80; page_size = 4096; encoding = \"UTF-8\""); err = TheDb.Create(KTestDbName, &KCfgStr2_1); TEST2(err, KErrNone); err = TheDb2.Create(KTestDbName2, &KCfgStr2_2); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqldbconfigfile.cpp --- a/persistentstorage/sql/TEST/t_sqldbconfigfile.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqldbconfigfile.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -22,6 +22,15 @@ #include "SqliteSymbian.h" #include "SqlResourceTester.h" +//In order to be able to compile the test, the following variables are defined (used inside the OS porting layer, +//when _SQLPROFILER macro is defined) +#ifdef _SQLPROFILER +TInt TheSqlSrvProfilerFileRead = 0; +TInt TheSqlSrvProfilerFileWrite = 0; +TInt TheSqlSrvProfilerFileSync = 0; +TInt TheSqlSrvProfilerFileSetSize = 0; +#endif + ///////////////////////////////////////////////////////////////////////////////////////////////// /// This test works only if the whole SQL component is built with SYSLIBS_TEST macro defined! /// ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -36,13 +45,6 @@ RSqlDatabase TheDb; sqlite3 *TheDbHandle = NULL; -_LIT(KTestDir, "c:\\test\\"); -_LIT(KSqlSrvName, "sqlsrv.exe"); - -enum TConfigParamType {EPrmCacheSize, EPrmPageSize, EPrmDbEncoding}; - -TInt KillProcess(const TDesC& aProcessName); - _LIT(KCfgDb1, "c:[1111C1C1]a.db"); // shared, secure db _LIT(KCfgDb2, "c:[1111C1C1]b.db"); // shared, secure db (no config file for it) _LIT(KCfgDb3, "c:\\private\\1111C1C1\\c.db"); // private, secure db @@ -55,14 +57,6 @@ _LIT(KCfgDb5ConfigFileV01Path, "c:\\private\\10281e17\\cfg[1111C1C1]e.db.01"); // config file v01 for e.db _LIT(KCfgDb1CorruptConfigFilePath, "c:\\private\\10281e17\\cfg[1111C1C1]a.db.invalidextension"); // invalid config file name syntax -// config file v01 contents for db1 (also tests that upper and lower case statements are both supported) -_LIT8(KCfgDb1ConfigFile01Stmts, "CREATE INDEX idx ON table1(i1);CREATE INDEX idx2 ON table1(i2);INSERT INTO table1 (i1,i2,i3) values(5,8,9);DELETE FROM table1;create index multiidx ON TABLE1(i2,i3)"); -// config file v01 contents for db3 (will not be processed as db3 is not a shared, secure db) -_LIT8(KCfgDb3ConfigFile01Stmts, "CREATE INDEX idx ON table3(i1)"); -// config file v01 contents for db4 (will not be processed as db4 is not a shared, secure db) -_LIT8(KCfgDb4ConfigFile01Stmts, "CREATE INDEX idx ON table4(i1)"); -// config file v01 contents for db5 (will eventually be processed after db5 itself is created) -_LIT8(KCfgDb5ConfigFile01Stmts, "CREATE INDEX idx ON table5(i1);\r\n"); // config file valid contents (used for v02 and others) _LIT8(KCfgConfigFileValidStmt, "CREATE INDEX newIdx ON table1(i3) ;"); // config file v03 empty contents @@ -95,29 +89,21 @@ _LIT(KLongCfgName1, "c:\\private\\10281e17\\cfg[1111C1C1]a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a123456789a1234.db.01"); _LIT(KSqlSrvPrivatePath, "\\private\\10281e17\\"); -_LIT(KGetSettingsSql, "SELECT * FROM symbian_settings WHERE Reserved==%d"); _LIT(KResetCollationDllSql, "UPDATE symbian_settings SET CollationDllName='hjagafsff'"); -_LIT(KGetCollationDllSql, "SELECT CollationDllName FROM symbian_settings"); _LIT(KAttachDb1, "Db1"); _LIT(KAttachDb2, "Db2"); _LIT(KAttachDb5, "Db5"); -_LIT(KDb1CheckNumRecords, "SELECT * FROM table1"); -_LIT(KDb2CheckNumRecords, "SELECT * FROM table2"); -_LIT(KDb3CheckNumRecords, "SELECT * FROM table3"); -_LIT(KDb4CheckNumRecords, "SELECT * FROM table4"); -_LIT(KDb5CheckNumRecords, "SELECT * FROM table5"); -_LIT(KDbCheckNumIndices, "SELECT name FROM sqlite_master WHERE type = 'index'"); - /////////////////////////////////////////////////////////////////////////////////////// // Destroy functions -TInt KillProcess(const TDesC& aProcessName) +void KillSqlServer() { + _LIT(KSqlSrvName, "sqlsrv.exe"); TFullName name; //RDebug::Print(_L("Find and kill \"%S\" process.\n"), &aProcessName); - TBuf<64> pattern(aProcessName); + TBuf<64> pattern(KSqlSrvName); TInt length = pattern.Length(); pattern += _L("*"); TFindProcess procFinder(pattern); @@ -145,7 +131,6 @@ } proc.Close(); } - return KErrNone; } void DeleteCfgFilesAndDbs() @@ -177,7 +162,7 @@ TheDbHandle = NULL; } TheDb.Close(); - (void)KillProcess(KSqlSrvName); + KillSqlServer(); DeleteCfgFilesAndDbs(); TheFs.Close(); } @@ -223,8 +208,8 @@ RThread().HandleCount(endHandleCount1, endHandleCount2); - TEST(TheHandleCount1 == endHandleCount1); - TEST(TheHandleCount2 == endHandleCount2); + TEST2(TheHandleCount1, endHandleCount1); + TEST2(TheHandleCount2, endHandleCount2); } void MarkAllocatedCells() @@ -235,120 +220,87 @@ void CheckAllocatedCells() { TInt allocatedCellsCount = User::CountAllocCells(); - TEST(allocatedCellsCount == TheAllocatedCellsCount); + TEST2(allocatedCellsCount, TheAllocatedCellsCount); } /////////////////////////////////////////////////////////////////////////////////////// // Set up functions -TInt DoCreateSecurityPolicy(RSqlSecurityPolicy& securityPolicy) +RSqlSecurityPolicy CreateSecurityPolicy() { const TSecurityPolicy KDefaultPolicy(TSecurityPolicy::EAlwaysPass); - if((KErrNone != securityPolicy.Create(KDefaultPolicy)) - || - (KErrNone != securityPolicy.SetDbPolicy(RSqlSecurityPolicy::ESchemaPolicy, KDefaultPolicy)) - || - (KErrNone != securityPolicy.SetDbPolicy(RSqlSecurityPolicy::EWritePolicy, KDefaultPolicy)) - || - (KErrNone != securityPolicy.SetDbPolicy(RSqlSecurityPolicy::EReadPolicy, KDefaultPolicy))) - { - return KErrGeneral; - } - - return KErrNone; + RSqlSecurityPolicy policy; + TInt err = policy.Create(KDefaultPolicy); + TEST2(err, KErrNone); + err = policy.SetDbPolicy(RSqlSecurityPolicy::ESchemaPolicy, KDefaultPolicy); + TEST2(err, KErrNone); + err = policy.SetDbPolicy(RSqlSecurityPolicy::EWritePolicy, KDefaultPolicy); + TEST2(err, KErrNone); + err = policy.SetDbPolicy(RSqlSecurityPolicy::EReadPolicy, KDefaultPolicy); + TEST2(err, KErrNone); + return policy; } +void DoCreateCfgFile(const TDesC& aFileName, const TDesC8& aData) + { + RFile file; + TInt err = file.Create(TheFs, aFileName, EFileRead | EFileWrite); + TEST2(err, KErrNone); + err = file.Write(aData); + file.Close(); + TEST2(err, KErrNone); + } + +// Create v01 of the test config files void CreateCfgFiles() { - // Create v01 of the test config files - - RFile file; TFileName fileName; TInt v1 = 1; - fileName.Format(KCfgDb1ConfigFilePath(), v1); - TInt err = file.Create(TheFs, fileName, EFileRead | EFileWrite); - TEST2(err, KErrNone); - TPtrC8 pDb1((const TUint8*)KCfgDb1ConfigFile01Stmts().Ptr(), KCfgDb1ConfigFile01Stmts().Length()); - err = file.Write(pDb1); - file.Close(); - TEST2(err, KErrNone); - - fileName.Copy(KCfgDb3ConfigFileV01Path); - err = file.Create(TheFs, fileName, EFileRead | EFileWrite); - TEST2(err, KErrNone); - TPtrC8 pDb3((const TUint8*)KCfgDb3ConfigFile01Stmts().Ptr(), KCfgDb3ConfigFile01Stmts().Length()); - err = file.Write(pDb3); - file.Close(); - TEST2(err, KErrNone); - - fileName.Copy(KCfgDb4ConfigFileV01Path); - err = file.Create(TheFs, fileName, EFileRead | EFileWrite); - TEST2(err, KErrNone); - TPtrC8 pDb4((const TUint8*)KCfgDb4ConfigFile01Stmts().Ptr(), KCfgDb4ConfigFile01Stmts().Length()); - err = file.Write(pDb4); - file.Close(); - TEST2(err, KErrNone); - - fileName.Copy(KCfgDb5ConfigFileV01Path); // create the config file for Db5 before the database has been created - err = file.Create(TheFs, fileName, EFileRead | EFileWrite); - TEST2(err, KErrNone); - TPtrC8 pDb5((const TUint8*)KCfgDb5ConfigFile01Stmts().Ptr(), KCfgDb5ConfigFile01Stmts().Length()); - err = file.Write(pDb5); - file.Close(); - TEST2(err, KErrNone); + fileName.Format(KCfgDb1ConfigFilePath, v1); + + // config file v01 contents for db1 (also tests that upper and lower case statements are both supported) + _LIT8(KCfgDb1ConfigFile01Stmts, "CREATE INDEX idx ON table1(i1);CREATE INDEX idx2 ON table1(i2);INSERT INTO table1 (i1,i2,i3) values(5,8,9);DELETE FROM table1;create index multiidx ON TABLE1(i2,i3)"); + DoCreateCfgFile(fileName, KCfgDb1ConfigFile01Stmts); + + // config file v01 contents for db3 (will not be processed as db3 is not a shared, secure db) + _LIT8(KCfgDb3ConfigFile01Stmts, "CREATE INDEX idx ON table3(i1)"); + DoCreateCfgFile(KCfgDb3ConfigFileV01Path, KCfgDb3ConfigFile01Stmts); + + // config file v01 contents for db4 (will not be processed as db4 is not a shared, secure db) + _LIT8(KCfgDb4ConfigFile01Stmts, "CREATE INDEX idx ON table4(i1)"); + DoCreateCfgFile(KCfgDb4ConfigFileV01Path, KCfgDb4ConfigFile01Stmts); + + // create the config file for Db5 before the database has been created + // config file v01 contents for db5 (will eventually be processed after db5 itself is created) + _LIT8(KCfgDb5ConfigFile01Stmts, "CREATE INDEX idx ON table5(i1);\r\n"); + DoCreateCfgFile(KCfgDb5ConfigFileV01Path, KCfgDb5ConfigFile01Stmts); } +void DoCreateCfgDb(const TDesC& aFileName, const TDesC& aCreateTblSql, const TDesC& aInsertSql, + RSqlSecurityPolicy* aPolicy = NULL) + { + TInt err = aPolicy ? TheDb.Create(aFileName, *aPolicy) : TheDb.Create(aFileName); + TEST2(err, KErrNone); + err = TheDb.Exec(aCreateTblSql); + TEST(err >= 0); + err = TheDb.Exec(aInsertSql); + TEST(err == 1); + TheDb.Close(); + } + +// Create the test databases void CreateCfgDbs() { - // Create the test databases - - TBuf<100> sql; - - RSqlSecurityPolicy securityPolicy; - TInt err = DoCreateSecurityPolicy(securityPolicy); - TEST2(err, KErrNone); - - err = TheDb.Create(KCfgDb1, securityPolicy); - TEST2(err, KErrNone); - sql.Copy(_L("CREATE TABLE table1(i1 INTEGER, i2 INTEGER, i3 INTEGER)")); - err = TheDb.Exec(sql); - TEST(err >= 0); - sql.Copy(_L("INSERT INTO table1 (i1,i2,i3) values(1,2,3)")); - err = TheDb.Exec(sql); - TEST(err == 1); - TheDb.Close(); - - err = TheDb.Create(KCfgDb2, securityPolicy); - TEST2(err, KErrNone); - sql.Copy(_L("CREATE TABLE table2(i1 INTEGER, i2 INTEGER, i3 INTEGER)")); - err = TheDb.Exec(sql); - TEST(err >= 0); - sql.Copy(_L("INSERT INTO table2 (i1,i2,i3) values(4,5,6)")); - err = TheDb.Exec(sql); - TEST(err == 1); - TheDb.Close(); - - securityPolicy.Close(); - - err = TheDb.Create(KCfgDb3); - TEST2(err, KErrNone); - sql.Copy(_L("CREATE TABLE table3(i1 INTEGER, i2 INTEGER)")); - err = TheDb.Exec(sql); - TEST(err >= 0); - sql.Copy(_L("INSERT INTO table3 (i1,i2) values(7,8)")); - err = TheDb.Exec(sql); - TEST(err == 1); - TheDb.Close(); - - err = TheDb.Create(KCfgDb4); - TEST2(err, KErrNone); - sql.Copy(_L("CREATE TABLE table4(i1 INTEGER, i2 INTEGER, i3 INTEGER)")); - err = TheDb.Exec(sql); - TEST(err >= 0); - sql.Copy(_L("INSERT INTO table4 (i1,i2,i3) values(9,10,11)")); - err = TheDb.Exec(sql); - TEST(err == 1); - TheDb.Close(); + RSqlSecurityPolicy securityPolicy = CreateSecurityPolicy(); + DoCreateCfgDb(KCfgDb1, _L("CREATE TABLE table1(i1 INTEGER, i2 INTEGER, i3 INTEGER)"), + _L("INSERT INTO table1 (i1,i2,i3) values(1,2,3)"), &securityPolicy); + DoCreateCfgDb(KCfgDb2, _L("CREATE TABLE table2(i1 INTEGER, i2 INTEGER, i3 INTEGER)"), + _L("INSERT INTO table2 (i1,i2,i3) values(4,5,6)"), &securityPolicy); + securityPolicy.Close(); + DoCreateCfgDb(KCfgDb3, _L("CREATE TABLE table3(i1 INTEGER, i2 INTEGER)"), + _L("INSERT INTO table3 (i1,i2) values(7,8)")); + DoCreateCfgDb(KCfgDb4, _L("CREATE TABLE table4(i1 INTEGER, i2 INTEGER, i3 INTEGER)"), + _L("INSERT INTO table4 (i1,i2,i3) values(9,10,11)")); } void CreateCfgFilesAndDbs() @@ -358,29 +310,15 @@ // Must now kill the SQL Server so that the config files // created above are found and processed when it restarts - (void)KillProcess(KSqlSrvName); + KillSqlServer(); } +// Create the Db5 test database (a config file for it already exists) void CreateDb5() { - // Create the Db5 test database (a config file for it already exists) - - TBuf<100> sql; - - RSqlSecurityPolicy securityPolicy; - TInt err = DoCreateSecurityPolicy(securityPolicy); - TEST2(err, KErrNone); - - err = TheDb.Create(KCfgDb5, securityPolicy); - TEST2(err, KErrNone); - sql.Copy(_L("CREATE TABLE table5(i1 INTEGER, i2 INTEGER, i3 INTEGER)")); - err = TheDb.Exec(sql); - TEST(err >= 0); - sql.Copy(_L("INSERT INTO table5 (i1,i2,i3) values(1,2,3)")); - err = TheDb.Exec(sql); - TEST(err == 1); - - TheDb.Close(); + RSqlSecurityPolicy securityPolicy = CreateSecurityPolicy(); + DoCreateCfgDb(KCfgDb5, _L("CREATE TABLE table5(i1 INTEGER, i2 INTEGER, i3 INTEGER)"), + _L("INSERT INTO table5 (i1,i2,i3) values(1,2,3)"), &securityPolicy); securityPolicy.Close(); } @@ -389,6 +327,7 @@ TInt err = TheFs.Connect(); TEST2(err, KErrNone); + _LIT(KTestDir, "c:\\test\\"); err = TheFs.MkDir(KTestDir); TEST(err == KErrNone || err == KErrAlreadyExists); @@ -422,421 +361,218 @@ /////////////////////////////////////////////////////////////////////////////////////// // Config file replacement functions -void UpgradeDbConfigFile(const TInt aCurrentVersion) +void UpgradeDbConfigFile(TInt aCurrentVersion) { - (void)KillProcess(KSqlSrvName); - TFileName oldFile; - oldFile.Format(KCfgDb1ConfigFilePath(), aCurrentVersion); - TInt err = TheFs.Delete(oldFile); - TEST2(err, KErrNone); - RFile file; - TFileName newFile; - TInt newVersion = aCurrentVersion+1; - newFile.Format(KCfgDb1ConfigFilePath(), newVersion); - err = file.Create(TheFs, newFile, EFileRead | EFileWrite); + TInt newVersion = aCurrentVersion + 1; + TEST(newVersion != 0 && newVersion != 1 && newVersion != 10 && newVersion != 11 && newVersion < 15); + + KillSqlServer(); + + TFileName fname; + fname.Format(KCfgDb1ConfigFilePath, aCurrentVersion); + TInt err = TheFs.Delete(fname); TEST2(err, KErrNone); - switch(newVersion) - { - case 2: - { - TPtrC8 p((const TUint8*)KCfgConfigFileValidStmt().Ptr(), KCfgConfigFileValidStmt().Length()); - err = file.Write(p); - break; - } - case 3: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV03EmptyStmt().Ptr(), KCfgDb1ConfigFileV03EmptyStmt().Length()); - err = file.Write(p); - break; - } - case 4: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV04UnsupportedStmt().Ptr(), KCfgDb1ConfigFileV04UnsupportedStmt().Length()); - err = file.Write(p); - break; - } - case 5: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV05OnlyWhitespaceStmt().Ptr(), KCfgDb1ConfigFileV05OnlyWhitespaceStmt().Length()); - err = file.Write(p); - break; - } - case 6: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV06InvalidSchemaStmt().Ptr(), KCfgDb1ConfigFileV06InvalidSchemaStmt().Length()); - err = file.Write(p); - break; - } - case 7: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV07InvalidCommentedStmt().Ptr(), KCfgDb1ConfigFileV07InvalidCommentedStmt().Length()); - err = file.Write(p); - break; - } - case 8: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV08SeqStmt().Ptr(), KCfgDb1ConfigFileV08SeqStmt().Length()); - err = file.Write(p); - break; - } - case 9: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV09WhitespacePreAndPostStmt().Ptr(), KCfgDb1ConfigFileV09WhitespacePreAndPostStmt().Length()); - err = file.Write(p); - break; - } - case 12: - { - // also delete version 10 of file - oldFile.Format(KCfgDb1ConfigFilePath(), 10); - err = TheFs.Delete(oldFile); - TEST2(err, KErrNone); - - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV12InvalidPlusValidStmt().Ptr(), KCfgDb1ConfigFileV12InvalidPlusValidStmt().Length()); - err = file.Write(p); - break; - } - case 13: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV13SQLCommentStmt().Ptr(), KCfgDb1ConfigFileV13SQLCommentStmt().Length()); - err = file.Write(p); - break; - } - case 14: - { - TPtrC8 p((const TUint8*)KCfgDb1ConfigFileV14CCommentStmt().Ptr(), KCfgDb1ConfigFileV14CCommentStmt().Length()); - err = file.Write(p); - break; - } - default: - { - err = KErrArgument; - break; - } - } - file.Close(); - TEST2(err, KErrNone); + if(newVersion == 12) + { + // also delete version 10 of file + fname.Format(KCfgDb1ConfigFilePath, 10); + err = TheFs.Delete(fname); + TEST2(err, KErrNone); + } + + const TPtrC8 stmts[] = {KNullDesC8(), KNullDesC8(), + KCfgConfigFileValidStmt(), + KCfgDb1ConfigFileV03EmptyStmt(), + KCfgDb1ConfigFileV04UnsupportedStmt(), + KCfgDb1ConfigFileV05OnlyWhitespaceStmt(), + KCfgDb1ConfigFileV06InvalidSchemaStmt(), + KCfgDb1ConfigFileV07InvalidCommentedStmt(), + KCfgDb1ConfigFileV08SeqStmt(), + KCfgDb1ConfigFileV09WhitespacePreAndPostStmt(), + KNullDesC8(), KNullDesC8(), + KCfgDb1ConfigFileV12InvalidPlusValidStmt(), + KCfgDb1ConfigFileV13SQLCommentStmt(), + KCfgDb1ConfigFileV14CCommentStmt()}; + + fname.Format(KCfgDb1ConfigFilePath, newVersion); + DoCreateCfgFile(fname, stmts[newVersion]); } -void DowngradeDbConfigFile(const TInt aCurrentVersion) +void DowngradeDbConfigFile(TInt aCurrentVersion) { - (void)KillProcess(KSqlSrvName); - TFileName oldFile; - oldFile.Format(KCfgDb1ConfigFilePath(), aCurrentVersion); - TInt err = TheFs.Delete(oldFile); + TEST(aCurrentVersion > 1); + + KillSqlServer(); + + TFileName fname; + fname.Format(KCfgDb1ConfigFilePath, aCurrentVersion); + TInt err = TheFs.Delete(fname); TEST2(err, KErrNone); - RFile file; - TFileName newFile; - TInt previousVersion = aCurrentVersion-1; - TEST(previousVersion > 0); - newFile.Format(KCfgDb1ConfigFilePath(), previousVersion); - err = file.Create(TheFs, newFile, EFileRead | EFileWrite); - TEST2(err, KErrNone); - TPtrC8 p((const TUint8*)KCfgConfigFileValidStmt().Ptr(), KCfgConfigFileValidStmt().Length()); - err = file.Write(p); - file.Close(); - TEST2(err, KErrNone); + + fname.Format(KCfgDb1ConfigFilePath, aCurrentVersion - 1); + DoCreateCfgFile(fname, KCfgConfigFileValidStmt); } -void CreateCorruptDbConfigFile(const TInt aCurrentVersion) +void CreateCorruptDbConfigFile(TInt aCurrentVersion) { - (void)KillProcess(KSqlSrvName); - TFileName oldFile; - oldFile.Format(KCfgDb1ConfigFilePath(), aCurrentVersion); - TInt err = TheFs.Delete(oldFile); + KillSqlServer(); + + TFileName fname; + fname.Format(KCfgDb1ConfigFilePath, aCurrentVersion); + TInt err = TheFs.Delete(fname); TEST2(err, KErrNone); - RFile file; - err = file.Create(TheFs, KCfgDb1CorruptConfigFilePath(), EFileRead | EFileWrite); - TEST2(err, KErrNone); - TPtrC8 p((const TUint8*)KCfgConfigFileValidStmt().Ptr(), KCfgConfigFileValidStmt().Length()); - err = file.Write(p); - file.Close(); - TEST2(err, KErrNone); + + DoCreateCfgFile(KCfgDb1CorruptConfigFilePath, KCfgConfigFileValidStmt); } void CreateTwoVersionsOfConfigFile() { - (void)KillProcess(KSqlSrvName); + KillSqlServer(); + TInt err = TheFs.Delete(KCfgDb1CorruptConfigFilePath); TEST2(err, KErrNone); - RFile file; - TFileName newFile; - TInt nextVersion = 10; - newFile.Format(KCfgDb1ConfigFilePath(), nextVersion); - err = file.Create(TheFs, newFile, EFileRead | EFileWrite); - TEST2(err, KErrNone); - TPtrC8 p10((const TUint8*)KCfgDb1ConfigFileV10ValidStmt().Ptr(), KCfgDb1ConfigFileV10ValidStmt().Length()); - err = file.Write(p10); - file.Close(); - TEST2(err, KErrNone); + + TInt nextVersion = 10; + TFileName fname; + fname.Format(KCfgDb1ConfigFilePath, nextVersion); + DoCreateCfgFile(fname, KCfgDb1ConfigFileV10ValidStmt); + ++nextVersion; - newFile.Format(KCfgDb1ConfigFilePath(), nextVersion); - err = file.Create(TheFs, newFile, EFileRead | EFileWrite); - TEST2(err, KErrNone); - TPtrC8 p11((const TUint8*)KCfgDb1ConfigFileV11ValidStmt().Ptr(), KCfgDb1ConfigFileV11ValidStmt().Length()); - err = file.Write(p11); - file.Close(); - TEST2(err, KErrNone); + fname.Format(KCfgDb1ConfigFilePath, nextVersion); + DoCreateCfgFile(fname, KCfgDb1ConfigFileV11ValidStmt); } /////////////////////////////////////////////////////////////////////////////////////// // DoDbCfgTests() functions +TInt GetDbCfgVersion(const TDesC& aDbName) + { + // Note: We have to use SQLite directly to access the settings + // table as the SQL Server denies permission to access this table + // as it is in a shared, secure database + + TParse parse; + TInt err = parse.Set(aDbName, &KSqlSrvPrivatePath, 0); + TEST2(err, KErrNone); + + TBuf8 dbFileName; + dbFileName.Copy(parse.FullName()); + + sqlite3 *dbHandle = NULL; + TInt rc = sqlite3_open((const char*)dbFileName.PtrZ(), &dbHandle); + TEST2(rc, SQLITE_OK); + + _LIT(KGetDbCfgVersionSql, "SELECT Reserved AS DbCfgVersion FROM symbian_settings"); + TBuf<100> queryBuf; + queryBuf.Copy(KGetDbCfgVersionSql); + + sqlite3_stmt* stmtHandle = NULL; + const void* stmtTailZ = NULL; + rc = sqlite3_prepare16_v2(dbHandle, queryBuf.PtrZ(), -1, &stmtHandle, &stmtTailZ); + TEST2(rc, SQLITE_OK); + + rc = sqlite3_step(stmtHandle); + TEST2(rc, SQLITE_ROW); + + TInt version = sqlite3_column_int(stmtHandle, 0); + + rc = sqlite3_step(stmtHandle); + TEST2(rc, SQLITE_DONE); + + sqlite3_finalize(stmtHandle); + sqlite3_close(dbHandle); + + return version; + } + TBool GuessSystemSettingsTable(const TDesC& aDbName, TInt aVersion) { - // Note: We have to use SQLite directly to access the settings - // table as the SQL Server denies permission to access this table - // as it is in a shared, secure database - - TBool guessIsCorrect = EFalse; - - TParse parse; - parse.Set(aDbName, &KSqlSrvPrivatePath, 0); - - TBuf8 dbFileName; - dbFileName.Copy(parse.FullName()); - - TheDbHandle = NULL; - TInt rc = sqlite3_open((const char*)dbFileName.PtrZ(), &TheDbHandle); - TEST2(rc, SQLITE_OK); - - TBuf<100> queryBuf; - queryBuf.Format(KGetSettingsSql(), aVersion); - - sqlite3_stmt* stmtHandle = NULL; - const void* stmtTailZ = NULL; - rc = sqlite3_prepare16_v2(TheDbHandle, queryBuf.PtrZ(), -1, &stmtHandle, &stmtTailZ); - TEST2(rc, SQLITE_OK); - - rc = sqlite3_step(stmtHandle); - if(SQLITE_ROW == rc) - { - guessIsCorrect = ETrue; - rc = sqlite3_step(stmtHandle); - TEST2(rc, SQLITE_DONE); - } - - sqlite3_finalize(stmtHandle); - sqlite3_close(TheDbHandle); - TheDbHandle = NULL; - - return guessIsCorrect; + TInt dbCfgVersion = GetDbCfgVersion(aDbName); + return dbCfgVersion == aVersion; } void CheckSystemSettingsTable(const TDesC& aDbName, TInt aVersion) { - // Note: We have to use SQLite directly to access the settings - // table as the SQL Server denies permission to access this table - // as it is in a shared, secure database - - TParse parse; - parse.Set(aDbName, &KSqlSrvPrivatePath, 0); - - TBuf8 dbFileName; - dbFileName.Copy(parse.FullName()); - - sqlite3 *dbHandle = NULL; - TInt rc = sqlite3_open((const char*)dbFileName.PtrZ(), &dbHandle); - TEST2(rc, SQLITE_OK); - - TBuf<100> queryBuf; - queryBuf.Format(KGetSettingsSql(), aVersion); - - sqlite3_stmt* stmtHandle = NULL; - const void* stmtTailZ = NULL; - rc = sqlite3_prepare16_v2(dbHandle, queryBuf.PtrZ(), -1, &stmtHandle, &stmtTailZ); - TEST2(rc, SQLITE_OK); - - rc = sqlite3_step(stmtHandle); - TEST2(rc, SQLITE_ROW); - - rc = sqlite3_step(stmtHandle); - TEST2(rc, SQLITE_DONE); - - sqlite3_finalize(stmtHandle); - sqlite3_close(dbHandle); + TInt dbCfgVersion = GetDbCfgVersion(aDbName); + TEST2(dbCfgVersion, aVersion); } -void CheckNumberRecordsL(const TDesC& aStmt) +void CheckRecordCount(const TDesC& aTable) { // There should always be only 1 record in the table // in each database as INSERT and DELETE statements are // not supported in the config files - - // Prepare stmt - RSqlStatement stmt; - stmt.PrepareL(TheDb, aStmt); - - // Get each row - TUint numRows = 0; - TInt err = stmt.Next(); - while(KSqlAtRow == err) - { - numRows++; - err = stmt.Next(); - } - - if (KSqlAtEnd != err) - { - User::Leave(KErrCorrupt); - } - - if (numRows != 1) - { - User::Leave(KErrArgument); - } - - // Close stmt - stmt.Close(); + TBuf<50> sql; + sql.Format(_L("SELECT COUNT(*) FROM %S"), &aTable); + TSqlScalarFullSelectQuery q(TheDb); + TInt count = 0; + TRAPD(err, count = q.SelectIntL(sql)); + TEST2(err, KErrNone); + TEST2(count, 1); } -TInt NumberIndicesExpectedInDb1(const TInt aExpectedStoredVersion) +TInt ExpectedDb1IndexCount(TInt aExpectedStoredVersion) { - TInt numIndices = -1; - - switch(aExpectedStoredVersion) - { - // Only files 01 - 04, 09 and 11 will be successfully processed and so stored in the settings table - case 1: - { - numIndices = 3; // 3 indices should be added to db1 based on config file 01 - break; - } - case 2: - { - numIndices = 4; // 1 more index should be added to db1 based on config file 02 - break; - } - case 3: - case 4: - case 5: - case 6: - case 7: - { - numIndices = 4; // no more indices should be added to db1 based on config file 03 - 07 - break; - } - case 8: - { - numIndices = 6; // 2 more indices should be added to db1 based on config file 08 - break; - } - case 9: - { - numIndices = 7; // 1 more index should be added to db1 based on config file 09 - break; - } - case 11: - { - numIndices = 9; // 2 more indices should be added to db1 based on config file 11 - break; - } - case 12: - { - numIndices = 10; // 1 more index should be added to db1 based on config file 12 - break; - } - case 13: - { - numIndices = 11; // 1 more index should be added to db1 based on config file 13 - break; - } - case 14: - { - numIndices = 12; // 1 more index should be added to db1 based on config file 14 - break; - } - } - - return numIndices; + TEST(aExpectedStoredVersion >= 0 && aExpectedStoredVersion < 15); + const TInt KIdxCnt[] = { + -1, + 3, // Only files 01 - 04, 09 and 11 will be successfully processed and so stored in the settings table + 4, // 1 more index should be added to db1 based on config file 02 + 4, 4, 4, 4, 4, // no more indices should be added to db1 based on config file 03 - 07 + 6, // 2 more indices should be added to db1 based on config file 08 + 7, // 1 more index should be added to db1 based on config file 09 + -1, + 9, // 2 more indices should be added to db1 based on config file 11 + 10, // 1 more index should be added to db1 based on config file 12 + 11, // 1 more index should be added to db1 based on config file 13 + 12}; // 1 more index should be added to db1 based on config file 14 + return KIdxCnt[aExpectedStoredVersion]; } -void CheckNumberIndicesL(const TInt aNumIndicesExpected) +void CheckIndexCount(TInt aExpectedIndexCount) { - // Prepare stmt - RSqlStatement stmt; - stmt.PrepareL(TheDb, KDbCheckNumIndices); - - // Get each entry of type 'index' in the 'sqlite_master' table - TUint numEntries = 0; - TInt err = stmt.Next(); - while(KSqlAtRow == err) - { - numEntries++; - err = stmt.Next(); - } - - if (KSqlAtEnd != err) - { - User::Leave(KErrCorrupt); - } - - if (numEntries != aNumIndicesExpected) - { - User::Leave(KErrArgument); - } - - // Close stmt - stmt.Close(); + _LIT(KDbCheckNumIndices, "SELECT COUNT(*) FROM sqlite_master WHERE type = 'index'"); + TSqlScalarFullSelectQuery q(TheDb); + TInt count = 0; + TRAPD(err, count = q.SelectIntL(KDbCheckNumIndices)); + TEST2(err, KErrNone); + TEST2(count, aExpectedIndexCount); } -void DoCfgOpenTests(TInt aExpectedStoredVersion = 1) +void DoCfgOpenTest(TInt aExpectedStoredVersion, const TDesC& aDbFileName, const TDesC& aTblName, TInt aExpectedIndexCnt) + { + TInt err = TheDb.Open(aDbFileName); + TEST2(err, KErrNone); + CheckRecordCount(aTblName); + CheckIndexCount(aExpectedIndexCnt); + TheDb.Close(); + // Check that the ops in the specified config file have been applied. + CheckSystemSettingsTable(aDbFileName, aExpectedStoredVersion); + } + +void DoCfgOpenTests(TInt aExpectedStoredVersion) { - // Open a shared, secure database - config ops should be applied on it + // Open a shared, secure database - config ops should be applied on it. + // There should still be only 1 record and 3 indices in the table. TheTest.Printf(_L("===CfgOpen: Open shared, secure database\r\n")); - TInt err = TheDb.Open(KCfgDb1); - TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb1CheckNumRecords)); // there should still be only 1 record in the table - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(NumberIndicesExpectedInDb1(aExpectedStoredVersion))); // there should now be 3 indices in the table - TEST2(err, KErrNone); - TheDb.Close(); - CheckSystemSettingsTable(KCfgDb1, aExpectedStoredVersion); // check that the ops in the specified config file have been applied + DoCfgOpenTest(aExpectedStoredVersion, KCfgDb1, _L("table1"), ExpectedDb1IndexCount(aExpectedStoredVersion)); - // Open again the same shared, secure database - no config should occur (it has already been done) + // Open again the same shared, secure database - no config should occur (it has already been done). TheTest.Printf(_L("===CfgOpen: Open shared, secure database again\r\n")); - err = TheDb.Open(KCfgDb1); - TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb1CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(NumberIndicesExpectedInDb1(aExpectedStoredVersion))); - TEST2(err, KErrNone); - TheDb.Close(); - CheckSystemSettingsTable(KCfgDb1, aExpectedStoredVersion); + DoCfgOpenTest(aExpectedStoredVersion, KCfgDb1, _L("table1"), ExpectedDb1IndexCount(aExpectedStoredVersion)); // Open a shared, secure database - no config should occur (there is no config file for this database) TheTest.Printf(_L("===CfgOpen: Open shared, secure database (that has no config file)\r\n")); - err = TheDb.Open(KCfgDb2); - TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb2CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(0)); - TEST2(err, KErrNone); - TheDb.Close(); - CheckSystemSettingsTable(KCfgDb2, 0); + DoCfgOpenTest(0, KCfgDb2, _L("table2"), 0); // Open a private, secure database - no config should occur TheTest.Printf(_L("===CfgOpen: Open private, secure database\r\n")); - err = TheDb.Open(KCfgDb3); - TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb3CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(0)); - TEST2(err, KErrNone); - TheDb.Close(); - CheckSystemSettingsTable(KCfgDb3, 0); + DoCfgOpenTest(0, KCfgDb3, _L("table3"), 0); // Open a public database - no config should occur TheTest.Printf(_L("===CfgOpen: Open public database\r\n")); - err = TheDb.Open(KCfgDb4); - TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb4CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(0)); - TEST2(err, KErrNone); - TheDb.Close(); - CheckSystemSettingsTable(KCfgDb4, 0); + DoCfgOpenTest(0, KCfgDb4, _L("table4"), 0); } void DoUpgradedCfgOpenTest() @@ -906,27 +642,14 @@ // Create Db5 - a config file already exists for this database CreateDb5(); - // Open the shared, secure database Db5 - config ops should be applied on it + // Open the shared, secure database Db5 - config ops should be applied on it. + // There should now be 1 index in the table. TheTest.Printf(_L("===NewDbCfg: Open shared, secure database\r\n")); - TInt err = TheDb.Open(KCfgDb5); - TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb5CheckNumRecords)); // there should still be only 1 record in the table - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(1)); // there should now be 1 index in the table - TEST2(err, KErrNone); - TheDb.Close(); - CheckSystemSettingsTable(KCfgDb5, 1); // check that the ops in the specified config file have been applied + DoCfgOpenTest(1, KCfgDb5, _L("table5"), 1); // Open again the same shared, secure database - no config should occur (it has already been done) TheTest.Printf(_L("===NewDbCfg: Open shared, secure database again\r\n")); - err = TheDb.Open(KCfgDb5); - TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb5CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(1)); - TEST2(err, KErrNone); - TheDb.Close(); - CheckSystemSettingsTable(KCfgDb5, 1); + DoCfgOpenTest(1, KCfgDb5, _L("table5"), 1); } void DoCfgAttachTests(TInt aExpectedStoredVersion = 0) @@ -1027,19 +750,15 @@ TheTest.Printf(_L("===NewDbCfgAttach: Open private, secure database\r\n")); TInt err = TheDb.Open(KCfgDb3); TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb3CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(0)); - TEST2(err, KErrNone); + CheckRecordCount(_L("table3")); + CheckIndexCount(0); // Attach a shared, secure database - the db5 config file should not be processed TheTest.Printf(_L("===NewDbCfgAttach: Attach shared, secure database\r\n")); err = TheDb.Attach(KCfgDb5, KAttachDb5); TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb5CheckNumRecords)); // there should still be only 1 record in the table - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(0)); // there should still be no indices in the table - TEST2(err, KErrNone); + CheckRecordCount(_L("table5")); + CheckIndexCount(0); // there should still be no indices in the table TheDb.Close(); CheckSystemSettingsTable(KCfgDb5, 1); // check that the config file has been processed for db1 CheckSystemSettingsTable(KCfgDb3, 0); @@ -1092,7 +811,8 @@ TInt rc = sqlite3_open((const char*)dbFileName.PtrZ(), &dbHandle); TEST2(rc, SQLITE_OK); - TBuf<100> queryBuf; + _LIT(KGetCollationDllSql, "SELECT CollationDllName FROM symbian_settings"); + TBuf<100> queryBuf; queryBuf.Append(KGetCollationDllSql()); sqlite3_stmt* stmtHandle = NULL; @@ -1137,10 +857,8 @@ */ void DoDbCfgTests() { - TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4010 DoDbCfgTests ")); - // Do 'open' tests for new db config file feature - DoCfgOpenTests(); // open the test databases + DoCfgOpenTests(1); // open the test databases DoUpgradedCfgOpenTest(); // upgrade the config file for db1 and reopen the test databases DoBadCfgOpenTests(); // corrupt the config file for db1 (in a variety of ways) and reopen the test databases DoNewDbCfgOpenTest(); // create a db for which a config file already exists and then open the db @@ -1161,7 +879,7 @@ // Do the test that causes both reindexing and db configuration to occur when db1 is opened ResetStoredCollationDll(); - DoCfgOpenTests(); + DoCfgOpenTests(1); CheckCollationDllUpdated(); // Recreate the original dbs and config files @@ -1191,8 +909,6 @@ */ void DoDbCfgOOMTests() { - TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4013 DoDbCfgOOMTests ")); - // Recreate the original dbs and config files DeleteCfgFilesAndDbs(); CreateCfgFilesAndDbs(); @@ -1268,8 +984,6 @@ */ void DoDbCfgFileIOFailuresTests() { - TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4014 DoDbCfgFileIOFailuresTests ")); - // Recreate the original dbs and config files DeleteCfgFilesAndDbs(); CreateCfgFilesAndDbs(); @@ -1346,12 +1060,10 @@ */ void DoDbCfgPerfTests() { - TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4015 DoDbCfgPerfTests ")); - // Recreate the original dbs DeleteCfgFilesAndDbs(); CreateCfgDbs(); - (void)KillProcess(KSqlSrvName); // stop the server + KillSqlServer(); // Measure the start up time of the server when // there are no database configuration files to be cached. @@ -1362,10 +1074,8 @@ TInt err = TheDb.Open(KCfgDb4); TUint32 end = User::FastCounter(); TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb4CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(0)); - TEST2(err, KErrNone); + CheckRecordCount(_L("table4")); + CheckIndexCount(0); TheDb.Close(); CheckSystemSettingsTable(KCfgDb4, 0); TInt ms = CalcTimeMs(start, end); @@ -1380,10 +1090,8 @@ err = TheDb.Open(KCfgDb1); end = User::FastCounter(); TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb1CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(0)); - TEST2(err, KErrNone); + CheckRecordCount(_L("table1")); + CheckIndexCount(0); TheDb.Close(); CheckSystemSettingsTable(KCfgDb1, 0); ms = CalcTimeMs(start, end); @@ -1407,7 +1115,7 @@ // Create the 4 version 01 config files now CreateCfgFiles(); - (void)KillProcess(KSqlSrvName); // stop the server so that the files are found when it is restarted + KillSqlServer(); // stop the server so that the files are found when it is restarted // Measure the start up time of the server when // there are 4 database configuration files to be cached. @@ -1418,10 +1126,8 @@ err = TheDb.Open(KCfgDb4); end = User::FastCounter(); TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb4CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(0)); - TEST2(err, KErrNone); + CheckRecordCount(_L("table4")); + CheckIndexCount(0); TheDb.Close(); CheckSystemSettingsTable(KCfgDb4, 0); ms = CalcTimeMs(start, end); @@ -1436,10 +1142,8 @@ err = TheDb.Open(KCfgDb1); end = User::FastCounter(); TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb1CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(3)); - TEST2(err, KErrNone); + CheckRecordCount(_L("table1")); + CheckIndexCount(3); TheDb.Close(); CheckSystemSettingsTable(KCfgDb1, 1); ms = CalcTimeMs(start, end); @@ -1454,10 +1158,8 @@ err = TheDb.Open(KCfgDb1); end = User::FastCounter(); TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb1CheckNumRecords)); - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(3)); - TEST2(err, KErrNone); + CheckRecordCount(_L("table1")); + CheckIndexCount(3); TheDb.Close(); CheckSystemSettingsTable(KCfgDb1, 1); ms = CalcTimeMs(start, end); @@ -1480,28 +1182,21 @@ TheTest.Printf(_L("Execution time: Attach shared, secure Db1 - database config is not considered: %d ms\r\n"), ms); } -void TestStatementsL() +void TestStatements() { - _LIT(KDbName, "attachDb"); - _LIT(KCreateIndex, "CREATE INDEX idx ON tbl(ColA)"); - _LIT(KCreateIndexIfNotExists, "CREATE INDEX IF NOT EXISTS idx ON tbl(ColA)"); - _LIT(KCreateUniqueIndex, "CREATE UNIQUE INDEX idx ON tbl(ColA)"); - _LIT(KNonSupported, "CREATE idx ON tbl(ColA)"); + _LIT(KDbName, "attachDb"); TBuf<200> buf; // supported statements - - TBool rc = IsStatementSupported(KCreateIndex, KDbName, buf); + TBool rc = IsStatementSupported(_L("CREATE INDEX idx ON tbl(ColA)"), KDbName, buf); TEST(rc); - - rc = IsStatementSupported(KCreateIndexIfNotExists, KDbName, buf); + rc = IsStatementSupported(_L("CREATE INDEX IF NOT EXISTS idx ON tbl(ColA)"), KDbName, buf); TEST(rc); // unsupported statements - rc = IsStatementSupported(KCreateUniqueIndex, KDbName, buf); + rc = IsStatementSupported(_L("CREATE UNIQUE INDEX idx ON tbl(ColA)"), KDbName, buf); TEST(!rc); - - rc = IsStatementSupported(KNonSupported, KDbName, buf); + rc = IsStatementSupported(_L("CREATE idx ON tbl(ColA)"), KDbName, buf); TEST(!rc); } @@ -1518,20 +1213,15 @@ */ void DoIsStatementSupportedTests() { - TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4030 DoIsStatementSupportedTests ")); - TInt err = KErrNone; - TRAP(err, TestStatementsL()); - TEST2(err, KErrNone); + TestStatements(); } void DoLongDbNameTest() { - TheTest.Next(_L("'Long database name' tests")); //Create the database - RSqlSecurityPolicy securityPolicy; - TInt err = DoCreateSecurityPolicy(securityPolicy); - TEST2(err, KErrNone); - err = TheDb.Create(KLongDbName1, securityPolicy); + RSqlSecurityPolicy securityPolicy = CreateSecurityPolicy(); + + TInt err = TheDb.Create(KLongDbName1, securityPolicy); TEST2(err, KErrNone); err = TheDb.Exec(_L("CREATE TABLE table1(i1 INTEGER, i2 INTEGER, i3 INTEGER)")); TEST(err >= 0); @@ -1539,7 +1229,7 @@ TEST(err == 1); TheDb.Close(); //Kill the server (to reload config file names at the server startup) - (void)KillProcess(KSqlSrvName); + KillSqlServer(); /////////////////////////////////////////////////////////////////////// TheTest.Printf(_L("Open a database with a long name\r\n")); //Create cfg file @@ -1554,10 +1244,8 @@ //Open the database err = TheDb.Open(KLongDbName1); TEST2(err, KErrNone); - TRAP(err, CheckNumberRecordsL(KDb1CheckNumRecords)); // there should still be only 1 record in the table - TEST2(err, KErrNone); - TRAP(err, CheckNumberIndicesL(1)); // there should now be 1 index in the table - TEST2(err, KErrNone); + CheckRecordCount(_L("table1")); + CheckIndexCount(1); // there should now be 1 index in the table TheDb.Close(); const TInt KVersion = 1; CheckSystemSettingsTable(KLongDbName1, KVersion); // check that the ops in the specified config file have been applied @@ -1574,7 +1262,7 @@ TEST(err == 1); TheDb.Close(); //Kill the server (to reload config file names at the server startup) - (void)KillProcess(KSqlSrvName); + KillSqlServer(); //Open the main database err = TheDb.Open(KCfgDb1); securityPolicy.Close(); @@ -1593,6 +1281,27 @@ (void)RSqlDatabase::Delete(KLongDbName1); } +void DoTests() + { + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4010 Database config files test")); + DoDbCfgTests(); + + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4013 Database config files OOM test")); + DoDbCfgOOMTests(); + + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4014 Database config files file I/O error simulation test")); + DoDbCfgFileIOFailuresTests(); + + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4015 Database config files performance test")); + DoDbCfgPerfTests(); + + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4030 Database config files - supported SQl statements test")); + DoIsStatementSupportedTests(); + + TheTest.Next(_L("'Long database name' tests")); + DoLongDbNameTest(); + } + #endif //SYSLIBS_TEST TInt E32Main() @@ -1605,36 +1314,13 @@ __UHEAP_MARK; #ifdef SYSLIBS_TEST - TheTest.Start(_L("t_sqldbconfigfile tests")); - - // Set up the test environment + TheTest.Start(_L("Setting up the test environment")); SetupTestEnv(); - //Init sqlite library sqlite3SymbianLibInit(); - - // Do tests for database config files - DoDbCfgTests(); - - // Do OOM tests for database config files - DoDbCfgOOMTests(); - - // Do file I/O failure tests for database config files - DoDbCfgFileIOFailuresTests(); - - // Do performance tests for database config files - DoDbCfgPerfTests(); - - // Test IsStatementSupportedLC function - DoIsStatementSupportedTests(); - - //Test with a very long database file (and config file) name - DoLongDbNameTest(); - - // Destroy the test environment + DoTests(); DestroyTestEnv(); sqlite3SymbianLibFinalize(); CloseSTDLIB(); - TheTest.End(); #else TheTest.Start(_L("This test works only if the whole SQL component is built with SYSLIBS_TEST macro defined!")); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqldefect.cpp --- a/persistentstorage/sql/TEST/t_sqldefect.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqldefect.cpp Mon May 03 14:09:14 2010 +0300 @@ -9,6 +9,7 @@ // Nokia Corporation - initial contribution. // // Contributors: +// NTT DOCOMO, INC - Fix for Bug 1915 "SQL server panics when using long column type strings" // // Description: // @@ -1632,6 +1633,49 @@ TheDb.Close(); } +/** +Test defect where calling RSQLStatement::DeclaredColumnType() on a table which contains long (> 20 characters) column type names results in a USER 11 panic. +This test should pass because these are valid SQL column types +*/ +void LongColumnTypeTest() + { + (void)RSqlDatabase::Delete(KTestDatabase3); + TInt err = TheDb.Create(KTestDatabase3); + TEST2(err, KErrNone); + + _LIT8(KCreateStmt, "CREATE TABLE t(a CHARACTER VARYING(100000), b NCHAR VARYING(100000), c NATIONAL CHARACTER(100000), d NATIONAL CHARACTER VARYING(100000))"); + err = TheDb.Exec(KCreateStmt); + TEST(err >= 0); + + //Select all columns (SELECT *) + _LIT(KSelectStmt, "SELECT * FROM t"); + RSqlStatement stmt; + err = stmt.Prepare(TheDb, KSelectStmt); + TEST2(err, KErrNone); + + TSqlColumnType colType; + err = stmt.DeclaredColumnType(0, colType); + TEST2(err,KErrNone); + TEST2(colType, ESqlText); + + err = stmt.DeclaredColumnType(1, colType); + TEST2(err,KErrNone); + TEST2(colType, ESqlText); + + err = stmt.DeclaredColumnType(2, colType); + TEST2(err,KErrNone); + TEST2(colType, ESqlText); + + err = stmt.DeclaredColumnType(3, colType); + TEST2(err,KErrNone); + TEST2(colType, ESqlText); + + stmt.Close(); + + TheDb.Close(); + (void)RSqlDatabase::Delete(KTestDatabase3); + } + void DoTestsL() { TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1763 \"SQL against a detached db\" test ")); @@ -1642,7 +1686,7 @@ TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4035 Attempt to attach a file which name cannot be parsed")); AttachBadDbFileNameTest(); - + TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-SQL-UT-4036 Attempt to attach a secure database. The client cannot pass the security checks")); AttachSecureDbTest(); @@ -1717,6 +1761,10 @@ TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-CT-4166 DEF144027: SQL Open returns error if the reported and actual file size are different")); DEF144027(); + + TheTest.Next(_L("RSQLStatement::DeclaredColumnType() causes USER 11 panic when table contains long column type strings")); + LongColumnTypeTest(); + } TInt E32Main() diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqloom.h --- a/persistentstorage/sql/TEST/t_sqloom.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqloom.h Mon May 03 14:09:14 2010 +0300 @@ -121,7 +121,7 @@ typedef void (*TStmtFuncPtr2L)(RSqlStatement& aStmt); typedef void (*TScalarFullSelectFuncPtrL)(RSqlDatabase& aDb); typedef void (*TBlobPrepareFuncPtrL)(RSqlDatabase& aDb); -typedef void (*TBlobTestFuncPtrL)(RSqlDatabase& aDb, const TDesC& aAttachDbName = KNullDesC); +typedef void (*TBlobTestFuncPtrL)(RSqlDatabase& aDb, const TDesC& aAttachDbName); void CreateTestSecurityPolicy(RSqlSecurityPolicy& aSecurityPolicy); void CreateAttachDb(); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqloom2.cpp --- a/persistentstorage/sql/TEST/t_sqloom2.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqloom2.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -261,7 +261,7 @@ err = KErrNoMemory; const TInt KMaxAllocation = TheOomTestType[i] == EServerSideTest ? KStmtOomTestAllocLimitServer : KStmtOomTestAllocLimitClient; TInt allocationNo = 0; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set KMaxAllocation times. while(allocationNo < KMaxAllocation) { MarkHandles(); @@ -726,7 +726,7 @@ err = KErrNoMemory; const TInt KMaxAllocation = TheOomTestType[i] == EServerSideTest ? KStmtOomTestAllocLimitServer : KStmtOomTestAllocLimitClient; TInt allocationNo = 0; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set KMaxAllocation times. while(allocationNo < KMaxAllocation) { MarkHandles(); @@ -795,7 +795,7 @@ } //"RSqlBlobReadStream::OpenL()/RSqlBlobReadStream::ReadL()" OOM test -void BlobReadStreamOpenL(RSqlDatabase& aDb, const TDesC& aAttachDbName = KNullDesC) +void BlobReadStreamOpenL(RSqlDatabase& aDb, const TDesC& aAttachDbName) { RSqlBlobReadStream strm; CleanupClosePushL(strm); @@ -822,7 +822,7 @@ } //"RSqlBlobReadStream::OpenL()/RSqlBlobReadStream::SizeL()" OOM test -void BlobReadStreamSizeL(RSqlDatabase& aDb, const TDesC& aAttachDbName = KNullDesC) +void BlobReadStreamSizeL(RSqlDatabase& aDb, const TDesC& aAttachDbName) { RSqlBlobReadStream strm; CleanupClosePushL(strm); @@ -840,7 +840,7 @@ } //"RSqlBlobWriteStream::OpenL()/RSqlBlobWriteStream::WriteL()" OOM test -void BlobWriteStreamOpenL(RSqlDatabase& aDb, const TDesC& aAttachDbName = KNullDesC) +void BlobWriteStreamOpenL(RSqlDatabase& aDb, const TDesC& aAttachDbName) { RSqlBlobWriteStream strm; CleanupClosePushL(strm); @@ -864,7 +864,7 @@ } //"RSqlBlobWriteStream::OpenL()/RSqlBlobWriteStream::SizeL()" OOM test -void BlobWriteStreamSizeL(RSqlDatabase& aDb, const TDesC& aAttachDbName = KNullDesC) +void BlobWriteStreamSizeL(RSqlDatabase& aDb, const TDesC& aAttachDbName) { RSqlBlobWriteStream strm; CleanupClosePushL(strm); @@ -882,7 +882,7 @@ } //"TSqlBlob::GetLC()" OOM test -void BlobWholeGet1L(RSqlDatabase& aDb, const TDesC& aAttachDbName = KNullDesC) +void BlobWholeGet1L(RSqlDatabase& aDb, const TDesC& aAttachDbName) { HBufC8* buf = NULL; if(aAttachDbName.Length() > 0) @@ -898,7 +898,7 @@ } //"TSqlBlob::Get()" OOM test -void BlobWholeGet2L(RSqlDatabase& aDb, const TDesC& aAttachDbName = KNullDesC) +void BlobWholeGet2L(RSqlDatabase& aDb, const TDesC& aAttachDbName) { if(aAttachDbName.Length() > 0) { @@ -911,7 +911,7 @@ } //"TSqlBlob::SetL()" OOM test -void BlobWholeSetL(RSqlDatabase& aDb, const TDesC& aAttachDbName = KNullDesC) +void BlobWholeSetL(RSqlDatabase& aDb, const TDesC& aAttachDbName) { if(aAttachDbName.Length() > 0) { @@ -961,7 +961,7 @@ err = KErrNoMemory; const TInt KMaxAllocation = TheOomTestType[i] == EServerSideTest ? KBlobOomTestAllocLimitServer : KBlobOomTestAllocLimitClient; TInt allocationNo = 0; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set KMaxAllocation times. while(allocationNo < KMaxAllocation) { MarkHandles(); @@ -976,7 +976,7 @@ } else { - TRAP(err, (*aBlobTestFuncPtrL)(db)); + TRAP(err, (*aBlobTestFuncPtrL)(db, KNullDesC)); } ResetHeapFailure(TheOomTestType[i]); @@ -1151,7 +1151,7 @@ err = KErrNoMemory; const TInt KMaxAllocation = TheOomTestType[i] == EServerSideTest ? KStmtOomTestAllocLimitServer : KStmtOomTestAllocLimitClient; TInt allocationNo = 0; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set KMaxAllocation times. while(allocationNo < KMaxAllocation) { MarkHandles(); diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqloom3.cpp --- a/persistentstorage/sql/TEST/t_sqloom3.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqloom3.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -57,7 +57,7 @@ (void)RSqlDatabase::Delete(aDbFileName); } TInt err = KErrNone; - TInt failingAllocationNo = 0; + TInt failingAllocationNo = 0;//the real exit point of the OOM test. allocationNo is set maxAllocationNo times. TInt allocationNo = 0; TInt maxAllocationNo = TheOomTestType[i] == EServerSideTest ? KDoCreateDatabaseOomTestAllocLimitServer : KDoCreateDatabaseOomTestAllocLimitClient; while(allocationNo < maxAllocationNo) diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqloom5.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/persistentstorage/sql/TEST/t_sqloom5.cpp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,906 @@ +// Copyright (c) 2010 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: +// + +#include +#include +#include "SqlSrvMain.h" +#include "SqlSrvStartup.h" +#include "SqlSrvUtil.h" +#include "SqlSrvDatabase.h" +#include "SqlSrvFileData.h" + +/////////////////////////////////////////////////////////////////////////////////////// + +RTest TheTest(_L("t_sqloom5 test")); +RFs TheFs; + +_LIT(KTestDir, "c:\\test\\"); +_LIT(KDbFile, "c:\\test\\t_sqloom5.db"); +_LIT(KDbFile2, "c:[10281E17]t_sqloom5.db"); +_LIT(KDbFile3, "c:[10281E17]t_sqloom5_2.db"); +_LIT(KDbFile4, "c:[10281E17]t_sqloom5_3.db"); + +_LIT8(KConfig, "encoding=UTF-8"); + +extern CSqlServer* TheServer; + +static TInt TheProcessHandleCount = 0; +static TInt TheThreadHandleCount = 0; +static TInt TheAllocatedCellsCount = 0; + +#ifdef _DEBUG +static const TInt KBurstRate = 20; +#endif + +enum TSqlDbEncoding + { + ESqlDbUtf16, + ESqlDbUtf8 + }; + +/////////////////////////////////////////////////////////////////////////////////////// + +void DestroyTestEnv() + { + (void)TheFs.Delete(KDbFile4); + (void)TheFs.Delete(KDbFile3); + (void)TheFs.Delete(KDbFile2); + (void)TheFs.Delete(KDbFile); + TheFs.Close(); + } + +/////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////// +//Test macros and functions +void Check(TInt aValue, TInt aLine) + { + if(!aValue) + { + DestroyTestEnv(); + RDebug::Print(_L("*** Expresssion evaluated to false\r\n")); + TheTest(EFalse, aLine); + } + } +void Check(TInt aValue, TInt aExpected, TInt aLine) + { + if(aValue != aExpected) + { + DestroyTestEnv(); + RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); + TheTest(EFalse, aLine); + } + } +#define TEST(arg) ::Check((arg), __LINE__) +#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static void MarkHandles() + { + RThread().HandleCount(TheProcessHandleCount, TheThreadHandleCount); + } + +static void MarkAllocatedCells() + { + TheAllocatedCellsCount = User::CountAllocCells(); + } + +static void CheckAllocatedCells() + { + TInt allocatedCellsCount = User::CountAllocCells(); + TEST2(allocatedCellsCount, TheAllocatedCellsCount); + } + +static void CheckHandles() + { + TInt endProcessHandleCount; + TInt endThreadHandleCount; + + RThread().HandleCount(endProcessHandleCount, endThreadHandleCount); + + TEST2(TheProcessHandleCount, endProcessHandleCount); + TEST2(TheThreadHandleCount, endThreadHandleCount); + } + +static void OomPreStep(TInt + #ifdef _DEBUG + aFailingAllocationNo + #endif + ) + { + MarkHandles(); + MarkAllocatedCells(); + __UHEAP_MARK; + __UHEAP_SETBURSTFAIL(RAllocator::EBurstFailNext, aFailingAllocationNo, KBurstRate); + } + +static void OomPostStep() + { + __UHEAP_RESET; + __UHEAP_MARKEND; + CheckAllocatedCells(); + CheckHandles(); + } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CreateTestEnv() + { + TInt err = TheFs.Connect(); + TEST2(err, KErrNone); + + err = TheFs.MkDir(KTestDir); + TEST(err == KErrNone || err == KErrAlreadyExists); + + err = TheFs.CreatePrivatePath(EDriveC); + TEST(err == KErrNone || err == KErrAlreadyExists); + } + +static CSqlServer* CreateSqlServerL() + { + CSqlServer* server = CSqlServer::NewLC(); + CleanupStack::Pop(server); + return server; + } + +void CreateDatabaseOomTest(TSqlDbEncoding aEncoding) + { + (void)TheFs.Delete(KDbFile); + TInt failingAllocationNo = 0; + TheTest.Printf(_L("Iteration:\r\n")); + + TheServer = NULL; + TRAPD(err, TheServer = CreateSqlServerL()); + TEST2(err, KErrNone); + + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + TSqlSrvFileData& fdata = TheServer->FileData(); + RMessage2 msg; + TRAP(err, fdata.SetL(msg, KDbFile().Length(), 0, KDbFile, aEncoding == ESqlDbUtf8 ? &KConfig : NULL)); + if(err == KErrNone) + { + CSqlSrvDatabase* db = NULL; + TRAP(err, db = CSqlSrvDatabase::CreateL(fdata)); + delete db; + } + OomPostStep(); + } + + delete TheServer; + TheServer = NULL; + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===CSqlSrvDatabase::CreateL() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4167 +@SYMTestCaseDesc CSqlSrvDatabase::CreateL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::CreateL() in an OOM loop. + UTF16 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144577 +*/ +void Utf16CreateDatabaseOomTest() + { + CreateDatabaseOomTest(ESqlDbUtf16); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4182 +@SYMTestCaseDesc CSqlSrvDatabase::CreateL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::CreateL() in an OOM loop. + UTF8 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145047 +*/ +void Utf8CreateDatabaseOomTest() + { + CreateDatabaseOomTest(ESqlDbUtf8); + } + +void OpenDatabaseOomTest() + { + //The database is created by the previous test: CreateDatabaseOomTest(). + + TInt failingAllocationNo = 0; + TheTest.Printf(_L("Iteration:\r\n")); + + TheServer = NULL; + TRAPD(err, TheServer = CreateSqlServerL()); + TEST2(err, KErrNone); + + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + TSqlSrvFileData& fdata = TheServer->FileData(); + RMessage2 msg; + TRAP(err, fdata.SetL(msg, KDbFile().Length(), 0, KDbFile)); + if(err == KErrNone) + { + CSqlSrvDatabase* db = NULL; + TRAP(err, db = CSqlSrvDatabase::OpenL(fdata)); + delete db; + } + + OomPostStep(); + } + + delete TheServer; + TheServer = NULL; + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===CSqlSrvDatabase::OpenL() [non-secure db] OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4168 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() OOM test - non-secure database. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() in an OOM loop. + UTF16 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144577 +*/ +void Utf16OpenDatabaseOomTest() + { + OpenDatabaseOomTest(); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4183 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() OOM test - non-secure database. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() in an OOM loop. + UTF8 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145047 +*/ +void Utf8OpenDatabaseOomTest() + { + OpenDatabaseOomTest(); + } + +void CreateSecureDatabaseOomTest(TSqlDbEncoding aEncoding) + { + (void)TheFs.Delete(KDbFile2); + TInt failingAllocationNo = 0; + TheTest.Printf(_L("Iteration:\r\n")); + + TheServer = NULL; + TRAPD(err, TheServer = CreateSqlServerL()); + TEST2(err, KErrNone); + + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + TSqlSrvFileData& fdata = TheServer->FileData(); + RMessage2 msg; + TRAP(err, fdata.SetL(msg, KDbFile2().Length(), 0, KDbFile2, aEncoding == ESqlDbUtf8 ? &KConfig : NULL)); + if(err == KErrNone) + { + TSecurityPolicy defaultPolicy(TSecurityPolicy::EAlwaysPass); + CSqlSecurityPolicy* policy = NULL; + TRAP(err, policy = CSqlSecurityPolicy::NewL(defaultPolicy)); + if(err == KErrNone) + { + CSqlSrvDatabase* db = NULL; + TRAP(err, db = CSqlSrvDatabase::CreateSecureL(fdata, policy)); + delete db; + } + } + OomPostStep(); + } + + delete TheServer; + TheServer = NULL; + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===CSqlSrvDatabase::CreateSecureL() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4169 +@SYMTestCaseDesc CSqlSrvDatabase::CreateSecureL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::CreateSecureL() in an OOM loop. + UTF16 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144577 +*/ +void Utf16CreateSecureDatabaseOomTest() + { + CreateSecureDatabaseOomTest(ESqlDbUtf16); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4184 +@SYMTestCaseDesc CSqlSrvDatabase::CreateSecureL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::CreateSecureL() in an OOM loop. + UTF8 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145047 +*/ +void Utf8CreateSecureDatabaseOomTest() + { + CreateSecureDatabaseOomTest(ESqlDbUtf8); + } + +void OpenSecureDatabaseOomTest() + { + //The database is created by the previous test: CreateSecureDatabaseOomTest(). + + TInt failingAllocationNo = 0; + TheTest.Printf(_L("Iteration:\r\n")); + + TheServer = NULL; + TRAPD(err, TheServer = CreateSqlServerL()); + TEST2(err, KErrNone); + + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + TSqlSrvFileData& fdata = TheServer->FileData(); + RMessage2 msg; + TRAP(err, fdata.SetL(msg, KDbFile2().Length(), 0, KDbFile2)); + if(err == KErrNone) + { + CSqlSrvDatabase* db = NULL; + TRAP(err, db = CSqlSrvDatabase::OpenL(fdata)); + delete db; + } + + OomPostStep(); + } + + delete TheServer; + TheServer = NULL; + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===CSqlSrvDatabase::OpenL() [secure db] OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4170 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() OOM test - secure database. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() in an OOM loop. + UTF16 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144577, PDEF44845 +*/ +void Utf16OpenSecureDatabaseOomTest() + { + OpenSecureDatabaseOomTest(); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4185 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() OOM test - secure database. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() in an OOM loop. + UTF8 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145047 +*/ +void Utf8OpenSecureDatabaseOomTest() + { + OpenSecureDatabaseOomTest(); + } + +///////////////////////////////////////////////////////////// + +const TInt KDbConnCount = 7; +#ifdef _DEBUG +const TInt KDbAttachedCount = 10; +#endif +TBuf<10> TheAttachedDbName; + +//Declares KDbConnCount "CSqlSrvDatabase*" variables. +#define TEST_DECLARE_DB_VARS() \ + CSqlSrvDatabase* db[KDbConnCount]; \ + Mem::FillZ(db, sizeof(db)); + +//Declares all KDbConnCount "CSqlSrvDatabase*" objects. +#define TEST_DELETE_DB() \ + for(TInt i=0;i 0 && N <= KDbConnCount, User::Invariant()); \ + TRAP(err, fdata.SetL(msg, dbFile.Length(), 0, dbFile)); \ + if(err != KErrNone) \ + { \ + goto Cleanup; \ + } \ + db[N - 1] = NULL; \ + TRAP(err, db[N - 1] = CSqlSrvDatabase::OpenL(fdata)); \ + if(err != KErrNone) \ + { \ + goto Cleanup; \ + } + +//Attaches the "dbFile" database to the database number specified by the first macro parameter. +//The attached database name is "A", where M is the third macro parameter. +//N is the number of the database connection, between 1 and KDbConnCount. +//M is the number of the database to be attached, between 1 and KDbAttachedCount. +#define TEST_ATTACH_DB(N, dbFile, M) \ + __ASSERT_DEBUG(N > 0 && N <= KDbConnCount, User::Invariant()); \ + __ASSERT_DEBUG(M > 0 && M <= KDbAttachedCount, User::Invariant()); \ + TRAP(err, fdata.SetL(msg, dbFile.Length(), 0, dbFile)); \ + if(err != KErrNone) \ + { \ + goto Cleanup; \ + } \ + TheAttachedDbName.Copy(_L("A")); \ + TheAttachedDbName.AppendNum(M); \ + TRAP(err, db[N - 1]->AttachDbL(fdata, TheAttachedDbName)); \ + if(err != KErrNone) \ + { \ + goto Cleanup; \ + } + +//Detaches database "A" (M is the second macro parameter) from the database identified +//by the number N - the first macro parameter. +//N is the number of the database connection, between 1 and KDbConnCount. +//M is the number of the database to be detached, between 1 and KDbAttachedCount. +#define TEST_DETACH_DB(N, M) \ + __ASSERT_DEBUG(N > 0 && N <= KDbConnCount, User::Invariant()); \ + __ASSERT_DEBUG(M > 0 && M <= KDbAttachedCount, User::Invariant()); \ + if(db[N - 1]) \ + { \ + TheAttachedDbName.Copy(_L("A")); \ + TheAttachedDbName.AppendNum(M); \ + TRAP_IGNORE(db[N - 1]->DetachDbL(TheAttachedDbName)); \ + } + +///////////////////////////////////////////////////////////// + +void CreateSecureTestDb(const TDesC& aDbFile, TSqlDbEncoding aEncoding) + { + (void)TheFs.Delete(aDbFile); + + TSecurityPolicy defaultPolicy(TSecurityPolicy::EAlwaysPass); + CSqlSecurityPolicy* policy = NULL; + TRAPD(err, policy = CSqlSecurityPolicy::NewL(defaultPolicy)); + TEST2(err, KErrNone); + + TSqlSrvFileData& fdata = TheServer->FileData(); + RMessage2 msg; + TRAP(err, fdata.SetL(msg, aDbFile.Length(), 0, aDbFile, aEncoding == ESqlDbUtf8 ? &KConfig : NULL)); + + CSqlSrvDatabase* db = NULL; + TRAP(err, db = CSqlSrvDatabase::CreateSecureL(fdata, policy)); + delete db; + TEST2(err, KErrNone); + } + +void OpenAttachDatabaseOomTest(TSqlDbEncoding aEncoding) + { + //Part of the databases are created by the previous tests. + + TInt failingAllocationNo = 0; + TheTest.Printf(_L("Iteration:\r\n")); + + TheServer = NULL; + TRAPD(err, TheServer = CreateSqlServerL()); + TEST2(err, KErrNone); + + CreateSecureTestDb(KDbFile3, aEncoding); + CreateSecureTestDb(KDbFile4, aEncoding); + + //The following 2 declarations are used by the macros in the OOM loop + RMessage2 msg; + TSqlSrvFileData& fdata = TheServer->FileData(); + + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + //Declare KDbConnCount "CSqlSrvDatabase*" variables. + TEST_DECLARE_DB_VARS(); + //Create CSqlSrvDatabase object, the database name is the second parameter of the macro. + //The related db[N - 1] variable will be set to point to the created object. + TEST_OPEN_DB(1, KDbFile2()); + TEST_OPEN_DB(2, KDbFile2()); + TEST_OPEN_DB(3, KDbFile3()); + TEST_OPEN_DB(4, KDbFile3()); + TEST_OPEN_DB(5, KDbFile3()); + TEST_OPEN_DB(6, KDbFile()); + TEST_OPEN_DB(7, KDbFile()); + //Attach to the database with the number specified as first macro parameter, the database file, specified + //as second macro parameter. The logical name of the attached database is "A", where M is the third macro parameter. + TEST_ATTACH_DB(1, KDbFile(), 1); + TEST_ATTACH_DB(2, KDbFile(), 2); + TEST_ATTACH_DB(2, KDbFile(), 3); + TEST_ATTACH_DB(5, KDbFile4(), 4); + TEST_ATTACH_DB(2, KDbFile4(), 5); + TEST_ATTACH_DB(2, KDbFile4(), 6); + TEST_ATTACH_DB(5, KDbFile4(), 7); + TEST_ATTACH_DB(5, KDbFile4(), 8); + TEST_ATTACH_DB(1, KDbFile4(), 9); + TEST_ATTACH_DB(1, KDbFile(), 10); +Cleanup: + __UHEAP_SETBURSTFAIL(RAllocator::ENone, 0, 0); + //Detach from the database with the number specified as first macro parameter, the database + //with name "A", where M is the second macro parameter. + TEST_DETACH_DB(1, 9); + TEST_DETACH_DB(1, 1); + TEST_DETACH_DB(1, 10); + TEST_DETACH_DB(2, 2); + TEST_DETACH_DB(2, 3); + TEST_DETACH_DB(2, 5); + TEST_DETACH_DB(2, 6); + TEST_DETACH_DB(5, 4); + TEST_DETACH_DB(5, 7); + TEST_DETACH_DB(5, 8); + //Delete all created CSqlSrvDatabase objects. + TEST_DELETE_DB(); + + OomPostStep(); + } + + delete TheServer; + TheServer = NULL; + + (void)TheFs.Delete(KDbFile4); + (void)TheFs.Delete(KDbFile3); + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4171 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() and CSqlSrvDatabase::AttachDbL() in an OOM test. + The test is a complex one - 7 (KDbConnCount constant) databases opened + (secure and non-secure), 10 (KDbAttachedCount constant) databases + attached (secure and non-secure). + UTF16 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144577, DEF144603 +*/ +void Utf16OpenAttachDatabaseOomTest() + { + OpenAttachDatabaseOomTest(ESqlDbUtf16); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4186 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() and CSqlSrvDatabase::AttachDbL() in an OOM test. + The test is a complex one - 7 (KDbConnCount constant) databases opened + (secure and non-secure), 10 (KDbAttachedCount constant) databases + attached (secure and non-secure). + UTF8 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF???? +*/ +void Utf8OpenAttachDatabaseOomTest() + { + OpenAttachDatabaseOomTest(ESqlDbUtf8); + } + +void OpenAttachDatabaseOomTest2(TSqlDbEncoding aEncoding) + { + TheServer = NULL; + TRAPD(err, TheServer = CreateSqlServerL()); + TEST2(err, KErrNone); + + CreateSecureTestDb(KDbFile3, aEncoding); + CreateSecureTestDb(KDbFile4, aEncoding); + + TInt failingAllocationNo = 0; + TheTest.Printf(_L("Iteration:\r\n")); + + RMessage2 msg; + TSqlSrvFileData& fdata = TheServer->FileData(); + + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + TRAP(err, fdata.SetL(msg, KDbFile3().Length(), 0, KDbFile3)); + if(err == KErrNone) + { + CSqlSrvDatabase* db = NULL; + TRAP(err, db = CSqlSrvDatabase::OpenL(fdata)); + if(err == KErrNone) + { + TRAP(err, fdata.SetL(msg, KDbFile4().Length(), 0, KDbFile4)); + if(err == KErrNone) + { + TRAP(err, db->AttachDbL(fdata, _L("db2"))); + if(err == KErrNone) + { + TRAP(err, db->DetachDbL(_L("db2"))); + } + } + delete db; + } + } + OomPostStep(); + } + + (void)TheFs.Delete(KDbFile4); + (void)TheFs.Delete(KDbFile3); + + delete TheServer; + TheServer = NULL; + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM test 2 succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4172 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() and CSqlSrvDatabase::AttachDbL() in an OOM test. + Two secure databases are created and then, in an OOM loop, the test executes this sequence of + commands: open first database, attach the second database, detach the attached database, + close the first database. + UTF16 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144577, PDEF44845 +*/ +void Utf16OpenAttachDatabaseOomTest2() + { + OpenAttachDatabaseOomTest2(ESqlDbUtf16); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4187 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() and CSqlSrvDatabase::AttachDbL() in an OOM test. + Two secure databases are created and then, in an OOM loop, the test executes this sequence of + commands: open first database, attach the second database, detach the attached database, + close the first database. + UTF8 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145047 +*/ +void Utf8OpenAttachDatabaseOomTest2() + { + OpenAttachDatabaseOomTest2(ESqlDbUtf8); + } + +void OpenCreateDatabaseOomTest(TSqlDbEncoding aEncoding) + { + TheServer = NULL; + TRAPD(err, TheServer = CreateSqlServerL()); + TEST2(err, KErrNone); + + (void)TheFs.Delete(KDbFile2); + CreateSecureTestDb(KDbFile2, aEncoding); + + TheTest.Printf(_L("Iteration:\r\n")); + + //Open the database + TInt failingAllocationNo = 0; + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + RMessage2 msg; + TSqlSrvFileData& fdata = TheServer->FileData(); + TRAP(err, fdata.SetL(msg, KDbFile2().Length(), 0, KDbFile2)); + if(err == KErrNone) + { + CSqlSrvDatabase* db = NULL; + TRAP(err, db = CSqlSrvDatabase::OpenL(fdata)); + if(err == KErrNone) + { + delete db; + } + else + { + TEST(!db); + } + } + OomPostStep(); + } + TEST2(err, KErrNone); + err = TheFs.Delete(KDbFile2); + TEST2(err, KErrNone); + //Create the database + TInt failingAllocationNo2 = 0; + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo2); + OomPreStep(failingAllocationNo2); + RMessage2 msg; + TSqlSrvFileData& fdata = TheServer->FileData(); + TRAP(err, fdata.SetL(msg, KDbFile2().Length(), 0, KDbFile2, aEncoding == ESqlDbUtf8 ? &KConfig : NULL)); + if(err == KErrNone) + { + TSecurityPolicy defaultPolicy(TSecurityPolicy::EAlwaysPass); + CSqlSecurityPolicy* policy = NULL; + TRAP(err, policy = CSqlSecurityPolicy::NewL(defaultPolicy)); + if(err == KErrNone) + { + CSqlSrvDatabase* db = NULL; + TRAP(err, db = CSqlSrvDatabase::CreateSecureL(fdata, policy)); + if(err == KErrNone) + { + delete db; + } + else + { + TEST(!db); + } + } + } + OomPostStep(); + } + + (void)TheFs.Delete(KDbFile2); + + delete TheServer; + TheServer = NULL; + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::CreateSecureL() OOM test succeeded at heap failure rate of %d ===\r\n"), + failingAllocationNo + failingAllocationNo2); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4173 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::CreateSecureL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() and CSqlSrvDatabase::CreateSecureL() in an OOM test. + The test creates a secure database then executes CSqlSrvDatabase::OpenL() in an OOM loop. + After that the database is deleted and the test executes CSqlSrvDatabase::CreateSecureL() in an OOM loop. + The purpose of the test is to check that the CSqlSrver maps are properly updated when + the database is closed. + UTF16 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144577, PDEF44845 +*/ +void Utf16OpenCreateDatabaseOomTest() + { + OpenCreateDatabaseOomTest(ESqlDbUtf16); + } + +/** +@SYMTestCaseID PDS-SQL-UT-4188 +@SYMTestCaseDesc CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::CreateSecureL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs CSqlSrvDatabase::OpenL() and CSqlSrvDatabase::CreateSecureL() in an OOM test. + The test creates a secure database then executes CSqlSrvDatabase::OpenL() in an OOM loop. + After that the database is deleted and the test executes CSqlSrvDatabase::CreateSecureL() in an OOM loop. + The purpose of the test is to check that the CSqlSrver maps are properly updated when + the database is closed. + UTF8 encoded database is used. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145047 +*/ +void Utf8OpenCreateDatabaseOomTest() + { + OpenCreateDatabaseOomTest(ESqlDbUtf8); + } + +void DoTests() + { +#ifndef _DEBUG + TheTest.Start(_L("This test can be run only in debug mode!")); +#else + CActiveScheduler* scheduler = new CActiveScheduler; + TEST(scheduler != NULL); + CActiveScheduler::Install(scheduler); + + TheTest.Start(_L(" @SYMTestCaseID:PDS-SQL-UT-4167 CSqlSrvDatabase::CreateL() OOM unit test")); + Utf16CreateDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4168 CSqlSrvDatabase::OpenL() OOM unit test - non-secure database")); + Utf16OpenDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4169 CSqlSrvDatabase::CreateSecureL() OOM unit test")); + Utf16CreateSecureDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4170 CSqlSrvDatabase::OpenL() OOM unit test - secure database")); + Utf16OpenSecureDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4171 CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM unit test")); + Utf16OpenAttachDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4172 CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM unit test - 2")); + Utf16OpenAttachDatabaseOomTest2(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4173 CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::CreateL() OOM unit test")); + Utf16OpenCreateDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4182 CSqlSrvDatabase::CreateL() OOM unit test, UTF8 database")); + Utf8CreateDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4183 CSqlSrvDatabase::OpenL() OOM unit test - non-secure UTF8 database")); + Utf8OpenDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4184 CSqlSrvDatabase::CreateSecureL() OOM unit test, UTF8 database")); + Utf8CreateSecureDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4185 CSqlSrvDatabase::OpenL() OOM unit test - secure UTF8 database")); + Utf8OpenSecureDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4186 CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM unit test, UTF8 database")); + Utf8OpenAttachDatabaseOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4187 CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM unit test 2, UTF8 database")); + Utf8OpenAttachDatabaseOomTest2(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4188 CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::CreateL() OOM unit test, UTF8 database")); + Utf8OpenCreateDatabaseOomTest(); + + delete scheduler; +#endif //_DEBUG + } + +TInt E32Main() + { + TheTest.Title(); + + CTrapCleanup* tc = CTrapCleanup::New(); + TheTest(tc != NULL); + + __UHEAP_MARK; + + CreateTestEnv(); + DoTests(); + DestroyTestEnv(); + + __UHEAP_MARKEND; + + TheTest.End(); + TheTest.Close(); + + delete tc; + + User::Heap().Check(); + return KErrNone; + } diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqloom6.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/persistentstorage/sql/TEST/t_sqloom6.cpp Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,733 @@ +// Copyright (c) 2010 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: +// + +#include +#include +#include +#include +#include +#include +#include "SqlResourceTester.h" //TSqlResourceTester +#include "sqlite3.h" +#include "SqliteSymbian.h" + +//In order to be able to compile the test, the following variables are defined (used inside the OS porting layer, +//when _SQLPROFILER macro is defined) +#ifdef _SQLPROFILER +TInt TheSqlSrvProfilerFileRead = 0; +TInt TheSqlSrvProfilerFileWrite = 0; +TInt TheSqlSrvProfilerFileSync = 0; +TInt TheSqlSrvProfilerFileSetSize = 0; +#endif + +/////////////////////////////////////////////////////////////////////////////////////// + +RTest TheTest(_L("t_sqloom6 test")); + +_LIT(KTestDir, "c:\\test\\"); +_LIT(KDbFile, "c:\\test\\t_sqloom6.db"); + +static RSqlDatabase TheDb; +static RSqlStatement TheStmt; + +static TInt TheProcessHandleCount = 0; +static TInt TheThreadHandleCount = 0; +static TInt TheAllocatedCellsCount = 0; + +/////////////////////////////////////////////////////////////////////////////////////// + +void DestroyTestEnv() + { + TheStmt.Close(); + TheDb.Close(); + (void)RSqlDatabase::Delete(KDbFile); + sqlite3SymbianLibFinalize(); + CloseSTDLIB(); + } + +/////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////// +//Test macros and functions +void Check(TInt aValue, TInt aLine) + { + if(!aValue) + { + DestroyTestEnv(); + RDebug::Print(_L("*** Expresssion evaluated to false\r\n")); + TheTest(EFalse, aLine); + } + } +void Check(TInt aValue, TInt aExpected, TInt aLine) + { + if(aValue != aExpected) + { + DestroyTestEnv(); + RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); + TheTest(EFalse, aLine); + } + } +#define TEST(arg) ::Check((arg), __LINE__) +#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static void MarkHandles() + { + RThread().HandleCount(TheProcessHandleCount, TheThreadHandleCount); + } + +static void MarkAllocatedCells() + { + TheAllocatedCellsCount = User::CountAllocCells(); + } + +static void CheckAllocatedCells() + { + TInt allocatedCellsCount = User::CountAllocCells(); + TEST2(allocatedCellsCount, TheAllocatedCellsCount); + } + +static void CheckHandles() + { + TInt endProcessHandleCount; + TInt endThreadHandleCount; + + RThread().HandleCount(endProcessHandleCount, endThreadHandleCount); + + TEST2(TheProcessHandleCount, endProcessHandleCount); + TEST2(TheThreadHandleCount, endThreadHandleCount); + } + +static void OomPreStep(TInt aFailingAllocationNo) + { + MarkHandles(); + MarkAllocatedCells(); + __UHEAP_MARK; + TSqlResourceTester::Mark(); + TSqlResourceTester::SetHeapFailure(RHeap::EBurstFailNext, aFailingAllocationNo); + } + +static void OomPostStep() + { + __UHEAP_RESET; + TSqlResourceTester::SetHeapFailure(RHeap::ENone, 0); + TSqlResourceTester::Check(); + CheckAllocatedCells(); + CheckHandles(); + } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CreateTestEnv() + { + RFs fs; + TInt err = fs.Connect(); + TEST2(err, KErrNone); + + err = fs.MkDir(KTestDir); + TEST(err == KErrNone || err == KErrAlreadyExists); + + err = fs.CreatePrivatePath(EDriveC); + TEST(err == KErrNone || err == KErrAlreadyExists); + + fs.Close(); + + sqlite3SymbianLibInit(); + } + +//Creates a UTF8 encoded database with: +// - One table with three colums: A(ColumnName1234567890, Col2, Col3); +// - One record in the table with values: ('A1234567890', 'A12345', ''); +void CreateTestDb(const TDesC& aDbName) + { + TBuf8<100> dbName8; + dbName8.Copy(aDbName); + sqlite3* db = 0; + int rc = sqlite3_open((const char*)dbName8.PtrZ(), &db); + TEST2(rc, SQLITE_OK); + rc = sqlite3_exec(db, "CREATE TABLE A(ColumnName1234567890 TEXT, Col2 LONG TEXT, Col3 SMALL TEXT)", 0, 0, 0); + TEST2(rc, SQLITE_OK); + rc = sqlite3_exec(db, "INSERT INTO A VALUES('A1234567890', 'A12345', '')", 0, 0, 0); + TEST2(rc, SQLITE_OK); + sqlite3_close(db); + } + +/** +@SYMTestCaseID PDS-SQL-CT-4176 +@SYMTestCaseDesc RSqlStatement::ColumnName() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs RSqlStatement::ColumnName() in an OOM simulation loop. + The difference betwee this test case and the similar test case in t_sqloom2 is that here: + - burst OOM simulation is used; + - UTF8 encoded database is used; + - only SQL server side OOM simulation is performed; + The purpose of the test is to verify that the ColumnName() call behaves correctly + when the related sqlite3_column_name16() call performed by the SQL server fails + with "no memory". +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145033 +*/ +void ColumnNameOomTest() + { + //This is not really a full OOM test, because the SQL server counts only the number of active statement and + //stream objects, the allocated memory cells are not counted. + //The reason that the allocated memory cells are not counted, and in case of an OOM failure - checked, is + //because the SQL server can make some per-connection memory allocations (cache pages, etc.) + //and they will not be deallocated when the statement object is closed. + //But the result of the RSqlStatement::ColumnName() operation is checked. If there is a failed memory + //allocation on the server side, the returned column name can be NULL and that will be tested. + + (void)RSqlDatabase::Delete(KDbFile); + + TheTest.Printf(_L("Iteration:\r\n")); + + CreateTestDb(KDbFile);//Creates UTF8 encoded database with one table with one record. + + TInt err = TheDb.Open(KDbFile); + TEST2(err, KErrNone); + + TInt failingAllocationNo = 0; + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + err = TheStmt.Prepare(TheDb, _L("SELECT * FROM A")); + if(err != KErrNone) + { + goto LabelOomPostStep; + } + + TPtrC name; + err = TheStmt.ColumnName(0, name); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(name == _L("ColumnName1234567890")); + + err = TheStmt.ColumnName(1, name); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(name == _L("Col2")); + + err = TheStmt.ColumnName(2, name); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(name == _L("Col3")); + +LabelStmtClose: + TheStmt.Close(); + +LabelOomPostStep: + OomPostStep(); + } + + TheDb.Close(); + (void)RSqlDatabase::Delete(KDbFile); + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===RSqlStatement::ColumnName() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-CT-4177 +@SYMTestCaseDesc RSqlStatement::ParameterName() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs RSqlStatement::ParameterName() in an OOM simulation loop. + The difference betwee this test case and the similar test case in t_sqloom2 is that here: + - burst OOM simulation is used; + - UTF8 encoded database is used; + - only SQL server side OOM simulation is performed; + The purpose of the test is to verify that the ParameterName() call behaves correctly + if the related sqlite3_bind_parameter_name() call performed by the SQL server fails + with "no memory". +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145033 +*/ +void ParameterNameOomTest() + { + //This is not really a full OOM test, because the SQL server counts only the number of active statement and + //stream objects, the allocated memory cells are not counted. + //The reason that the allocated memory cells are not counted, and in case of an OOM failure - checked, is + //because the SQL server can make some per-connection memory allocations (cache pages, etc.) + //and they will not be deallocated when the statement object is closed. + //But the result of the RSqlStatement::ParameterName() operation is checked. If there is a failed memory + //allocation on the server side, the returned column name can be NULL and that will be tested. + + (void)RSqlDatabase::Delete(KDbFile); + + TheTest.Printf(_L("Iteration:\r\n")); + + CreateTestDb(KDbFile);//Creates UTF8 encoded database with one table with one record. + + TInt err = TheDb.Open(KDbFile); + TEST2(err, KErrNone); + + TInt failingAllocationNo = 0; + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + err = TheStmt.Prepare(TheDb, _L("SELECT * FROM A WHERE Col2 != :Prm1234567890 AND Col3 != :Prm2 AND ColumnName1234567890 != ?")); + if(err != KErrNone) + { + goto LabelOomPostStep; + } + + TPtrC name; + err = TheStmt.ParameterName(0, name); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(name == _L(":Prm1234567890")); + + err = TheStmt.ParameterName(1, name); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(name == _L(":Prm2")); + + err = TheStmt.ParameterName(2, name); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(name == _L("?2")); + +LabelStmtClose: + TheStmt.Close(); + +LabelOomPostStep: + OomPostStep(); + } + + TheDb.Close(); + (void)RSqlDatabase::Delete(KDbFile); + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===RSqlStatement::ColumnName() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-CT-4178 +@SYMTestCaseDesc RSqlStatement::ColumnText() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs RSqlStatement::ColumnText() in an OOM simulation loop. + The difference betwee this test case and the similar test case in t_sqloom2 is that here: + - burst OOM simulation is used; + - UTF8 encoded database is used; + - only SQL server side OOM simulation is performed; + The purpose of the test is to verify that the ColumnText() call behaves correctly + when the related sqlite3_column_text16() call performed by the SQL server fails + with "no memory" (or the sqlite3_column_bytes16() call). +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145033 +*/ +void ColumnTextOomTest() + { + //This is not really a full OOM test, because the SQL server counts only the number of active statement and + //stream objects, the allocated memory cells are not counted. + //The reason that the allocated memory cells are not counted, and in case of an OOM failure - checked, is + //because the SQL server can make some per-connection memory allocations (cache pages, etc.) + //and they will not be deallocated when the statement object is closed. + //But the result of the RSqlStatement::ColumnText() operation is checked. If there is a failed memory + //allocation on the server side, the returned column name can be NULL and that will be tested. + + (void)RSqlDatabase::Delete(KDbFile); + + TheTest.Printf(_L("Iteration:\r\n")); + + CreateTestDb(KDbFile);//Creates UTF8 encoded database with one table with one record. + + TInt err = TheDb.Open(KDbFile); + TEST2(err, KErrNone); + + TInt failingAllocationNo = 0; + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + err = TheStmt.Prepare(TheDb, _L("SELECT * FROM A")); + if(err != KErrNone) + { + goto LabelOomPostStep; + } + err = TheStmt.Next(); + if(err != KSqlAtRow) + { + goto LabelStmtClose; + } + + TPtrC data; + err = TheStmt.ColumnText(0, data); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(data == _L("A1234567890")); + + err = TheStmt.ColumnText(1, data); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(data == _L("A12345")); + + err = TheStmt.ColumnText(2, data); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST(data == _L("")); + +LabelStmtClose: + TheStmt.Close(); + +LabelOomPostStep: + OomPostStep(); + } + + TheDb.Close(); + (void)RSqlDatabase::Delete(KDbFile); + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===RSqlStatement::ColumnText() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-CT-4179 +@SYMTestCaseDesc RSqlColumnReadStream OOM test. +@SYMTestPriority High +@SYMTestActions The test runs RSqlColumnReadStream in an OOM simulation loop. + The difference betwee this test case and the similar test case in t_sqloom2 is that here: + - burst OOM simulation is used; + - UTF8 encoded database is used; + - only SQL server side OOM simulation is performed; + The purpose of the test is to verify that the RSqlColumnReadStream APIs behave correctly + when the related sqlite3_column_text16() call performed by the SQL server fails + with "no memory" (or the sqlite3_column_bytes16() call). +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145033 +*/ +void TextColumnReadStreamOomTest() + { + //This is not really a full OOM test, because the SQL server counts only the number of active statement and + //stream objects, the allocated memory cells are not counted. + //The reason that the allocated memory cells are not counted, and in case of an OOM failure - checked, is + //because the SQL server can make some per-connection memory allocations (cache pages, etc.) + //and they will not be deallocated when the statement object is closed. + //But the result of the RSqlColumnReadStream::ReadL() operation is checked. If there is a failed memory + //allocation on the server side, the returned column name can be NULL and that will be tested. + + (void)RSqlDatabase::Delete(KDbFile); + + TheTest.Printf(_L("Iteration:\r\n")); + + CreateTestDb(KDbFile);//Creates UTF8 encoded database with one table with one record. + + TInt err = TheDb.Open(KDbFile); + TEST2(err, KErrNone); + + TInt failingAllocationNo = 0; + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + err = TheStmt.Prepare(TheDb, _L("SELECT * FROM A")); + if(err != KErrNone) + { + goto LabelOomPostStep; + } + err = TheStmt.Next(); + if(err != KSqlAtRow) + { + goto LabelCloseStmt; + } + + RSqlColumnReadStream strm; + err = strm.ColumnText(TheStmt, 0); + if(err != KErrNone) + { + goto LabelCloseStmt; + } + TBuf<50> data; + TRAP(err, strm.ReadL(data, 11)); + strm.Close(); + if(err != KErrNone) + { + goto LabelCloseStmt; + } + TEST(data == _L("A1234567890")); + + err = strm.ColumnText(TheStmt, 1); + if(err != KErrNone) + { + goto LabelCloseStmt; + } + TRAP(err, strm.ReadL(data, 6)); + strm.Close(); + if(err != KErrNone) + { + goto LabelCloseStmt; + } + TEST(data == _L("A12345")); + + err = strm.ColumnText(TheStmt, 2); + if(err != KErrNone) + { + goto LabelCloseStmt; + } + TInt len = -1; + TRAP(err, len = strm.Source()->SizeL());//The column value is with 0 length + strm.Close(); + if(err != KErrNone) + { + goto LabelCloseStmt; + } + TEST2(len, 0); + +LabelCloseStmt: + TheStmt.Close(); + +LabelOomPostStep: + OomPostStep(); + } + + TheDb.Close(); + (void)RSqlDatabase::Delete(KDbFile); + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===RSqlColumnReadStream OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-CT-4180 +@SYMTestCaseDesc TSqlScalarFullSelectQuery::SelectTextL() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs TSqlScalarFullSelectQuery::SelectTextL() in an OOM simulation loop. + The difference betwee this test case and the similar test case in t_sqloom2 is that here: + - burst OOM simulation is used; + - UTF8 encoded database is used; + - only SQL server side OOM simulation is performed; + The purpose of the test is to verify that the SelectTextL() call behaves correctly + when the related sqlite3_column_text16() call performed by the SQL server fails + with "no memory" (or the sqlite3_column_bytes16() call). +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145033 +*/ +void ScalarColumnTextOomTest() + { + //This is not really a full OOM test, because the SQL server counts only the number of active statement and + //stream objects, the allocated memory cells are not counted. + //The reason that the allocated memory cells are not counted, and in case of an OOM failure - checked, is + //because the SQL server can make some per-connection memory allocations (cache pages, etc.) + //and they will not be deallocated when the statement object is closed. + //But the result of the TSqlScalarFullSelectQuery::SelectTextL() operation is checked. If there is a failed memory + //allocation on the server side, the returned column name can be NULL and that will be tested. + + (void)RSqlDatabase::Delete(KDbFile); + + TheTest.Printf(_L("Iteration:\r\n")); + + CreateTestDb(KDbFile);//Creates UTF8 encoded database with one table with one record. + + TInt err = TheDb.Open(KDbFile); + TEST2(err, KErrNone); + + TInt failingAllocationNo = 0; + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + TSqlScalarFullSelectQuery query(TheDb); + TBuf<50> data; + TRAP(err, query.SelectTextL(_L("SELECT ColumnName1234567890 FROM A"), data)); + if(err != KErrNone) + { + goto LabelOomPostStep; + } + TEST(data == _L("A1234567890")); + + TRAP(err, query.SelectTextL(_L("SELECT Col2 FROM A"), data)); + if(err != KErrNone) + { + goto LabelOomPostStep; + } + TEST(data == _L("A12345")); + + TRAP(err, query.SelectTextL(_L("SELECT Col3 FROM A"), data)); + if(err != KErrNone) + { + goto LabelOomPostStep; + } + TEST(data == _L("")); + +LabelOomPostStep: + OomPostStep(); + } + + TheDb.Close(); + (void)RSqlDatabase::Delete(KDbFile); + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===TSqlScalarFullSelectQuery::SelectTextL() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +/** +@SYMTestCaseID PDS-SQL-CT-4181 +@SYMTestCaseDesc RSqlStatement::DeclaredColumnType() OOM test. +@SYMTestPriority High +@SYMTestActions The test runs RSqlStatement::DeclaredColumnType() in an OOM simulation loop. + The difference betwee this test case and the similar test case in t_sqloom2 is that here: + - burst OOM simulation is used; + - UTF8 encoded database is used; + - only SQL server side OOM simulation is performed; + The purpose of the test is to verify that the DeclaredColumnType() call behaves correctly + when the related sqlite3_column_name16() call performed by the SQL server fails + with "no memory". +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF145033 +*/ +void DeclaredColumnTypeOomTest() + { + //This is not really a full OOM test, because the SQL server counts only the number of active statement and + //stream objects, the allocated memory cells are not counted. + //The reason that the allocated memory cells are not counted, and in case of an OOM failure - checked, is + //because the SQL server can make some per-connection memory allocations (cache pages, etc.) + //and they will not be deallocated when the statement object is closed. + //But the result of the RSqlStatement::DeclaredColumnType() operation is checked. If there is a failed memory + //allocation on the server side, the returned column name can be NULL and that will be tested. + + (void)RSqlDatabase::Delete(KDbFile); + + TheTest.Printf(_L("Iteration:\r\n")); + + CreateTestDb(KDbFile);//Creates UTF8 encoded database with one table with one record. + + TInt err = TheDb.Open(KDbFile); + TEST2(err, KErrNone); + + TInt failingAllocationNo = 0; + err = KErrNoMemory; + while(err == KErrNoMemory) + { + TheTest.Printf(_L(" %d"), ++failingAllocationNo); + OomPreStep(failingAllocationNo); + + err = TheStmt.Prepare(TheDb, _L("SELECT * FROM A")); + if(err != KErrNone) + { + goto LabelOomPostStep; + } + + TSqlColumnType colType = ESqlNull; + err = TheStmt.DeclaredColumnType(0, colType); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST2(colType, ESqlText); + + colType = ESqlNull; + err = TheStmt.DeclaredColumnType(1, colType); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST2(colType, ESqlText); + + colType = ESqlNull; + err = TheStmt.DeclaredColumnType(2, colType); + if(err != KErrNone) + { + goto LabelStmtClose; + } + TEST2(colType, ESqlText); + +LabelStmtClose: + TheStmt.Close(); + +LabelOomPostStep: + OomPostStep(); + } + + TheDb.Close(); + (void)RSqlDatabase::Delete(KDbFile); + + TEST2(err, KErrNone); + TheTest.Printf(_L("\r\n===RSqlStatement::DeclaredColumnType() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); + } + +void DoTests() + { + TheTest.Start(_L(" @SYMTestCaseID:PDS-SQL-CT-4176 RSqlStatement::ColumnName() OOM test")); + ColumnNameOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-CT-4177 RSqlStatement::ParameterName() OOM test")); + ParameterNameOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-CT-4178 RSqlStatement::ColumnText() OOM test")); + ColumnTextOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-CT-4179 RSqlColumnReadStream OOM test")); + TextColumnReadStreamOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-CT-4180 TSqlScalarFullSelectQuery::SelectTextL() OOM test")); + ScalarColumnTextOomTest(); + + TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-CT-4181 RSqlStatement::DeclaredColumnType() OOM test")); + DeclaredColumnTypeOomTest(); + } + +TInt E32Main() + { + TheTest.Title(); + + CTrapCleanup* tc = CTrapCleanup::New(); + TheTest(tc != NULL); + + __UHEAP_MARK; + + CreateTestEnv(); + DoTests(); + DestroyTestEnv(); + + __UHEAP_MARKEND; + + TheTest.End(); + TheTest.Close(); + + delete tc; + + User::Heap().Check(); + return KErrNone; + } diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/t_sqlstartup.cpp --- a/persistentstorage/sql/TEST/t_sqlstartup.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/t_sqlstartup.cpp Mon May 03 14:09:14 2010 +0300 @@ -19,10 +19,15 @@ #include "SqlSrvStartup.h" #include "SqlSrvUtil.h" +_LIT(KCfgDb1ConfigFilePath, "c:\\private\\10281e17\\cfg[10281E17]t_sqlstartup1.db.02"); // config file version 2 for t_sqlstartup1.db +_LIT(KCfgDb2ConfigFilePath, "c:\\private\\10281e17\\cfg[10281E17]t_sqlstartup2.db.05"); // config file version 5 for t_sqlstartup2.db + /////////////////////////////////////////////////////////////////////////////////////// RTest TheTest(_L("t_sqlstartup test")); +RFs TheFs; + static TInt TheProcessHandleCount = 0; static TInt TheThreadHandleCount = 0; static TInt TheAllocatedCellsCount = 0; @@ -35,6 +40,9 @@ void DeleteTestFiles() { + (void)TheFs.Delete(KCfgDb2ConfigFilePath); + (void)TheFs.Delete(KCfgDb1ConfigFilePath); + TheFs.Close(); } /////////////////////////////////////////////////////////////////////////////////////// @@ -116,6 +124,9 @@ static void CreateAndDestroySqlServerL() { CSqlServer* server = CSqlServer::NewLC(); + //Drive C: to the RSqlDriveSpaceCol object. This will allow "reserve drive space" construct/destroy code to be tested. + RSqlDriveSpaceCol& drvcol = server->DriveSpaceCol(); + drvcol.AddL(EDriveC); CleanupStack::PopAndDestroy(server); } @@ -318,12 +329,69 @@ TEST(!rc); } +/** +@SYMTestCaseID PDS-SQL-UT-4175 +@SYMTestCaseDesc Test for DEF144937: SQL, SQL server, the code coverage can be improved in some areas. +@SYMTestPriority High +@SYMTestActions The test creates a SQL server instance and performs some basic operations with + RSqlDriveSpaceCol object owned by the server, such as: adding a new drive, + getting an access to the reserved drive space, releasing the access. +@SYMTestExpectedResults Test must not fail +@SYMDEF DEF144937 +*/ +void ReserveDriveSpaceTest() + { + CSqlServer* srv = NULL; + TRAPD(err, srv = CreateSqlServerL()); + TEST2(err, KErrNone); + + RSqlDriveSpaceCol& drvcol = srv->DriveSpaceCol(); + TRAP(err, drvcol.AddL(EDriveC)); + TEST2(err, KErrNone); + + CSqlDriveSpace* drvspace = drvcol.Find(EDriveZ); + TEST(!drvspace); + drvspace = drvcol.Find(EDriveC); + TEST(drvspace != NULL); + + TDriveNumber drvnum = drvspace->Drive(); + TEST2(drvnum, EDriveC); + //It is safe to call GetAccessL() more than once. The access is reference counted. + TRAP(err, drvspace->GetAccessL()); + TEST2(err, KErrNone); + TRAP(err, drvspace->GetAccessL()); + TEST2(err, KErrNone); + //It is safe if ReleaseAccess() call count do not match GetAccessL() call count. + drvspace->ReleaseAccess(); + drvspace->ReleaseAccess(); + drvspace->ReleaseAccess(); + // + drvcol.ResetAndDestroy(); + delete srv; + } + +void DoCreateCfgFile(const TDesC& aFileName, const TDesC8& aData) + { + RFile file; + TInt err = file.Create(TheFs, aFileName, EFileRead | EFileWrite); + TEST2(err, KErrNone); + err = file.Write(aData); + file.Close(); + TEST2(err, KErrNone); + } + void DoTests() { CActiveScheduler* scheduler = new CActiveScheduler; TEST(scheduler != NULL); CActiveScheduler::Install(scheduler); - + + //Adding two db config files will allow CDbConfigFiles construct/destroy code also to be tested in the OOM tests. + TInt err = TheFs.Connect(); + TEST2(err, KErrNone); + DoCreateCfgFile(KCfgDb1ConfigFilePath, _L8("CREATE INDEX idx ON table1(i1);")); + DoCreateCfgFile(KCfgDb2ConfigFilePath, _L8("CREATE INDEX idx1 ON table1(i1);CREATE INDEX idx2 ON table2(i2)")); + TheTest.Start(_L(" @SYMTestCaseID:PDS-SQL-UT-4159 SQL server startup OOM test")); SqlServerStartupOomTest(); @@ -339,6 +407,9 @@ TheTest.Next (_L(" @SYMTestCaseID:PDS-SQL-UT-4163 SQL server, UTF conversion test")); UtfConversionTest(); + TheTest.Next (_L(" @SYMTestCaseID:PDS-SQL-UT-4175 Reserve drive space tests")); + ReserveDriveSpaceTest(); + delete scheduler; } @@ -347,6 +418,7 @@ TheTest.Title(); CTrapCleanup* tc = CTrapCleanup::New(); + TheTest(tc != NULL); __UHEAP_MARK; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/testexecute/SQLite/group/bld.inf --- a/persistentstorage/sql/TEST/testexecute/SQLite/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/testexecute/SQLite/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -13,103 +13,59 @@ // Description: // -PRJ_EXPORTS - -PRJ_MMPFILES PRJ_TESTEXPORTS -te_SQL_suite.iby /epoc32/rom/include/te_sql_suite.iby - -//SQL TestExecute Main scripts +te_SQL_suite.iby /epoc32/rom/include/te_sql_suite.iby -../scripts/te_SQL_suite.script /epoc32/release/winscw/udeb/z/tef_sql/te_sql_suite.script -../scripts/te_SQL_suite.script /epoc32/release/winscw/urel/z/tef_sql/te_sql_suite.script -../scripts/BasicSQL2.script /epoc32/release/winscw/udeb/z/tef_sql/basicsql2.script -../scripts/BasicSQL2.script /epoc32/release/winscw/urel/z/tef_sql/basicsql2.script -../scripts/BasicSQL2-8S.script /epoc32/release/winscw/udeb/z/tef_sql/basicsql2-8s.script -../scripts/BasicSQL2-8S.script /epoc32/release/winscw/urel/z/tef_sql/basicsql2-8s.script -../scripts/Robustness.script /epoc32/release/winscw/udeb/z/tef_sql/robustness.script -../scripts/Robustness.script /epoc32/release/winscw/urel/z/tef_sql/robustness.script -../scripts/Panics.script /epoc32/release/winscw/udeb/z/tef_sql/panics.script -../scripts/Panics.script /epoc32/release/winscw/urel/z/tef_sql/panics.script -../scripts/TypeConversion.script /epoc32/release/winscw/udeb/z/tef_sql/typeconversion.script -../scripts/TypeConversion.script /epoc32/release/winscw/urel/z/tef_sql/typeconversion.script -../scripts/SomeExceptions.script /epoc32/release/winscw/udeb/z/tef_sql/someexceptions.script -../scripts/SomeExceptions.script /epoc32/release/winscw/urel/z/tef_sql/someexceptions.script -../scripts/BasicSQL.script /epoc32/release/winscw/udeb/z/tef_sql/basicsql.script -../scripts/BasicSQL.script /epoc32/release/winscw/urel/z/tef_sql/basicsql.script -../scripts/Configuration.script /epoc32/release/winscw/udeb/z/tef_sql/configuration.script -../scripts/Configuration.script /epoc32/release/winscw/urel/z/tef_sql/configuration.script -../scripts/Concurrent.script /epoc32/release/winscw/udeb/z/tef_sql/concurrent.script -../scripts/Concurrent.script /epoc32/release/winscw/urel/z/tef_sql/concurrent.script -../scripts/BUR.script /epoc32/release/winscw/udeb/z/tef_sql/bur.script -../scripts/BUR.script /epoc32/release/winscw/urel/z/tef_sql/bur.script -../scripts/security.script /epoc32/release/winscw/udeb/z/tef_sql/security.script -../scripts/security.script /epoc32/release/winscw/urel/z/tef_sql/security.script -../scripts/collation.script /epoc32/release/winscw/udeb/z/tef_sql/collation.script -../scripts/collation.script /epoc32/release/winscw/urel/z/tef_sql/collation.script +// SQL TestExecute Main scripts +../scripts/te_SQL_suite.script z:/tef_sql/te_sql_suite.script +../scripts/BasicSQL2.script z:/tef_sql/basicsql2.script +../scripts/BasicSQL2-8S.script z:/tef_sql/basicsql2-8s.script +../scripts/Robustness.script z:/tef_sql/robustness.script +../scripts/Panics.script z:/tef_sql/panics.script +../scripts/TypeConversion.script z:/tef_sql/typeconversion.script +../scripts/SomeExceptions.script z:/tef_sql/someexceptions.script +../scripts/BasicSQL.script z:/tef_sql/basicsql.script +../scripts/Configuration.script z:/tef_sql/configuration.script +../scripts/Concurrent.script z:/tef_sql/concurrent.script +../scripts/BUR.script z:/tef_sql/bur.script +../scripts/security.script z:/tef_sql/security.script +../scripts/collation.script z:/tef_sql/collation.script -//SQL TestExecute additional files -../config/APIBasic.ini /epoc32/release/winscw/udeb/z/tef_sql/apibasic.ini -../config/APIBasic.ini /epoc32/release/winscw/urel/z/tef_sql/apibasic.ini -../config/APIBasic2.ini /epoc32/release/winscw/udeb/z/tef_sql/apibasic2.ini -../config/APIBasic2.ini /epoc32/release/winscw/urel/z/tef_sql/apibasic2.ini -../config/APIBasic2-8S.ini /epoc32/release/winscw/udeb/z/tef_sql/apibasic2-8s.ini -../config/APIBasic2-8S.ini /epoc32/release/winscw/urel/z/tef_sql/apibasic2-8s.ini -../config/Robustness.ini.EMULATOR /epoc32/release/winscw/udeb/z/tef_sql/robustness.ini -../config/Robustness.ini.EMULATOR /epoc32/release/winscw/urel/z/tef_sql/robustness.ini -../config/Robustness.ini.DEVBOARD /epoc32/release/armv5/udeb/z/tef_sql/robustness.ini -../config/Robustness.ini.DEVBOARD /epoc32/release/armv5/urel/z/tef_sql/robustness.ini -../config/Panics.ini /epoc32/release/winscw/udeb/z/tef_sql/panics.ini -../config/Panics.ini /epoc32/release/winscw/urel/z/tef_sql/panics.ini -../config/TypeConversion.ini /epoc32/release/winscw/udeb/z/tef_sql/typeconversion.ini -../config/TypeConversion.ini /epoc32/release/winscw/urel/z/tef_sql/typeconversion.ini -../config/SomeExceptions.ini /epoc32/release/winscw/udeb/z/tef_sql/someexceptions.ini -../config/SomeExceptions.ini /epoc32/release/winscw/urel/z/tef_sql/someexceptions.ini -../config/constraints.ini /epoc32/release/winscw/udeb/z/tef_sql/constraints.ini -../config/constraints.ini /epoc32/release/winscw/urel/z/tef_sql/constraints.ini -../config/views.ini /epoc32/release/winscw/udeb/z/tef_sql/views.ini -../config/views.ini /epoc32/release/winscw/urel/z/tef_sql/views.ini -../config/robust_size.ini /epoc32/release/winscw/udeb/z/tef_sql/robust_size.ini -../config/robust_size.ini /epoc32/release/winscw/urel/z/tef_sql/robust_size.ini -../config/Configuration.ini /epoc32/release/winscw/udeb/z/tef_sql/configuration.ini -../config/Configuration.ini /epoc32/release/winscw/urel/z/tef_sql/configuration.ini -../config/Concurrent.ini /epoc32/release/winscw/udeb/z/tef_sql/concurrent.ini -../config/Concurrent.ini /epoc32/release/winscw/urel/z/tef_sql/concurrent.ini -../config/BUR.ini /epoc32/release/winscw/udeb/z/tef_sql/bur.ini -../config/BUR.ini /epoc32/release/winscw/urel/z/tef_sql/bur.ini -../config/security.ini /epoc32/release/winscw/udeb/z/tef_sql/security.ini -../config/security.ini /epoc32/release/winscw/urel/z/tef_sql/security.ini -../config/collation.ini /epoc32/release/winscw/udeb/z/tef_sql/collation.ini -../config/collation.ini /epoc32/release/winscw/urel/z/tef_sql/collation.ini +// SQL TestExecute config files +../config/APIBasic.ini z:/tef_sql/apibasic.ini +../config/APIBasic2.ini z:/tef_sql/apibasic2.ini +../config/APIBasic2-8S.ini z:/tef_sql/apibasic2-8s.ini +../config/Panics.ini z:/tef_sql/panics.ini +../config/TypeConversion.ini z:/tef_sql/typeconversion.ini +../config/SomeExceptions.ini z:/tef_sql/someexceptions.ini +../config/constraints.ini z:/tef_sql/constraints.ini +../config/views.ini z:/tef_sql/views.ini +../config/robust_size.ini z:/tef_sql/robust_size.ini +../config/Configuration.ini z:/tef_sql/configuration.ini +../config/Concurrent.ini z:/tef_sql/concurrent.ini +../config/BUR.ini z:/tef_sql/bur.ini +../config/security.ini z:/tef_sql/security.ini +../config/collation.ini z:/tef_sql/collation.ini +// Target specific config files +../config/Robustness.ini.EMULATOR /epoc32/release/winscw/udeb/z/tef_sql/robustness.ini +../config/Robustness.ini.EMULATOR /epoc32/release/winscw/urel/z/tef_sql/robustness.ini +../config/Robustness.ini.DEVBOARD /epoc32/data/z/tef_sql/robustness.ini // Reference data for various test cases. -../data/reference1.txt /epoc32/release/winscw/udeb/z/tef_sql/testdata/reference1.txt -../data/reference1.txt /epoc32/release/winscw/urel/z/tef_sql/testdata/reference1.txt -../data/reference1.bin /epoc32/release/winscw/udeb/z/tef_sql/testdata/reference1.bin -../data/reference1.bin /epoc32/release/winscw/urel/z/tef_sql/testdata/reference1.bin -../data/test1.db /epoc32/release/winscw/udeb/z/tef_sql/testdata/test1.db -../data/test1.db /epoc32/release/winscw/urel/z/tef_sql/testdata/test1.db -../data/ShortNonDb.db /epoc32/release/winscw/udeb/z/tef_sql/testdata/shortnondb.db -../data/ShortNonDb.db /epoc32/release/winscw/urel/z/tef_sql/testdata/shortnondb.db -../data/LongNonDb.db /epoc32/release/winscw/udeb/z/tef_sql/testdata/longnondb.db -../data/LongNonDb.db /epoc32/release/winscw/urel/z/tef_sql/testdata/longnondb.db -../data/ReadOnly.db /epoc32/release/winscw/udeb/z/tef_sql/testdata/readonly.db -../data/ReadOnly.db /epoc32/release/winscw/urel/z/tef_sql/testdata/readonly.db -../data/Corrupt.db /epoc32/release/winscw/udeb/z/tef_sql/testdata/corrupt.db -../data/Corrupt.db /epoc32/release/winscw/urel/z/tef_sql/testdata/corrupt.db -../data/backup_registration.xml /epoc32/release/winscw/udeb/z/tef_sql/testdata/backup_registration.xml -../data/backup_registration.xml /epoc32/release/winscw/urel/z/tef_sql/testdata/backup_registration.xml -../data/{102827c7}corrupt.db /epoc32/release/winscw/udeb/z/tef_sql/testdata/[102827c7]corrupt.db -../data/{102827c7}corrupt.db /epoc32/release/winscw/urel/z/tef_sql/testdata/[102827c7]corrupt.db -../data/ext.pol /epoc32/release/winscw/udeb/z/tef_sql/testdata/ext.pol -../data/ext.pol /epoc32/release/winscw/urel/z/tef_sql/testdata/ext.pol +../data/reference1.txt z:/tef_sql/testdata/reference1.txt +../data/reference1.bin z:/tef_sql/testdata/reference1.bin +../data/test1.db z:/tef_sql/testdata/test1.db +../data/ShortNonDb.db z:/tef_sql/testdata/shortnondb.db +../data/LongNonDb.db z:/tef_sql/testdata/longnondb.db +../data/ReadOnly.db z:/tef_sql/testdata/readonly.db +../data/Corrupt.db z:/tef_sql/testdata/corrupt.db +../data/backup_registration.xml z:/tef_sql/testdata/backup_registration.xml +../data/{102827c7}corrupt.db z:/tef_sql/testdata/[102827c7]corrupt.db +../data/ext.pol z:/tef_sql/testdata/ext.pol PRJ_TESTMMPFILES // TestExecute test binaries te_SQL_suite.mmp manual te_SQL_suite_cap1.mmp manual te_SQL_suite_cap2.mmp manual - - - diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/testexecute/SQLite/group/te_SQL_suite.iby --- a/persistentstorage/sql/TEST/testexecute/SQLite/group/te_SQL_suite.iby Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/testexecute/SQLite/group/te_SQL_suite.iby Mon May 03 14:09:14 2010 +0300 @@ -1,75 +1,70 @@ -/* -* Copyright (c) 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: -* -*/ +// Copyright (c) 2009-2010 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: +// + #ifndef __TE_SQL_SUITE_IBY__ #define __TE_SQL_SUITE_IBY__ #include -#include "burtestserver.iby" +#include -file=ABI_DIR\BUILD_DIR\Te_SQL_Suite.exe System\bin\Te_SQL_Suite.exe -file=ABI_DIR\BUILD_DIR\Te_SQL_Suite_cap1.exe System\bin\Te_SQL_Suite_cap1.exe -file=ABI_DIR\BUILD_DIR\Te_SQL_Suite_cap2.exe System\bin\Te_SQL_Suite_cap2.exe +file=ABI_DIR\BUILD_DIR\Te_SQL_Suite.exe System\bin\Te_SQL_Suite.exe +file=ABI_DIR\BUILD_DIR\Te_SQL_Suite_cap1.exe System\bin\Te_SQL_Suite_cap1.exe +file=ABI_DIR\BUILD_DIR\Te_SQL_Suite_cap2.exe System\bin\Te_SQL_Suite_cap2.exe -//script files -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\te_SQL_Suite.script TEF_SQL\te_SQL_Suite.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\BasicSQL2.script TEF_SQL\BasicSQL2.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\BasicSQL2-8S.script TEF_SQL\BasicSQL2-8S.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\Robustness.script TEF_SQL\Robustness.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\Concurrent.script TEF_SQL\Concurrent.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\TypeConversion.script TEF_SQL\TypeConversion.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\SomeExceptions.script TEF_SQL\SomeExceptions.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\BasicSQL.script TEF_SQL\BasicSQL.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\BUR.script TEF_SQL\BUR.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\security.script TEF_SQL\security.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\Configuration.script TEF_SQL\Configuration.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\Panics.script TEF_SQL\Panics.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\collation.script TEF_SQL\collation.script - - -//config files +// Script files +data=DATAZ_\tef_sql\te_SQL_Suite.script tef_sql\te_SQL_Suite.script +data=DATAZ_\tef_sql\BasicSQL2.script tef_sql\BasicSQL2.script +data=DATAZ_\tef_sql\BasicSQL2-8S.script tef_sql\BasicSQL2-8S.script +data=DATAZ_\tef_sql\Robustness.script tef_sql\Robustness.script +data=DATAZ_\tef_sql\Concurrent.script tef_sql\Concurrent.script +data=DATAZ_\tef_sql\TypeConversion.script tef_sql\TypeConversion.script +data=DATAZ_\tef_sql\SomeExceptions.script tef_sql\SomeExceptions.script +data=DATAZ_\tef_sql\BasicSQL.script tef_sql\BasicSQL.script +data=DATAZ_\tef_sql\BUR.script tef_sql\BUR.script +data=DATAZ_\tef_sql\security.script tef_sql\security.script +data=DATAZ_\tef_sql\Configuration.script tef_sql\Configuration.script +data=DATAZ_\tef_sql\Panics.script tef_sql\Panics.script +data=DATAZ_\tef_sql\collation.script tef_sql\collation.script -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\APIBasic.ini TEF_SQL\APIBasic.ini -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\APIBasic2.ini TEF_SQL\APIBasic2.ini -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\APIBasic2-8S.ini TEF_SQL\APIBasic2-8S.ini -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\SomeExceptions.ini TEF_SQL\SomeExceptions.ini -data=EPOCROOT##Epoc32\release\armv5\udeb\z\TEF_SQL\Robustness.ini TEF_SQL\Robustness.ini -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\TypeConversion.ini TEF_SQL\TypeConversion.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\constraints.ini TEF_SQL\constraints.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\views.ini TEF_SQL\views.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\robust_size.ini TEF_SQL\robust_size.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\Configuration.ini TEF_SQL\Configuration.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\Concurrent.ini TEF_SQL\Concurrent.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\Panics.ini TEF_SQL\Panics.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\BUR.ini TEF_SQL\BUR.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\security.ini TEF_SQL\security.ini -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\collation.ini TEF_SQL\collation.ini +// Config files +data=DATAZ_\tef_sql\APIBasic.ini tef_sql\APIBasic.ini +data=DATAZ_\tef_sql\APIBasic2.ini tef_sql\APIBasic2.ini +data=DATAZ_\tef_sql\APIBasic2-8S.ini tef_sql\APIBasic2-8S.ini +data=DATAZ_\tef_sql\SomeExceptions.ini tef_sql\SomeExceptions.ini +data=DATAZ_\tef_sql\Robustness.ini tef_sql\Robustness.ini +data=DATAZ_\tef_sql\TypeConversion.ini tef_sql\TypeConversion.ini +data=DATAZ_\tef_sql\constraints.ini tef_sql\constraints.ini +data=DATAZ_\tef_sql\views.ini tef_sql\views.ini +data=DATAZ_\tef_sql\robust_size.ini tef_sql\robust_size.ini +data=DATAZ_\tef_sql\Configuration.ini tef_sql\Configuration.ini +data=DATAZ_\tef_sql\Concurrent.ini tef_sql\Concurrent.ini +data=DATAZ_\tef_sql\Panics.ini tef_sql\Panics.ini +data=DATAZ_\tef_sql\BUR.ini tef_sql\BUR.ini +data=DATAZ_\tef_sql\security.ini tef_sql\security.ini +data=DATAZ_\tef_sql\collation.ini tef_sql\collation.ini -//data files - -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\TestData\reference1.txt TEF_SQL\TestData\reference1.txt -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\TestData\reference1.bin TEF_SQL\TestData\reference1.bin -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\TestData\test1.db TEF_SQL\TestData\test1.db -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\TestData\ShortNonDb.db TEF_SQL\TestData\ShortNonDb.db -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\TestData\LongNonDb.db TEF_SQL\TestData\LongNonDb.db -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\TestData\ReadOnly.db TEF_SQL\TestData\ReadOnly.db -data=EPOCROOT##epoc32\release\winscw\udeb\z\TEF_SQL\TestData\Corrupt.db TEF_SQL\TestData\Corrupt.db -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\TestData\backup_registration.xml TEF_SQL\TestData\backup_registration.xml -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\TestData\[102827c7]corrupt.db TEF_SQL\TestData\[102827c7]corrupt.db -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\TestData\ext.pol TEF_SQL\TestData\ext.pol +// Data files +data=DATAZ_\tef_sql\TestData\reference1.txt tef_sql\TestData\reference1.txt +data=DATAZ_\tef_sql\TestData\reference1.bin tef_sql\TestData\reference1.bin +data=DATAZ_\tef_sql\TestData\test1.db tef_sql\TestData\test1.db +data=DATAZ_\tef_sql\TestData\ShortNonDb.db tef_sql\TestData\ShortNonDb.db +data=DATAZ_\tef_sql\TestData\LongNonDb.db tef_sql\TestData\LongNonDb.db +data=DATAZ_\tef_sql\TestData\ReadOnly.db tef_sql\TestData\ReadOnly.db +data=DATAZ_\tef_sql\TestData\Corrupt.db tef_sql\TestData\Corrupt.db +data=DATAZ_\tef_sql\TestData\backup_registration.xml tef_sql\TestData\backup_registration.xml +data=DATAZ_\tef_sql\TestData\[102827c7]corrupt.db tef_sql\TestData\[102827c7]corrupt.db +data=DATAZ_\tef_sql\TestData\ext.pol tef_sql\TestData\ext.pol #endif // __TE_SQL_SUITE_IBY__ - diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/testexecute/group/TEF_SQL.iby --- a/persistentstorage/sql/TEST/testexecute/group/TEF_SQL.iby Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/testexecute/group/TEF_SQL.iby Mon May 03 14:09:14 2010 +0300 @@ -1,27 +1,25 @@ -/* -* Copyright (c) 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: -* -*/ +// Copyright (c) 2009-2010 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: +// + #ifndef __TEF_SQL_IBY__ #define __TEF_SQL_IBY__ #include - -//Main CentralRepository TEF Scripts -data=EPOCROOT##Epoc32\release\winscw\udeb\z\TEF_SQL\TEF_SQL.script TEF_SQL\TEF_SQL.script - #include -#endif +//Main SQL TEF Scripts +data=DATAZ_\tef_sql\tef_sql.script tef_sql\tef_sql.script + +#endif // __TEF_SQL_IBY__ diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sql/TEST/testexecute/group/bld.inf --- a/persistentstorage/sql/TEST/testexecute/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sql/TEST/testexecute/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -14,10 +14,8 @@ // PRJ_TESTEXPORTS -TEF_SQL.iby /epoc32/rom/include/tef_sql.iby -../scripts/TEF_SQL.script /epoc32/release/winscw/urel/z/tef_sql/tef_sql.script -../scripts/TEF_SQL.script /epoc32/release/winscw/udeb/z/tef_sql/tef_sql.script +TEF_SQL.iby /epoc32/rom/include/tef_sql.iby +../scripts/TEF_SQL.script z:/tef_sql/tef_sql.script //TEST EXECUTE FRAMEWORK TESTS #include "../SQLite/group/bld.inf" - diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/GROUP/sqlite3tests.iby --- a/persistentstorage/sqlite3api/GROUP/sqlite3tests.iby Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/GROUP/sqlite3tests.iby Mon May 03 14:09:14 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 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" @@ -429,6 +429,10 @@ data=ZPRIVATE\10285A82\where6.test \PRIVATE\10285A82\where6.test data=ZPRIVATE\10285A82\zeroblob.test \PRIVATE\10285A82\zeroblob.test +//The next line to be uncommented if the testing is performed locally. Otherwise tests will fail - +//the following file is missing and needed by the timezone server. +//data=ZPRIVATE\10202BE9\1020383e.txt \PRIVATE\10202be9\1020383e.txt + file=ABI_DIR\BUILD_DIR\t_sqliteapi.exe \TEST\t_sqliteapi.exe file=ABI_DIR\BUILD_DIR\t_sqlitewsd.exe \TEST\t_sqlitewsd.exe file=ABI_DIR\BUILD_DIR\t_sqlitewsd2.exe \TEST\t_sqlitewsd2.exe diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/GROUP/tclsqlite3.mmp --- a/persistentstorage/sqlite3api/GROUP/tclsqlite3.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/GROUP/tclsqlite3.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -11,9 +11,9 @@ // Contributors: // // Description: -// SQLite C API test application -// The "buildrom" command: -// buildrom -D_SERIAL_DOWNLOAD -DRVCT -D_EABI=ARMV5 -D_NAND2 -fm=/epoc32/rom/include/featuredatabase.xml h4hrp.oby textshell.oby syslibs_utils.oby sqlite3.iby sqlite3tests.iby openenv.iby bluetooth.iby ups.iby -orombld.img +// SQLite C API test application (used to run the TCL test suite) +// The "buildrom" command (uncomment before that the line in sqlite3tests.iby file that copies "1020383e.txt" file): +// buildrom -D_SERIAL_DOWNLOAD -DRVCT -D_EABI=ARMV5 -fm=/epoc32/rom/include/featuredatabase.xml h4hrp.oby textshell.oby sqlite3.iby sqlite3tests.iby openenv.iby bluetooth.iby ups.iby timezonelocalization.iby -orombld.img // // @@ -37,6 +37,9 @@ EPOCSTACKSIZE 81920 //max 80kb EPOCHEAPSIZE 0x00100000 0x02000000 +// Need this otherwise get a lot of mismatched IMPORT_C/EXPORT_C even though this is an exe +MACRO SQLITE_DLL + ////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////// RVCT compiler warning & optimization options ///////////////////////////////////////// diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/OsLayer/FileBuf64.cpp --- a/persistentstorage/sqlite3api/OsLayer/FileBuf64.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/OsLayer/FileBuf64.cpp Mon May 03 14:09:14 2010 +0300 @@ -20,56 +20,39 @@ #ifdef _SQLPROFILER -extern TBool TheOsCallTimeDetailedProfileEnabled;//If true, the OS porting layer call details are enabled and for each call an entry will be added to the log file (epocwind.out). - #define PROFILE_READ(pos,amount) \ do \ { \ - if(TheOsCallTimeDetailedProfileEnabled) \ - { \ - ++iFileReadCount; iFileReadAmount += (amount); \ - RDebug::Print(_L(" -- FRead this=%X, Cnt=%d, Pos=%ld, Amt=%d, Ttl=%ld\r\n"), (TUint32)this, iFileReadCount, pos, amount, iFileReadAmount); \ - } \ + ++iFileReadCount; iFileReadAmount += (amount); \ + RDebug::Print(_L(" -- FRead this=%X, Cnt=%d, Pos=%ld, Amt=%d, Ttl=%ld\r\n"), (TUint32)this, iFileReadCount, pos, amount, iFileReadAmount); \ } while(0) #define PROFILE_WRITE(pos,amount) \ do \ { \ - if(TheOsCallTimeDetailedProfileEnabled) \ - { \ - ++iFileWriteCount, iFileWriteAmount += (amount); \ - RDebug::Print(_L(" -- FWrite this=%X, Cnt=%d, Pos=%ld, Amt=%d, Ttl=%ld\r\n"), (TUint32)this, iFileWriteCount, pos, amount, iFileWriteAmount); \ - } \ + ++iFileWriteCount; iFileWriteAmount += (amount); \ + RDebug::Print(_L(" -- FWrite this=%X, Cnt=%d, Pos=%ld, Amt=%d, Ttl=%ld\r\n"), (TUint32)this, iFileWriteCount, pos, amount, iFileWriteAmount); \ } while(0) #define PROFILE_SIZE() \ do \ { \ - if(TheOsCallTimeDetailedProfileEnabled) \ - { \ - ++iFileSizeCount; \ - RDebug::Print(_L(" -- FSize this=%X, Cnt=%d\r\n"), (TUint32)this, iFileSizeCount); \ - } \ + ++iFileSizeCount; \ + RDebug::Print(_L(" -- FSize this=%X, Cnt=%d\r\n"), (TUint32)this, iFileSizeCount); \ } while(0) #define PROFILE_SETSIZE() \ do \ { \ - if(TheOsCallTimeDetailedProfileEnabled) \ - { \ - ++iFileSetSizeCount; \ - RDebug::Print(_L(" -- FSetSize this=%X, Cnt=%d\r\n"), (TUint32)this, iFileSetSizeCount); \ - } \ + ++iFileSetSizeCount; \ + RDebug::Print(_L(" -- FSetSize this=%X, Cnt=%d\r\n"), (TUint32)this, iFileSetSizeCount); \ } while(0) #define PROFILE_FLUSH() \ do \ { \ - if(TheOsCallTimeDetailedProfileEnabled) \ - { \ - ++iFileFlushCount; \ - RDebug::Print(_L(" -- FFlush this=%X, Cnt=%d\r\n"), (TUint32)this, iFileFlushCount); \ - } \ + ++iFileFlushCount; \ + RDebug::Print(_L(" -- FFlush this=%X, Cnt=%d\r\n"), (TUint32)this, iFileFlushCount); \ } while(0) #else diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/OsLayer/FileBuf64.h --- a/persistentstorage/sqlite3api/OsLayer/FileBuf64.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/OsLayer/FileBuf64.h Mon May 03 14:09:14 2010 +0300 @@ -179,10 +179,6 @@ //Profiler related #ifdef _SQLPROFILER public: - inline void ProfilerReset() - { - iFileReadCount = 0; iFileReadAmount = 0; iFileWriteCount = 0; iFileWriteAmount = 0; iFileSizeCount = 0; iFileSetSizeCount = 0; iFileFlushCount = 0; - } TInt iFileReadCount; //The number of the non-buffered file reads (RFile64::Read() calls). TInt64 iFileReadAmount; //The amount of the data read from the file. TInt iFileWriteCount; //The number of the non-buffered file writes (RFile64::Write() calls). diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/OsLayer/os_symbian.h --- a/persistentstorage/sqlite3api/OsLayer/os_symbian.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/OsLayer/os_symbian.h Mon May 03 14:09:14 2010 +0300 @@ -117,8 +117,9 @@ Whether the SQLite requests fast or ecursive mutex, a recursive mutex will be created. The recursive mutex creation can fail, in which case the error will be reported back to the caller. -Note that even though sqlite3_mutex has vritual methods, it is not declared as a "C" class because sqlite3_mutex -is an externally defined type by SQLite. +Note that even though sqlite3_mutex has virtual methods, it is not declared as a standard Symbian OS "C" class +because sqlite3_mutex is an abstract type, externally declared and used by SQLite (SQLite is a C library). +SQLite deals only with pointers to sqlite3_mutex objects. See the declaration in sqlite3.h file. @see TPls @see CRecursiveMutex @@ -145,6 +146,9 @@ sqlite3_mutex derived class. Describes a recursive mutex. The mutex creation can fail, the error will be reported back to the caller. +This is not a standard Symbian OS "C" class, not derived from CBase. +CRecursiveMutex is a specialization of the sqlite3_mutex class, used for recursive mutexes. + @see sqlite3_mutex @internalComponent diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/OsLayer/os_symbian_mt.cpp --- a/persistentstorage/sqlite3api/OsLayer/os_symbian_mt.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/OsLayer/os_symbian_mt.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -154,9 +154,12 @@ The calling thread becomes a mutex owner. If the mutex is already locked by another thread, the calling thread will block until the other thread releases the mutex. The method can be called by the mutex owning thread more than once, even if the mutex is already entered. + +@panic SqliteMt 23 Negative mutex lock counter (in debug builds only) */ void sqlite3_mutex::Enter() { + __ASSERT_DEBUG(iRefCount >= 0, User::Panic(KPanicCategory, EPanicMutexLockCounter)); iMutex.Wait(); RThread currThread; iOwnerThreadId = currThread.Id(); @@ -191,7 +194,7 @@ TBool sqlite3_mutex::IsHeld() const { RThread currThread; - return iRefCount != 0 && iOwnerThreadId == currThread.Id(); + return iRefCount > 0 && iOwnerThreadId == currThread.Id(); } /** @@ -274,7 +277,8 @@ mutex = CRecursiveMutex::New(); break; default: - mutex = ::StaticMutex(aType - 2); + mutex = ::StaticMutex(aType - 2);//"aType - 2" because the first SQLITE_MUTEX_STATIC_ mutex definition + //value is 2 (SQLITE_MUTEX_FAST is 0, SQLITE_MUTEX_RECURSIVE is 1). break; } return mutex; @@ -417,6 +421,8 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** +sqlite3_mutex_methods is a structure declared in sqlite3.h header file. +sqlite3_mutex_methods defines the mutex interface used by SQLite and implemented by the OS porting layer. */ static sqlite3_mutex_methods TheMutexMethods = { @@ -1027,7 +1033,7 @@ Checks if the file lock type is SQLITE_LOCK_RESERVED or bigger. @param aDbFile A pointer to a TDbFile instance, that contains the file handle. -@param aResOut Output parameter. It should be set to 1 if the stored lock type is bigger or equal +@param aResOut Output parameter. It will be set to be non-zero if the stored lock type is bigger or equal than SQLITE_LOCK_RESERVED. @return SQLITE_IOERR_CHECKRESERVEDLOCK, The operation has failed, diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/OsLayer/test_fileutil.cpp --- a/persistentstorage/sqlite3api/OsLayer/test_fileutil.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/OsLayer/test_fileutil.cpp Mon May 03 14:09:14 2010 +0300 @@ -334,11 +334,31 @@ extern "C" void PrintS(const char* aTxt) { - TBuf<128> buf; - buf.Copy(TPtrC8((const TUint8*)aTxt)); - - RProcess process; - TProcessId processId = process.Id(); - - RDebug::Print(_L("%S. Process Id=%ld.\n"), &buf, processId.Id()); + if(!aTxt) + { + return; + } + TPtrC8 msg((const TUint8*)aTxt); + TInt msglen = msg.Length(); + TInt pos = 0; + const TInt KMaxLineLength = 220; + TBuf line; + do + { + if(pos == 0) + { + RProcess process; + TProcessId processId = process.Id(); + line.Format(_L("Process Id=%ld: "), processId.Id()); + } + TInt len = Min(msglen, (line.MaxLength() - line.Length())); + TPtrC8 ptr(msg.Ptr() + pos, len); + pos += len; + msglen -= len; + TPtr p2((TUint16*)line.Ptr() + line.Length(), 0, len); + p2.Copy(ptr); + line.SetLength(line.Length() + p2.Length()); + RDebug::Print(_L("%S\n"), &line); + line.Zero(); + } while(msglen > 0); } diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/TEST/SRC/tclsqlite.c --- a/persistentstorage/sqlite3api/TEST/SRC/tclsqlite.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/TEST/SRC/tclsqlite.c Mon May 03 14:09:14 2010 +0300 @@ -273,7 +273,7 @@ p->iSeek = sqlite3_blob_bytes(p->pBlob) + offset; break; - default: assert(!"Bad seekMode"); + default: assert(0); /* Bad seekMode */ } return p->iSeek; @@ -2665,7 +2665,7 @@ #endif PrintS("###TclSqlite3: Tests begin"); if( TCLSH==1 && Tcl_EvalFile(interp, argv[1])!=TCL_OK ){ - char errMsg[300]; + char errMsg[1024]; const char *zInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); if( zInfo==0 ) zInfo = interp->result; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/TEST/SRC/test6.c --- a/persistentstorage/sqlite3api/TEST/SRC/test6.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/TEST/SRC/test6.c Mon May 03 14:09:14 2010 +0300 @@ -321,7 +321,7 @@ } default: - assert(!"Cannot happen"); + assert(0); /* Cannot happen */ } if( pWrite==pFinal ) break; diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/tclMain.c --- a/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/tclMain.c Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/tclMain.c Mon May 03 14:09:14 2010 +0300 @@ -32,7 +32,9 @@ */ #if !defined(MAC_TCL) +# if !defined(__SYMBIAN32__) extern int isatty _ANSI_ARGS_((int fd)); +# endif #else #include #endif diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/sqlite3api/TEST/TCL/tcldistribution/unix/tclUnixPort.h --- a/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/unix/tclUnixPort.h Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/unix/tclUnixPort.h Mon May 03 14:09:14 2010 +0300 @@ -508,7 +508,9 @@ #if defined(_sgi) || defined(__sgi) || (defined(__APPLE__) && defined(__DYNAMIC__)) # define environ _environ #endif +#ifndef __SYMBIAN32__ // added to prevent RVCT warnings on armv5 extern char **environ; +#endif /* * At present (12/91) not all stdlib.h implementations declare strtod. @@ -517,8 +519,9 @@ * an int. There's no ANSI prototype for it because there would end * up being too many conflicts with slightly-different prototypes. */ - +#ifndef __SYMBIAN32__ // added to prevent RVCT warnings on armv5 extern double strtod(); +#endif /* * There is no platform-specific panic routine for Unix in the Tcl internals. diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/store/HTOOLS/pfsdump.ipr --- a/persistentstorage/store/HTOOLS/pfsdump.ipr Fri Apr 16 16:49:27 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -[purpose] - -Display contents of EPOC permanent filestores - -[categories] -development - -[files] -tools\pfsdump.exe - -[owner] -Base: Peripherals & Data # STORE - -[IPR] -Copyright (c) 2000 Symbian Ltd. All rights reserved. diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/store/TSTRM/t_storstreamperf.cpp --- a/persistentstorage/store/TSTRM/t_storstreamperf.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/store/TSTRM/t_storstreamperf.cpp Mon May 03 14:09:14 2010 +0300 @@ -510,7 +510,7 @@ store = CPermanentFileStore::OpenLC(TheFs, TheTestFile, EFileWrite | EFileRead); RPermanentFileStoreIter it4; it4.ResetLC(*store); - TStreamId id; + TStreamId id(KNullStreamIdValue); TInt cnt = 0; fc = User::FastCounter(); while((id = it4.NextL()) != KNullStreamIdValue) diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/store/group/BLD.INF --- a/persistentstorage/store/group/BLD.INF Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/store/group/BLD.INF Mon May 03 14:09:14 2010 +0300 @@ -26,8 +26,6 @@ PRJ_EXPORTS -../HTOOLS/pfsdump.ipr /epoc32/engdoc/tools/pfsdump.ipr - ../INC/S32BTREE.H SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(s32btree.h) ../INC/S32BTREE.INL SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(s32btree.inl) ../INC/S32BUF.H SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(s32buf.h) diff -r 3eacc0623088 -r 55f2396f6d25 persistentstorage/store/group/syslibs_store.mrp --- a/persistentstorage/store/group/syslibs_store.mrp Fri Apr 16 16:49:27 2010 +0300 +++ b/persistentstorage/store/group/syslibs_store.mrp Mon May 03 14:09:14 2010 +0300 @@ -19,8 +19,6 @@ binary \sf\os\persistentdata\persistentstorage\store\group all exports \sf\os\persistentdata\persistentstorage\store\group --export_file \sf\os\persistentdata\persistentstorage\store\HTOOLS\pfsdump.ipr \epoc32\engdoc\tools\pfsdump.ipr - #MattD: This doesn't get registered, as it's an 'intermediate' file. binary \epoc32\release\tools\rel\pfsdump.exe diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/commsdebugutility/TE_commsdebugutility/src/TE_comsdbgServer.cpp --- a/traceservices/commsdebugutility/TE_commsdebugutility/src/TE_comsdbgServer.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/commsdebugutility/TE_commsdebugutility/src/TE_comsdbgServer.cpp Mon May 03 14:09:14 2010 +0300 @@ -149,305 +149,305 @@ // They are created "just in time" when the worker thread is created if(aStepName.Compare(_L("step_001_01")) == 0 ) - testStep = new(ELeave) CFloggerTest001_01; + testStep = new CFloggerTest001_01(); else if(aStepName.Compare(_L("step_002_01")) == 0 ) - testStep = new(ELeave) CFloggerTest002_01; + testStep = new CFloggerTest002_01(); else if(aStepName.Compare(_L("step_002_02")) == 0 ) - testStep = new(ELeave) CFloggerTest002_02; + testStep = new CFloggerTest002_02(); else if(aStepName.Compare(_L("step_003_01")) == 0 ) - testStep = new(ELeave) CFloggerTest003_01; + testStep = new CFloggerTest003_01(); else if(aStepName.Compare(_L("step_003_02")) == 0 ) - testStep = new(ELeave) CFloggerTest003_02; + testStep = new CFloggerTest003_02(); else if(aStepName.Compare(_L("step_003_03")) == 0 ) - testStep = new(ELeave) CFloggerTest003_03; + testStep = new CFloggerTest003_03(); else if(aStepName.Compare(_L("step_004_01")) == 0 ) - testStep = new(ELeave) CFloggerTest004_01; + testStep = new CFloggerTest004_01(); else if(aStepName.Compare(_L("step_004_02")) == 0 ) - testStep = new(ELeave) CFloggerTest004_02; + testStep = new CFloggerTest004_02(); else if(aStepName.Compare(_L("step_004_03")) == 0 ) - testStep = new(ELeave) CFloggerTest004_03; + testStep = new CFloggerTest004_03(); else if(aStepName.Compare(_L("step_005_01")) == 0 ) - testStep = new(ELeave) CFloggerTest005_01; + testStep = new CFloggerTest005_01(); else if(aStepName.Compare(_L("step_005_02")) == 0 ) - testStep = new(ELeave) CFloggerTest005_02; + testStep = new CFloggerTest005_02(); else if(aStepName.Compare(_L("step_005_03")) == 0 ) - testStep = new(ELeave) CFloggerTest005_03; + testStep = new CFloggerTest005_03(); else if(aStepName.Compare(_L("step_005_04")) == 0 ) - testStep = new(ELeave) CFloggerTest005_04; + testStep = new CFloggerTest005_04(); else if(aStepName.Compare(_L("step_006_01")) == 0 ) - testStep = new(ELeave) CFloggerTest006_01; + testStep = new CFloggerTest006_01(); else if(aStepName.Compare(_L("step_006_02")) == 0 ) - testStep = new(ELeave) CFloggerTest006_02; + testStep = new CFloggerTest006_02(); else if(aStepName.Compare(_L("step_006_03")) == 0 ) - testStep = new(ELeave) CFloggerTest006_03; + testStep = new CFloggerTest006_03(); else if(aStepName.Compare(_L("step_007_01")) == 0 ) - testStep = new(ELeave) CFloggerTest007_01; + testStep = new CFloggerTest007_01(); else if(aStepName.Compare(_L("step_007_02")) == 0 ) - testStep = new(ELeave) CFloggerTest007_02; + testStep = new CFloggerTest007_02(); else if(aStepName.Compare(_L("step_007_03")) == 0 ) - testStep = new(ELeave) CFloggerTest007_03; + testStep = new CFloggerTest007_03(); else if(aStepName.Compare(_L("step_008_01")) == 0 ) - testStep = new(ELeave) CFloggerTest008_01; + testStep = new CFloggerTest008_01(); else if(aStepName.Compare(_L("step_008_02")) == 0 ) - testStep = new(ELeave) CFloggerTest008_02; + testStep = new CFloggerTest008_02(); else if(aStepName.Compare(_L("step_008_03")) == 0 ) - testStep = new(ELeave) CFloggerTest008_03; + testStep = new CFloggerTest008_03(); else if(aStepName.Compare(_L("step_008_04")) == 0 ) - testStep = new(ELeave) CFloggerTest008_04; + testStep = new CFloggerTest008_04(); else if(aStepName.Compare(_L("step_009_01")) == 0 ) - testStep = new(ELeave) CFloggerTest009_01; + testStep = new CFloggerTest009_01(); else if(aStepName.Compare(_L("step_009_02")) == 0 ) - testStep = new(ELeave) CFloggerTest009_02; + testStep = new CFloggerTest009_02(); else if(aStepName.Compare(_L("step_009_03")) == 0 ) - testStep = new(ELeave) CFloggerTest009_03; + testStep = new CFloggerTest009_03(); else if(aStepName.Compare(_L("step_010_01")) == 0 ) - testStep = new(ELeave) CFloggerTest010_01; + testStep = new CFloggerTest010_01(); else if(aStepName.Compare(_L("step_010_02")) == 0 ) - testStep = new(ELeave) CFloggerTest010_02; + testStep = new CFloggerTest010_02(); else if(aStepName.Compare(_L("step_010_03")) == 0 ) - testStep = new(ELeave) CFloggerTest010_03; + testStep = new CFloggerTest010_03(); else if(aStepName.Compare(_L("step_010_04")) == 0 ) - testStep = new(ELeave) CFloggerTest010_04; + testStep = new CFloggerTest010_04(); else if(aStepName.Compare(_L("step_010_05")) == 0 ) - testStep = new(ELeave) CFloggerTest010_05; + testStep = new CFloggerTest010_05(); else if(aStepName.Compare(_L("step_010_06")) == 0 ) - testStep = new(ELeave) CFloggerTest010_06; + testStep = new CFloggerTest010_06(); else if(aStepName.Compare(_L("step_011_01")) == 0 ) - testStep = new(ELeave) CFloggerTest011_01; + testStep = new CFloggerTest011_01(); else if(aStepName.Compare(_L("step_011_02")) == 0 ) - testStep = new(ELeave) CFloggerTest011_02; + testStep = new CFloggerTest011_02(); else if(aStepName.Compare(_L("step_011_03")) == 0 ) - testStep = new(ELeave) CFloggerTest011_03; + testStep = new CFloggerTest011_03(); else if(aStepName.Compare(_L("step_012_01")) == 0 ) - testStep = new(ELeave) CFloggerTest012_01; + testStep = new CFloggerTest012_01(); else if(aStepName.Compare(_L("step_012_02")) == 0 ) - testStep = new(ELeave) CFloggerTest012_02; + testStep = new CFloggerTest012_02(); else if(aStepName.Compare(_L("step_012_03")) == 0 ) - testStep = new(ELeave) CFloggerTest012_03; + testStep = new CFloggerTest012_03(); else if(aStepName.Compare(_L("step_012_04")) == 0 ) - testStep = new(ELeave) CFloggerTest012_04; + testStep = new CFloggerTest012_04(); else if(aStepName.Compare(_L("step_013_01")) == 0 ) - testStep = new(ELeave) CFloggerTest013_01; + testStep = new CFloggerTest013_01(); else if(aStepName.Compare(_L("step_013_02")) == 0 ) - testStep = new(ELeave) CFloggerTest013_02; + testStep = new CFloggerTest013_02(); else if(aStepName.Compare(_L("step_013_03")) == 0 ) - testStep = new(ELeave) CFloggerTest013_03; + testStep = new CFloggerTest013_03(); else if(aStepName.Compare(_L("step_014_01")) == 0 ) - testStep = new(ELeave) CFloggerTest014_01; + testStep = new CFloggerTest014_01(); else if(aStepName.Compare(_L("step_014_02")) == 0 ) - testStep = new(ELeave) CFloggerTest014_02; + testStep = new CFloggerTest014_02(); else if(aStepName.Compare(_L("step_014_03")) == 0 ) - testStep = new(ELeave) CFloggerTest014_03; + testStep = new CFloggerTest014_03(); else if(aStepName.Compare(_L("step_015_01")) == 0 ) - testStep = new(ELeave) CFloggerTest015_01; + testStep = new CFloggerTest015_01(); else if(aStepName.Compare(_L("step_015_02")) == 0 ) - testStep = new(ELeave) CFloggerTest015_02; + testStep = new CFloggerTest015_02(); else if(aStepName.Compare(_L("step_015_03")) == 0 ) - testStep = new(ELeave) CFloggerTest015_03; + testStep = new CFloggerTest015_03(); else if(aStepName.Compare(_L("step_015_04")) == 0 ) - testStep = new(ELeave) CFloggerTest015_04; + testStep = new CFloggerTest015_04(); else if(aStepName.Compare(_L("step_016_01")) == 0 ) - testStep = new(ELeave) CFloggerTest016_01; + testStep = new CFloggerTest016_01(); else if(aStepName.Compare(_L("step_016_02")) == 0 ) - testStep = new(ELeave) CFloggerTest016_02; + testStep = new CFloggerTest016_02(); else if(aStepName.Compare(_L("step_016_03")) == 0 ) - testStep = new(ELeave) CFloggerTest016_03; + testStep = new CFloggerTest016_03(); else if(aStepName.Compare(_L("step_017_01")) == 0 ) - testStep = new(ELeave) CFloggerTest017_01; + testStep = new CFloggerTest017_01(); else if(aStepName.Compare(_L("step_017_02")) == 0 ) - testStep = new(ELeave) CFloggerTest017_02; + testStep = new CFloggerTest017_02(); else if(aStepName.Compare(_L("step_017_03")) == 0 ) - testStep = new(ELeave) CFloggerTest017_03; + testStep = new CFloggerTest017_03(); else if(aStepName.Compare(_L("step_017_04")) == 0 ) - testStep = new(ELeave) CFloggerTest017_04; + testStep = new CFloggerTest017_04(); else if(aStepName.Compare(_L("step_017_05")) == 0 ) - testStep = new(ELeave) CFloggerTest017_05; + testStep = new CFloggerTest017_05(); else if(aStepName.Compare(_L("step_017_06")) == 0 ) - testStep = new(ELeave) CFloggerTest017_06; + testStep = new CFloggerTest017_06(); else if(aStepName.Compare(_L("step_018_01")) == 0 ) - testStep = new(ELeave) CFloggerTest018_01; + testStep = new CFloggerTest018_01(); else if(aStepName.Compare(_L("step_019_01")) == 0 ) - testStep = new(ELeave) CFloggerTest019_01; + testStep = new CFloggerTest019_01(); else if(aStepName.Compare(_L("step_020_01")) == 0 ) - testStep = new(ELeave) CFloggerTest020_01; + testStep = new CFloggerTest020_01(); else if(aStepName.Compare(_L("step_020_02")) == 0 ) - testStep = new(ELeave) CFloggerTest020_02; + testStep = new CFloggerTest020_02(); else if(aStepName.Compare(_L("step_020_03")) == 0 ) - testStep = new(ELeave) CFloggerTest020_03; + testStep = new CFloggerTest020_03(); else if(aStepName.Compare(_L("step_021_01")) == 0 ) - testStep = new(ELeave) CFloggerTest021_01; + testStep = new CFloggerTest021_01(); else if(aStepName.Compare(_L("step_022_01")) == 0 ) - testStep = new(ELeave) CFloggerTest022_01; + testStep = new CFloggerTest022_01(); else if(aStepName.Compare(_L("step_023_01")) == 0 ) - testStep = new(ELeave) CFloggerTest023_01; + testStep = new CFloggerTest023_01(); else if(aStepName.Compare(_L("step_023_02")) == 0 ) - testStep = new(ELeave) CFloggerTest023_02; + testStep = new CFloggerTest023_02(); else if(aStepName.Compare(_L("step_024_01")) == 0 ) - testStep = new(ELeave) CFloggerTest024_01; + testStep = new CFloggerTest024_01(); else if(aStepName.Compare(_L("step_024_02")) == 0 ) - testStep = new(ELeave) CFloggerTest024_02; + testStep = new CFloggerTest024_02(); else if(aStepName.Compare(_L("step_024_03")) == 0 ) - testStep = new(ELeave) CFloggerTest024_03; + testStep = new CFloggerTest024_03(); else if(aStepName.Compare(_L("step_024_04")) == 0 ) - testStep = new(ELeave) CFloggerTest024_04; + testStep = new CFloggerTest024_04(); else if(aStepName.Compare(_L("step_024_05")) == 0 ) - testStep = new(ELeave) CFloggerTest024_05; + testStep = new CFloggerTest024_05(); else if(aStepName.Compare(_L("step_024_06")) == 0 ) - testStep = new(ELeave) CFloggerTest024_06; + testStep = new CFloggerTest024_06(); else if(aStepName.Compare(_L("step_024_07")) == 0 ) - testStep = new(ELeave) CFloggerTest024_07; + testStep = new CFloggerTest024_07(); else if(aStepName.Compare(_L("step_024_08")) == 0 ) - testStep = new(ELeave) CFloggerTest024_08; + testStep = new CFloggerTest024_08(); else if(aStepName.Compare(_L("step_025_BuildTestUdeb1")) == 0 ) - testStep = new(ELeave) CFloggerTest025_BuildTestUdeb1; + testStep = new CFloggerTest025_BuildTestUdeb1(); //else if(aStepName.Compare(_L("step_025_BuildTestUdeb2")) == 0 ) - // testStep = new(ELeave) CFloggerTest025_BuildTestUdeb2;//removed-seestep_025_xxx.cpp + // testStep = new CFloggerTest025_BuildTestUdeb2;//removed-seestep_025_xxx.cpp else if(aStepName.Compare(_L("step_025_BuildTestUdeb3")) == 0 ) - testStep = new(ELeave) CFloggerTest025_BuildTestUdeb3; + testStep = new CFloggerTest025_BuildTestUdeb3(); else if(aStepName.Compare(_L("step_025_BuildTestUdeb4")) == 0 ) - testStep = new(ELeave) CFloggerTest025_BuildTestUdeb4; + testStep = new CFloggerTest025_BuildTestUdeb4(); else if(aStepName.Compare(_L("step_025_BuildTestUrel1")) == 0 ) - testStep = new(ELeave) CFloggerTest025_BuildTestUrel1; + testStep = new CFloggerTest025_BuildTestUrel1(); //else if(aStepName.Compare(_L("step_025_BuildTestUrel2")) == 0 ) - // testStep = new(ELeave) CFloggerTest025_BuildTestUrel2;//removed-seestep_025_xxx.cpp + // testStep = new CFloggerTest025_BuildTestUrel2;//removed-seestep_025_xxx.cpp else if(aStepName.Compare(_L("step_025_BuildTestUrel3")) == 0 ) - testStep = new(ELeave) CFloggerTest025_BuildTestUrel3; + testStep = new CFloggerTest025_BuildTestUrel3(); else if(aStepName.Compare(_L("step_025_BuildTestUrel4")) == 0 ) - testStep = new(ELeave) CFloggerTest025_BuildTestUrel4; + testStep = new CFloggerTest025_BuildTestUrel4(); else if(aStepName.Compare(_L("step_026_01")) == 0 ) - testStep = new(ELeave) CFloggerTest026_01; + testStep = new CFloggerTest026_01(); else if(aStepName.Compare(_L("step_026_02")) == 0 ) - testStep = new(ELeave) CFloggerTest026_02; + testStep = new CFloggerTest026_02(); else if(aStepName.Compare(_L("step_026_03")) == 0 ) - testStep = new(ELeave) CFloggerTest026_03; + testStep = new CFloggerTest026_03(); else if(aStepName.Compare(_L("Setup_File")) == 0 ) - testStep = new(ELeave) CFloggerTest_Setup; + testStep = new CFloggerTest_Setup(); else if(aStepName.Compare(_L("Setup_InitializeIniFile")) == 0 ) - testStep = new(ELeave) CFloggerTest_InitializeIniFile; + testStep = new CFloggerTest_InitializeIniFile(); else if(aStepName.Compare(_L("Restore_File")) == 0 ) - testStep = new(ELeave) CFloggerTest_Restore; + testStep = new CFloggerTest_Restore(); else if(aStepName.Compare(_L("step_027_01")) == 0 ) - testStep = new(ELeave) CFloggerTest027_01; + testStep = new CFloggerTest027_01(); else if(aStepName.Compare(_L("step_027_02")) == 0 ) - testStep = new(ELeave) CFloggerTest027_02; + testStep = new CFloggerTest027_02(); else if(aStepName.Compare(_L("step_027_03")) == 0 ) - testStep = new(ELeave) CFloggerTest027_03; + testStep = new CFloggerTest027_03(); else if(aStepName.Compare(_L("step_027_04")) == 0 ) - testStep = new(ELeave) CFloggerTest027_04; + testStep = new CFloggerTest027_04(); else if(aStepName.Compare(_L("step_027_05")) == 0 ) - testStep = new(ELeave) CFloggerTest027_05; + testStep = new CFloggerTest027_05(); else if(aStepName.Compare(_L("step_027_06")) == 0 ) - testStep = new(ELeave) CFloggerTest027_06; + testStep = new CFloggerTest027_06(); else if(aStepName.Compare(_L("step_027_07")) == 0 ) - testStep = new(ELeave) CFloggerTest027_07; + testStep = new CFloggerTest027_07(); else if(aStepName.Compare(_L("step_027_08")) == 0 ) - testStep = new(ELeave) CFloggerTest027_08; + testStep = new CFloggerTest027_08(); else if(aStepName.Compare(_L("step_027_09")) == 0 ) - testStep = new(ELeave) CFloggerTest027_09; + testStep = new CFloggerTest027_09(); else if(aStepName.Compare(_L("step_027_10")) == 0 ) - testStep = new(ELeave) CFloggerTest027_10; + testStep = new CFloggerTest027_10(); else if(aStepName.Compare(_L("step_027_11")) == 0 ) - testStep = new(ELeave) CFloggerTest027_11; + testStep = new CFloggerTest027_11(); else if(aStepName.Compare(_L("step_027_12")) == 0 ) - testStep = new(ELeave) CFloggerTest027_12; + testStep = new CFloggerTest027_12(); else if(aStepName.Compare(_L("step_028_Sync_Setup")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Setup; + testStep = new CFloggerTest028_Sync_Setup(); else if(aStepName.Compare(_L("step_028_Sync_ConWriteUni")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ConWriteUni; + testStep = new CFloggerTest028_Sync_ConWriteUni(); else if(aStepName.Compare(_L("step_028_Sync_ConWriteUniBound")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ConWriteUniBound; + testStep = new CFloggerTest028_Sync_ConWriteUniBound(); else if(aStepName.Compare(_L("step_028_Sync_ConWriteFormatEUni")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ConWriteFormatEUni; + testStep = new CFloggerTest028_Sync_ConWriteFormatEUni(); else if(aStepName.Compare(_L("step_028_Sync_ConWriteFormatEUniBound")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ConWriteFormatEUniBound; + testStep = new CFloggerTest028_Sync_ConWriteFormatEUniBound(); else if(aStepName.Compare(_L("step_028_Sync_ConWriteFormatV8Bit")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ConWriteFormatV8Bit; + testStep = new CFloggerTest028_Sync_ConWriteFormatV8Bit(); else if(aStepName.Compare(_L("step_028_Sync_ConWriteFormatV8BitBound")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ConWriteFormatV8BitBound; + testStep = new CFloggerTest028_Sync_ConWriteFormatV8BitBound(); else if(aStepName.Compare(_L("step_028_Sync_Static_WriteUni")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Static_WriteUni; + testStep = new CFloggerTest028_Sync_Static_WriteUni(); else if(aStepName.Compare(_L("step_028_Sync_Static_WriteUniBound")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Static_WriteUniBound; + testStep = new CFloggerTest028_Sync_Static_WriteUniBound(); else if(aStepName.Compare(_L("step_028_Sync_Static_WriteFormatVUni")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Static_WriteFormatVUni; + testStep = new CFloggerTest028_Sync_Static_WriteFormatVUni(); else if(aStepName.Compare(_L("step_028_Sync_Static_WriteFormatVUniBound")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Static_WriteFormatVUniBound; + testStep = new CFloggerTest028_Sync_Static_WriteFormatVUniBound(); else if(aStepName.Compare(_L("step_028_Sync_Static_HexDump")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Static_HexDump; + testStep = new CFloggerTest028_Sync_Static_HexDump(); else if(aStepName.Compare(_L("step_028_Sync_ClearLog")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ClearLog; + testStep = new CFloggerTest028_Sync_ClearLog(); else if(aStepName.Compare(_L("step_028_Sync_Binary")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Binary; + testStep = new CFloggerTest028_Sync_Binary(); else if(aStepName.Compare(_L("step_028_Sync_ConMultiple")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ConMultiple; + testStep = new CFloggerTest028_Sync_ConMultiple(); else if(aStepName.Compare(_L("step_028_Sync_Static_Multiple")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Static_Multiple; + testStep = new CFloggerTest028_Sync_Static_Multiple(); else if(aStepName.Compare(_L("step_028_Sync_ConMultiple2")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_ConMultiple2; + testStep = new CFloggerTest028_Sync_ConMultiple2(); else if(aStepName.Compare(_L("step_028_Sync_Static_Multiple2")) == 0 ) - testStep = new(ELeave) CFloggerTest028_Sync_Static_Multiple2; + testStep = new CFloggerTest028_Sync_Static_Multiple2(); else if(aStepName.Compare(_L("step_029_IniFile01")) == 0 ) - testStep = new(ELeave) CFloggerTest029_IniFile01; + testStep = new CFloggerTest029_IniFile01(); else if(aStepName.Compare(_L("step_029_IniFile02")) == 0 ) - testStep = new(ELeave) CFloggerTest029_IniFile02; + testStep = new CFloggerTest029_IniFile02(); else if(aStepName.Compare(_L("step_029_IniFile03")) == 0 ) - testStep = new(ELeave) CFloggerTest029_IniFile03; + testStep = new CFloggerTest029_IniFile03(); else if(aStepName.Compare(_L("step_029_IniFile")) == 0 ) - testStep = new(ELeave) CFloggerTest029_IniFile04; + testStep = new CFloggerTest029_IniFile04(); else if(aStepName.Compare(_L("step_029_IniFile04H")) == 0 ) - testStep = new(ELeave) CFloggerTest029_IniFile04H; + testStep = new CFloggerTest029_IniFile04H(); else if(aStepName.Compare(_L("step_030_Tag_Setup")) == 0 ) - testStep = new(ELeave) CFloggerTest030_Tag_Setup; + testStep = new CFloggerTest030_Tag_Setup(); else if(aStepName.Compare(_L("step_030_Tag_TagSetLogTag01")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagSetLogTag01; + testStep = new CFloggerTest030_TagSetLogTag01(); else if(aStepName.Compare(_L("step_030_Tag_TagSetLogTag02")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagSetLogTag02; + testStep = new CFloggerTest030_TagSetLogTag02(); else if(aStepName.Compare(_L("step_030_Tag_TagSetLogTag03")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagSetLogTag03; + testStep = new CFloggerTest030_TagSetLogTag03(); else if(aStepName.Compare(_L("step_030_Tag_TagSetLogTag04")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagSetLogTag04; + testStep = new CFloggerTest030_TagSetLogTag04(); else if(aStepName.Compare(_L("step_030_Tag_TagSetLogTag05")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagSetLogTag05; + testStep = new CFloggerTest030_TagSetLogTag05(); else if(aStepName.Compare(_L("step_030_Tag_TagSetLogTag06")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagSetLogTag06; + testStep = new CFloggerTest030_TagSetLogTag06(); else if(aStepName.Compare(_L("step_030_Tag_TagSetLogTag07")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagSetLogTag07; + testStep = new CFloggerTest030_TagSetLogTag07(); else if(aStepName.Compare(_L("step_030_Tag_TagSetLogTag08")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagSetLogTag08; + testStep = new CFloggerTest030_TagSetLogTag08(); else if(aStepName.Compare(_L("step_030_Tag_TagCreateLog01")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagCreateLog01; + testStep = new CFloggerTest030_TagCreateLog01(); else if(aStepName.Compare(_L("step_030_Tag_TagCreateLog02")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagCreateLog02; + testStep = new CFloggerTest030_TagCreateLog02(); else if(aStepName.Compare(_L("step_030_Tag_TagCreateLog03")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagCreateLog03; + testStep = new CFloggerTest030_TagCreateLog03(); else if(aStepName.Compare(_L("step_030_Tag_TagCreateLog04")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagCreateLog04; + testStep = new CFloggerTest030_TagCreateLog04(); else if(aStepName.Compare(_L("step_030_Tag_TagCreateLog05")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagCreateLog05; + testStep = new CFloggerTest030_TagCreateLog05(); else if(aStepName.Compare(_L("step_030_Tag_TagCreateLog06")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagCreateLog06; + testStep = new CFloggerTest030_TagCreateLog06(); else if(aStepName.Compare(_L("step_030_Tag_TagCreateLog07")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagCreateLog07; + testStep = new CFloggerTest030_TagCreateLog07(); else if(aStepName.Compare(_L("step_030_Tag_TagCreateLog08")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagCreateLog08; + testStep = new CFloggerTest030_TagCreateLog08(); else if(aStepName.Compare(_L("step_030_Tag_TagWrite01")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagWrite01; + testStep = new CFloggerTest030_TagWrite01(); else if(aStepName.Compare(_L("step_030_Tag_TagWrite02")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagWrite02; + testStep = new CFloggerTest030_TagWrite02(); else if(aStepName.Compare(_L("step_030_Tag_TagWrite03")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagWrite03; + testStep = new CFloggerTest030_TagWrite03(); else if(aStepName.Compare(_L("step_030_Tag_TagWrite04")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagWrite04; + testStep = new CFloggerTest030_TagWrite04(); else if(aStepName.Compare(_L("step_030_Tag_TagWrite05")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagWrite05; + testStep = new CFloggerTest030_TagWrite05(); else if(aStepName.Compare(_L("step_030_Tag_TagWrite06")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagWrite06; + testStep = new CFloggerTest030_TagWrite06(); else if(aStepName.Compare(_L("step_030_Tag_TagWrite07")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagWrite07; + testStep = new CFloggerTest030_TagWrite07(); else if(aStepName.Compare(_L("step_030_Tag_TagWrite08")) == 0 ) - testStep = new(ELeave) CFloggerTest030_TagWrite08; + testStep = new CFloggerTest030_TagWrite08(); else if(aStepName.Compare(_L("cdu_performance_test")) == 0 ) - testStep = new(ELeave) CCDUPerformanceTest; + testStep = new CCDUPerformanceTest(); return testStep; diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/commsdebugutility/TE_commsdebugutility/src/step_024_xx.cpp --- a/traceservices/commsdebugutility/TE_commsdebugutility/src/step_024_xx.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/commsdebugutility/TE_commsdebugutility/src/step_024_xx.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2003-2010 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" @@ -75,8 +75,10 @@ INFO_PRINTF1(_L("Step 024.01 called ")); if ( executeStepL() == KErrNone ) SetTestStepResult(EPass); + else SetTestStepResult(EFail); + return TestStepResult(); } @@ -286,8 +288,10 @@ { if ( executeStepL() == KErrNone ) SetTestStepResult(EPass); + else SetTestStepResult(EFail); + return TestStepResult(); } @@ -407,8 +411,10 @@ { if ( executeStepL() == KErrNone ) SetTestStepResult(EPass); + else SetTestStepResult(EFail); + return TestStepResult(); } @@ -558,8 +564,10 @@ { if ( executeStepL() == KErrNone ) SetTestStepResult(EPass); + else SetTestStepResult(EFail); + return TestStepResult(); } @@ -671,8 +679,10 @@ { if ( executeStepL() == KErrNone ) SetTestStepResult(EPass); + else SetTestStepResult(EFail); + return TestStepResult(); } @@ -782,8 +792,10 @@ { if ( executeStepL() == KErrNone ) SetTestStepResult(EPass); + else SetTestStepResult(EFail); + return TestStepResult(); } @@ -902,8 +914,10 @@ INFO_PRINTF1(_L("Step 027.13 called ")); if ( executeStepL() == KErrNone ) SetTestStepResult(EPass); + else SetTestStepResult(EFail); + INFO_PRINTF1(_L("leaving Step 027.13")); User::After(KTimeForDisplay); @@ -1067,8 +1081,10 @@ { if ( executeStepL() == KErrNone ) SetTestStepResult(EPass); + else SetTestStepResult(EFail); + User::After(KTimeForDisplay); @@ -1127,9 +1143,7 @@ User::SetHomeTime(time); TTime currentMicrosecs; - TTimeIntervalDays newDate; currentMicrosecs.HomeTime(); - newDate = currentMicrosecs.DaysFrom(TTime(0)); RFileLogger ::Write(KStdSubsysTag16, KStdCompTag16,EFileLoggingModeAppend, KTestMessage); User::After(KTimeToLog); diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/group/bld.inf --- a/traceservices/tracefw/integ_test/ost/TEF/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -13,75 +13,60 @@ // Description: // - - -/** - @file bld.inf - @internalTechnology -*/ - #include "../perfdevicedriver/group/bld.inf" #include "../tracecontroltestplugin/group/bld.inf" PRJ_PLATFORMS DEFAULT -PRJ_EXPORTS - PRJ_TESTEXPORTS //iby's te_ostv2integsuite.iby /epoc32/rom/include/te_ostv2integsuite.iby //scripts -../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_integ_tracecollectorclient.script -../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient_disabled.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_integ_tracecollectorclient_disabled.script -../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient_enabled.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_integ_tracecollectorclient_enabled.script -../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorsysstart.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_integ_tracecollectorsysstart.script -../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorconfigfile.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_integ_tracecollectorconfigfile.script -../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorconfigfile_winscw.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_integ_tracecollectorconfigfile_winscw.script +../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient.script z:/testdata/scripts/te_integ_tracecollectorclient.script +../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient_disabled.script z:/testdata/scripts/te_integ_tracecollectorclient_disabled.script +../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient_enabled.script z:/testdata/scripts/te_integ_tracecollectorclient_enabled.script +../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorsysstart.script z:/testdata/scripts/te_integ_tracecollectorsysstart.script +../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorconfigfile.script z:/testdata/scripts/te_integ_tracecollectorconfigfile.script +../te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorconfigfile_winscw.script z:/testdata/scripts/te_integ_tracecollectorconfigfile_winscw.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_sanity.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_sanity.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_outputcsvsanity.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_outputcsvsanity.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_default.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_default.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_sanityloop.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_sanityloop.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_sanity_disabled.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_sanity_disabled.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_sanity_enabled.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_sanity_enabled.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_guidelines.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_guidelines.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_guidelines_disabled.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_guidelines_disabled.script -../te_ostv2integsuite_performance/testdata/scripts/te_perf_guidelines_enabled.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_perf_guidelines_enabled.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_sanity.script z:/testdata/scripts/te_perf_sanity.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_outputcsvsanity.script z:/testdata/scripts/te_perf_outputcsvsanity.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_default.script z:/testdata/scripts/te_perf_default.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_sanityloop.script z:/testdata/scripts/te_perf_sanityloop.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_sanity_disabled.script z:/testdata/scripts/te_perf_sanity_disabled.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_sanity_enabled.script z:/testdata/scripts/te_perf_sanity_enabled.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_guidelines.script z:/testdata/scripts/te_perf_guidelines.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_guidelines_disabled.script z:/testdata/scripts/te_perf_guidelines_disabled.script +../te_ostv2integsuite_performance/testdata/scripts/te_perf_guidelines_enabled.script z:/testdata/scripts/te_perf_guidelines_enabled.script //configs -../te_ostv2integsuite_functional/testdata/configs/te_integ_tracecollectorconfigfile_winscw.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_integ_tracecollectorconfigfile_winscw.ini -../te_ostv2integsuite_functional/testdata/configs/te_integ_tracecollectorconfigfile.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_integ_tracecollectorconfigfile.ini -../te_ostv2integsuite_functional/testdata/configs/te_integ_tracecollectorsysstart.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_integ_tracecollectorsysstart.ini -../te_ostv2integsuite_functional/testdata/configs/te_integ_tracecollectorclient.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_integ_tracecollectorclient.ini +../te_ostv2integsuite_functional/testdata/configs/te_integ_tracecollectorconfigfile_winscw.ini z:/testdata/configs/te_integ_tracecollectorconfigfile_winscw.ini +../te_ostv2integsuite_functional/testdata/configs/te_integ_tracecollectorconfigfile.ini z:/testdata/configs/te_integ_tracecollectorconfigfile.ini +../te_ostv2integsuite_functional/testdata/configs/te_integ_tracecollectorsysstart.ini z:/testdata/configs/te_integ_tracecollectorsysstart.ini +../te_ostv2integsuite_functional/testdata/configs/te_integ_tracecollectorclient.ini z:/testdata/configs/te_integ_tracecollectorclient.ini -../te_ostv2integsuite_functional/testdata/configs/configfiletracecontrolconfig.ini /epoc32/release/winscw/udeb/z/testdata/configs/configfiletracecontrolconfig.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_default.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_default.ini -../te_ostv2integsuite_performance/testdata/referencedata/ost_baseline_h4.csv /epoc32/release/winscw/udeb/z/testdata/referencedata/ost_baseline_h4.csv -../te_ostv2integsuite_performance/testdata/referencedata/ost_baseline_h6.csv /epoc32/release/winscw/udeb/z/testdata/referencedata/ost_baseline_h6.csv -../te_ostv2integsuite_performance/testdata/referencedata/ost_baseline_winscw.csv /epoc32/release/winscw/udeb/z/testdata/referencedata/ost_baseline_winscw.csv -../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_con_gmatch_cmatch.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_gon_con_gmatch_cmatch.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_con_gmatch_cmismatch.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_gon_con_gmatch_cmismatch.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_con_gmismatch_cmatch.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_gon_con_gmismatch_cmatch.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_coff_gmatch_cmismatch.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_gon_coff_gmatch_cmismatch.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_coff_gmismatch_cmatch.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_gon_coff_gmismatch_cmatch.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_goff_con_gmismatch_cmatch.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_goff_con_gmismatch_cmatch.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_goff_con_gmatch_cmismatch.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_goff_con_gmatch_cmismatch.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_goff_coff_gmatch_cmatch.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_goff_coff_gmatch_cmatch.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_sanity.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_sanity.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_guidelines.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_guidelines.ini -../te_ostv2integsuite_performance/testdata/configs/te_perf_outputcsvsanity.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_perf_outputcsvsanity.ini - -//export header files for the tcl branch -../te_ostv2integsuite_common/inc/te_dataparameters.h /epoc32/include/tracecontrol_integrationtest/te_dataparameters.h -../te_ostv2integsuite_common/inc/te_ostv2integsuite_defs.h /epoc32/include/tracecontrol_integrationtest/te_ostv2integsuite_defs.h -../../../../common_utils/lightlogger/inc/lightlogger.h /epoc32/include/tracecontrol_integrationtest/lightlogger.h -../../../../common_utils/lightlogger/inc/te_lightlogger.h /epoc32/include/tracecontrol_integrationtest/te_lightlogger.h +../te_ostv2integsuite_functional/testdata/configs/configfiletracecontrolconfig.ini z:/testdata/configs/configfiletracecontrolconfig.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_default.ini z:/testdata/configs/te_perf_default.ini +../te_ostv2integsuite_performance/testdata/referencedata/ost_baseline_h4.csv z:/testdata/referencedata/ost_baseline_h4.csv +../te_ostv2integsuite_performance/testdata/referencedata/ost_baseline_h6.csv z:/testdata/referencedata/ost_baseline_h6.csv +../te_ostv2integsuite_performance/testdata/referencedata/ost_baseline_winscw.csv z:/testdata/referencedata/ost_baseline_winscw.csv +../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_con_gmatch_cmatch.ini z:/testdata/configs/te_perf_gon_con_gmatch_cmatch.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_con_gmatch_cmismatch.ini z:/testdata/configs/te_perf_gon_con_gmatch_cmismatch.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_con_gmismatch_cmatch.ini z:/testdata/configs/te_perf_gon_con_gmismatch_cmatch.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_coff_gmatch_cmismatch.ini z:/testdata/configs/te_perf_gon_coff_gmatch_cmismatch.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_gon_coff_gmismatch_cmatch.ini z:/testdata/configs/te_perf_gon_coff_gmismatch_cmatch.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_goff_con_gmismatch_cmatch.ini z:/testdata/configs/te_perf_goff_con_gmismatch_cmatch.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_goff_con_gmatch_cmismatch.ini z:/testdata/configs/te_perf_goff_con_gmatch_cmismatch.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_goff_coff_gmatch_cmatch.ini z:/testdata/configs/te_perf_goff_coff_gmatch_cmatch.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_sanity.ini z:/testdata/configs/te_perf_sanity.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_guidelines.ini z:/testdata/configs/te_perf_guidelines.ini +../te_ostv2integsuite_performance/testdata/configs/te_perf_outputcsvsanity.ini z:/testdata/configs/te_perf_outputcsvsanity.ini PRJ_TESTMMPFILES -te_ostv2integsuite_enabled.mmp -te_ostv2integsuite_disabled.mmp +te_ostv2integsuite_enabled.mmp manual +te_ostv2integsuite_disabled.mmp manual //above mmp's and configs/scripts etc will eventually just be below bld.infs when binary split done. //#include "../te_ostv2integsuite_common/group/bld.inf" @@ -90,6 +75,3 @@ //move the folder tracefw/integ_test/ost/TEF/traces/... to tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/traces/... when the binary //split is done for the three test binaries: te_ostv2integsuite_common.dll, te_ostv2integsuite_functional.exe. te_ostv2integsuite_perfromance.exe. //Update all mmp's and bld.infs accordingly - - - diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/group/te_ostv2integsuite_disabled.mmp --- a/traceservices/tracefw/integ_test/ost/TEF/group/te_ostv2integsuite_disabled.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/group/te_ostv2integsuite_disabled.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -13,21 +13,31 @@ // Description: // - - -/** - @file te_ostv2integsuite_disabled.mmp - @internalTechnology -*/ TARGET te_ostv2integsuite_disabled.exe TARGETTYPE exe UID 0x1000007A 0x1028722F +CAPABILITY CommDD NetworkControl LocalServices + +EPOCHEAPSIZE 1048576 4194304 //ask why this epocsize MACRO TE_UPT_TRACE_DISABLED //could remove this and just #ifdef on SYMBIAN_TRACE_ENABLE #include epocprocesspriority high +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../te_ostv2integsuite_common/inc/ +USERINCLUDE ../traces +USERINCLUDE ../te_ostv2integsuite_functional/inc/ +USERINCLUDE ../te_ostv2integsuite_performance/inc/ +USERINCLUDE ../te_ostv2integsuite_performance/inc/timer +USERINCLUDE ../te_ostv2integsuite_performance/inc/sanity +USERINCLUDE ../te_ostv2integsuite_performance/inc/csvoutput +USERINCLUDE ../te_ostv2integsuite_functional/inc/record_content +USERINCLUDE ../perfdevicedriver/inc/ +USERINCLUDE ../../../../common_utils/lightlogger/inc + SOURCEPATH ../te_ostv2integsuite_common/src/ SOURCE te_ostv2integsuite_server.cpp SOURCE te_ostv2integsuite_controller.cpp @@ -74,7 +84,6 @@ SOURCE te_perfsanityhelpers.cpp SOURCE te_perfsanitytimer.cpp - SOURCEPATH ../perfdevicedriver/src/ SOURCE te_d32perfdrv.cpp @@ -85,24 +94,6 @@ SOURCEPATH ../te_ostv2integsuite_functional/src/record_content SOURCE te_parser.cpp SOURCE te_tracerecord.cpp - -USERINCLUDE ../te_ostv2integsuite_common/inc/ -USERINCLUDE ../traces -USERINCLUDE ../te_ostv2integsuite_functional/inc/ -USERINCLUDE ../te_ostv2integsuite_performance/inc/ -USERINCLUDE ../te_ostv2integsuite_performance/inc/timer -USERINCLUDE ../te_ostv2integsuite_performance/inc/sanity -USERINCLUDE ../te_ostv2integsuite_performance/inc/csvoutput -USERINCLUDE ../te_ostv2integsuite_functional/inc/record_content -USERINCLUDE ../perfdevicedriver/inc/ -USERINCLUDE ../../../../common_utils/lightlogger/inc - - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/platform - LIBRARY euser.lib LIBRARY testexecuteutils.lib @@ -115,9 +106,4 @@ MACRO __TEST_LIGHTLOGGER_ENABLED MACRO __LIGHTLOGGER_ENABLED - -EPOCHEAPSIZE 1048576 4194304 //ask why this epocsize - -CAPABILITY CommDD NetworkControl LocalServices - SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/group/te_ostv2integsuite_enabled.mmp --- a/traceservices/tracefw/integ_test/ost/TEF/group/te_ostv2integsuite_enabled.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/group/te_ostv2integsuite_enabled.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -13,15 +13,12 @@ // Description: // - - -/** - @file te_ostv2integsuite_enabled.mmp - @internalTechnology -*/ TARGET te_ostv2integsuite_enabled.exe TARGETTYPE exe UID 0x1000007A 0x1028722E +CAPABILITY CommDD NetworkControl LocalServices + +EPOCHEAPSIZE 1048576 4194304 //ask why this epocsize #define SYMBIAN_INCLUDE_EXECUTABLE_TRACE #include @@ -33,6 +30,19 @@ epocprocesspriority high +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../te_ostv2integsuite_common/inc/ +USERINCLUDE ../traces +USERINCLUDE ../te_ostv2integsuite_functional/inc/ +USERINCLUDE ../te_ostv2integsuite_performance/inc/ +USERINCLUDE ../te_ostv2integsuite_performance/inc/timer +USERINCLUDE ../te_ostv2integsuite_performance/inc/sanity +USERINCLUDE ../te_ostv2integsuite_performance/inc/csvoutput +USERINCLUDE ../te_ostv2integsuite_functional/inc/record_content +USERINCLUDE ../perfdevicedriver/inc/ +USERINCLUDE ../../../../common_utils/lightlogger/inc + SOURCEPATH ../te_ostv2integsuite_common/src/ SOURCE te_ostv2integsuite_server.cpp SOURCE te_ostv2integsuite_controller.cpp @@ -79,7 +89,6 @@ SOURCE te_perfsanityhelpers.cpp SOURCE te_perfsanitytimer.cpp - SOURCEPATH ../perfdevicedriver/src/ SOURCE te_d32perfdrv.cpp @@ -90,24 +99,6 @@ SOURCEPATH ../te_ostv2integsuite_functional/src/record_content SOURCE te_parser.cpp SOURCE te_tracerecord.cpp - -USERINCLUDE ../te_ostv2integsuite_common/inc/ -USERINCLUDE ../traces -USERINCLUDE ../te_ostv2integsuite_functional/inc/ -USERINCLUDE ../te_ostv2integsuite_performance/inc/ -USERINCLUDE ../te_ostv2integsuite_performance/inc/timer -USERINCLUDE ../te_ostv2integsuite_performance/inc/sanity -USERINCLUDE ../te_ostv2integsuite_performance/inc/csvoutput -USERINCLUDE ../te_ostv2integsuite_functional/inc/record_content -USERINCLUDE ../perfdevicedriver/inc/ -USERINCLUDE ../../../../common_utils/lightlogger/inc - - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/platform - LIBRARY euser.lib LIBRARY testexecuteutils.lib @@ -122,8 +113,4 @@ MACRO OST_TRACE_COMPILER_IN_USE -EPOCHEAPSIZE 1048576 4194304 //ask why this epocsize - -CAPABILITY CommDD NetworkControl LocalServices - SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/lauterbach_perftimer_tester/group/test_timer_temp.mmp --- a/traceservices/tracefw/integ_test/ost/TEF/lauterbach_perftimer_tester/group/test_timer_temp.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/lauterbach_perftimer_tester/group/test_timer_temp.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,27 +15,22 @@ // This is the project specification file for test_timer_temp. // - - TARGET test_timer_temp.exe TARGETTYPE exe UID 0 0xE48A1B8A -USERINCLUDE ..\inc -SYSTEMINCLUDE \epoc32\include -SYSTEMINCLUDE \epoc32\include\platform +OS_LAYER_SYSTEMINCLUDE -SOURCEPATH ..\src +USERINCLUDE ../inc +USERINCLUDE ../../../performance + +SOURCEPATH ../src SOURCE test_timer_temp.cpp SOURCEPATH ../../../performance SOURCE te_upttimer.cpp -USERINCLUDE ../../../performance - -LIBRARY euser.lib +LIBRARY euser.lib LIBRARY hal.lib SMPSAFE - - diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/eabi/te_optostdddisabledu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/eabi/te_optostdddisabledu.def Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,7 @@ +EXPORTS + _Z19CreateLogicalDevicev @ 1 NONAME + _ZTI17DUptUTraceChannel @ 2 NONAME + _ZTI17DUptUTraceFactory @ 3 NONAME + _ZTV17DUptUTraceChannel @ 4 NONAME + _ZTV17DUptUTraceFactory @ 5 NONAME + diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/eabi/te_optostddenabledu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/eabi/te_optostddenabledu.def Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,7 @@ +EXPORTS + _Z19CreateLogicalDevicev @ 1 NONAME + _ZTI17DUptUTraceChannel @ 2 NONAME + _ZTI17DUptUTraceFactory @ 3 NONAME + _ZTV17DUptUTraceChannel @ 4 NONAME + _ZTV17DUptUTraceFactory @ 5 NONAME + diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/bld.inf --- a/traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -16,10 +16,7 @@ PRJ_PLATFORMS DEFAULT -PRJ_EXPORTS -PRJ_MMPFILES + PRJ_TESTMMPFILES -te_perfdrvenabled.mmp -te_perfdrvdisabled.mmp - -PRJ_TESTEXPORTS +te_perfdrvenabled.mmp manual +te_perfdrvdisabled.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/te_perfdrvdisabled.mmp --- a/traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/te_perfdrvdisabled.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/te_perfdrvdisabled.mmp Mon May 03 14:09:14 2010 +0300 @@ -25,10 +25,7 @@ VENDORID 0x70000001 capability all -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/kernel - +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc/ USERINCLUDE ../../te_ostv2integsuite_common/inc/ @@ -53,13 +50,9 @@ SOURCE te_stackinfo.s #endif - -EPOCALLOWDLLDATA - start wins win32_headers end SMPSAFE - - +epocallowdlldata diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/te_perfdrvenabled.mmp --- a/traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/te_perfdrvenabled.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/perfdevicedriver/group/te_perfdrvenabled.mmp Mon May 03 14:09:14 2010 +0300 @@ -14,7 +14,6 @@ // e32\drivers\trace\tracek.mmp // - #include #define SYMBIAN_TRACE_EXECUTABLE_INCLUDE @@ -30,9 +29,7 @@ VENDORID 0x70000001 capability all -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/kernel +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc/ USERINCLUDE ../../te_ostv2integsuite_common/inc/ @@ -57,12 +54,9 @@ SOURCE te_stackinfo.s #endif - - -EPOCALLOWDLLDATA - start wins win32_headers end SMPSAFE +epocallowdlldata diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_basewrapper.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_basewrapper.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_basewrapper.h Mon May 03 14:09:14 2010 +0300 @@ -22,9 +22,10 @@ #if (!defined TE_ULOGGER_MCL_STEP_BASE) #define TE_ULOGGER_MCL_STEP_BASE -#include +#include #include #include + #include "te_tracerecord.h" #include "te_dataparameters.h" #include "te_parser.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_controller.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_controller.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_controller.h Mon May 03 14:09:14 2010 +0300 @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include class CTe_MCLSuiteController : public CTestBlockController { diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_server.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_server.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_ostv2integsuite_server.h Mon May 03 14:09:14 2010 +0300 @@ -19,7 +19,7 @@ #include #include -#include +#include #include "te_ostv2integsuite_controller.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_tracecontrolclearconfig.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_tracecontrolclearconfig.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_tracecontrolclearconfig.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERCLEARCONFIGSTEP_H) #define TE_ULOGGERCLEARCONFIGSTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_tracecontroldefaultconfig.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_tracecontroldefaultconfig.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_common/inc/te_tracecontroldefaultconfig.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERDEFAULTCONFIGSTEP_H) #define TE_ULOGGERDEFAULTCONFIGSTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_advancedfiltering.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_advancedfiltering.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_advancedfiltering.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERADPAPITESTSTEP_H) #define TE_ULOGGERADPAPITESTSTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_buffermode.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_buffermode.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_buffermode.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERBUFFERMODESTEP_H) #define TE_ULOGGERBUFFERMODESTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_buffersizing.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_buffersizing.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_buffersizing.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERBUFFERSIZINGSTEP_H) #define TE_ULOGGERBUFFERSIZINGSTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_configfile.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_configfile.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_configfile.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERCONFIGFILESTEP_H) #define TE_ULOGGERCONFIGFILESTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_filepluginerr.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_filepluginerr.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_filepluginerr.h Mon May 03 14:09:14 2010 +0300 @@ -22,7 +22,7 @@ #ifndef __TE_ULOGGERFILEPLUGINTESTERR_H__ #define __TE_ULOGGERFILEPLUGINTESTERR_H__ -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_ostv2tracetestwrapper.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_ostv2tracetestwrapper.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_ostv2tracetestwrapper.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -21,7 +21,7 @@ */ #if (!defined TE_OSTV2TRACETESTWRAPPER_H) #define TE_OSTV2TRACETESTWRAPPER_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include @@ -46,6 +46,7 @@ TInt CheckResults(const TDesC& aLogFilename); void TestDuplicatesL(); void TestOstDebugOnlyWrapL(); + void TestOstCompileTimeMacroL(); TInt OpenUlogger(RULogger& aLogger); }; diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorclient.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorclient.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorclient.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERAPITESTSTEP_H) #define TE_ULOGGERAPITESTSTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorfile.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorfile.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorfile.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined __TE_ULOGGERFILEPLUGNSTEP_H__) #define __TE_ULOGGERFILEPLUGNSTEP_H__ -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorserial.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorserial.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/inc/te_tracecollectorserial.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERSERIALPLUGINSTEP_H) #define TE_ULOGGERSERIALPLUGINSTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/src/te_ostv2tracetestwrapper.cpp --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/src/te_ostv2tracetestwrapper.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/src/te_ostv2tracetestwrapper.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -34,6 +34,8 @@ _LIT(KTestOstDebugOnlyWrap, "TestOstDebugOnlyWrap"); +_LIT(KTestOstCompileTimeMacro, "TestOstCompileTimeMacro"); + //macro wrapper that works only in _DEBUG mode #ifndef OST_DEBUG_ONLY #ifdef _DEBUG @@ -95,6 +97,10 @@ { TestOstDebugOnlyWrapL(); } + else if (aCommand == KTestOstCompileTimeMacro()) + { + TestOstCompileTimeMacroL(); + } else { ret = EFalse; @@ -263,7 +269,7 @@ void CTOstv2TraceTestWrapper::TestOstDebugOnlyWrapL() { - INFO_PRINTF1(_L("CTOstv2TraceTestWrapper::TestDuplicates")); + INFO_PRINTF1(_L("CTOstv2TraceTestWrapper::TestOstDebugOnlyWrap")); RULogger logger; @@ -388,6 +394,141 @@ } +void CTOstv2TraceTestWrapper::TestOstCompileTimeMacroL() + { + INFO_PRINTF1(_L("CTOstv2TraceTestWrapper::TestOstCompileTimeMacro")); + + RULogger logger; + + + User::LeaveIfError(OpenUlogger(logger)); + // clear the config file + CClearConfig configIni; + configIni.Clear(logger); + + // switch on primary filtering mechanism + CArrayFixFlat *setprimfilter = + new (ELeave) CArrayFixFlat (22); + setprimfilter->AppendL(KGroupId); + setprimfilter->AppendL(TRACE_NORMAL); + TInt result = logger.SetPrimaryFiltersEnabled(*setprimfilter, ETrue); + + if (result != KErrNone) + { + ERR_PRINTF2(_L("Failed to set Ulogger primary filters result(%d"), result); + SetBlockResult(EFail); + } + + // switch off secondary filtering + result = logger.SetSecondaryFilteringEnabled(EFalse); + if (result != KErrNone) + { + ERR_PRINTF2(_L("Failed to set Ulogger secondary filters result(%d"), result); + SetBlockResult(EFail); + } + + delete setprimfilter; + setprimfilter = NULL; + // setup output file + _LIT(KLogFilename, "C:\\logs\\macro_trace_test.utf"); + EmptyFile(KLogFilename); + // setup ulogger to write to the file using its output plugin + _LIT8(KTextmedia,"uloggerfileplugin"); + TPtrC8 mediaptr(KTextmedia); + result = logger.ActivateOutputPlugin(mediaptr); + if (result == KErrNone) + { + INFO_PRINTF1(_L("file set as active output plugin ok")); + TPluginConfiguration pluginConfig; + _LIT(KTextsetting, "output_path"); + pluginConfig.SetKey(KTextsetting); + pluginConfig.SetValue(KLogFilename()); + result = logger.SetPluginConfigurations(mediaptr, pluginConfig); + if (result == KErrNone) + { + INFO_PRINTF1(_L("output plugin settings set ok")); + + result = logger.Start(); + if (result == KErrNone) + { + // now try some traces with compile time Macros + //OST_TRACE_CATEGORY_DEBUG + #if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_DEBUG) + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER1m, 0); // should be in UDEB only + #endif + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TEST_OSTTRACEWRAPPER1m, "Foo"); + + #ifdef _DEBUG + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER2m, 0); + #endif + OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TEST_OSTTRACEWRAPPER2m, "Foo"); // should be in UBED only + + + //OST_TRACE_CATEGORY_PRODUCTION + #if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_PRODUCTION) + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER3m, 0); + #endif + OstTraceDef0(OST_TRACE_CATEGORY_PRODUCTION, TRACE_NORMAL, TEST_OSTTRACEWRAPPER3m, "Foo"); // should be in UREL and UDEB + + //OST_TRACE_CATEGORY_RND + #if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_RND) + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER4m, 0); + #endif + OstTraceDef0(OST_TRACE_CATEGORY_RND, TRACE_NORMAL, TEST_OSTTRACEWRAPPER4m, "Foo"); // should be in UREL and UDEB + + #if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_PERFORMANCE_MEASUREMENT) + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER5m, 0); + #endif + OstTraceDef0(OST_TRACE_CATEGORY_PERFORMANCE_MEASUREMENT, TRACE_NORMAL, TEST_OSTTRACEWRAPPER5m, "Foo"); // should be in neither UREL nor UDEB + + #if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_NONE) + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER6m, 0); + #endif + OstTraceDef0(OST_TRACE_CATEGORY_NONE, TRACE_NORMAL, TEST_OSTTRACEWRAPPER6m, "Foo"); // should be in neither UREL nor UDEB + + #if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_ALL) + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER7m, 0); + #endif + OstTraceDef0(OST_TRACE_CATEGORY_ALL, TRACE_NORMAL, TEST_OSTTRACEWRAPPER7m, "Foo"); // should be in UREL and UDEB + + #if (OST_TRACE_CATEGORY & (OST_TRACE_CATEGORY_PRODUCTION | OST_TRACE_CATEGORY_DEBUG)) + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER8m, 0); + #endif + OstTraceDef0(OST_TRACE_CATEGORY_PRODUCTION | OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TEST_OSTTRACEWRAPPER8m, "Foo"); // should be in UREL and UDEB + + #if (OST_TRACE_CATEGORY & (OST_TRACE_CATEGORY_PRODUCTION)) || defined (_DEBUG) + AddTraceHelper((TGroupId) TRACE_NORMAL, (TTraceId) TEST_OSTTRACEWRAPPER9m, 0); + #endif + OstTraceDef0(OST_TRACE_CATEGORY_PRODUCTION | OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, TEST_OSTTRACEWRAPPER9m, "Foo"); // should be in UREL and UDEB + + + result = logger.Stop(); + + if (result == KErrNone) + { + SetBlockResult( + CheckResults(KLogFilename()) == KErrNone + ? EPass + : EFail); + } + } + else + { + INFO_PRINTF2(_L("ulogger start returns error %d"), result); + } + } + else + { + INFO_PRINTF2(_L("setting output plugin settings failed with err %d"), result); + } + } + else + { + INFO_PRINTF2(_L("add file as output plugin failed with err %d"), result); + } + } + + TInt CTOstv2TraceTestWrapper::CheckResults(const TDesC& aLogFilename) { // read the logged traces from the log file diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient.script --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient.script Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_functional/testdata/scripts/te_integ_tracecollectorclient.script Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -48,3 +48,22 @@ +START_TESTCASE DT-DEBUG-TRACE-OSTv2-TraceControlCompileTimeSelector-0001 +//! @SYMTestCaseID DT-DEBUG-TRACE-OSTv2-TraceControlCompileTimeSelector-0001 +//! @SYMTestCaseDesc Test DEBUG only compile time selector using OST_TRACE_CATEGORY_DEBUG +//! @SYMTestPriority Critical +//! @SYMTestActions +//! @SYMTestExpectedResults Verify that the errors returned are as expected +//! @SYMTestType CT +//! @SYMTESTSTATUS Implemented +//! @SYMPREQ PREQ2390 +//! @SYMREQ + +PRINT Run OstTrace with OST_TRACE_CATEGORY_DEBUG compile time Macro +START_TEST_BLOCK 20000 te_ostv2integsuite_enabled \testdata\configs\te_integ_tracecollectorclient.ini + CREATE_OBJECT OstTraceTestWrapper OstTraceTestWrapper + COMMAND OstTraceTestWrapper TestOstCompileTimeMacro +END_TEST_BLOCK +END_TESTCASE DT-DEBUG-TRACE-OSTv2-TraceControlCompileTimeSelector-0001 + + diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perf.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perf.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perf.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_ULOGGERMCLPERFSTEP_H) #define TE_ULOGGERMCLPERFSTEP_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perfoutputsanity.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perfoutputsanity.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perfoutputsanity.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_OUTPUTSANITYTEST_H) #define TE_OUTPUTSANITYTEST_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perfsanity.h --- a/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perfsanity.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/inc/te_perfsanity.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #if (!defined TE_PERFORMANCESANITYTEST_H) #define TE_PERFORMANCESANITYTEST_H -#include +#include #include "te_ostv2integsuite_basewrapper.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/group/bld.inf --- a/traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -13,18 +13,11 @@ // Description: // -/** - @file bld.inf - @internalTechnology -*/ PRJ_PLATFORMS DEFAULT -PRJ_EXPORTS - PRJ_TESTEXPORTS -//iby's -te_tracecontrol_testplugin.iby /epoc32/rom/include/te_tracecontrol_testplugin.iby +te_tracecontrol_testplugin.iby /epoc32/rom/include/te_tracecontrol_testplugin.iby PRJ_TESTMMPFILES -te_tracecontrol_testplugin.mmp +te_tracecontrol_testplugin.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/group/te_tracecontrol_testplugin.mmp --- a/traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/group/te_tracecontrol_testplugin.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/group/te_tracecontrol_testplugin.mmp Mon May 03 14:09:14 2010 +0300 @@ -14,19 +14,15 @@ // Te_tracecontrol_FilePlugin.dll ULogger & Framework File Test plug-in // - - -/** - @file te_tracecontroltestplugin.mmp - @internalTechnology -*/ - TARGET te_tracecontrol_testplugin.dll TARGETTYPE PLUGIN UID 0x10009D8D 0x10287231 VENDORID 0x70000001 +CAPABILITY CommDD NetworkControl LocalServices ProtServ NetworkServices -CAPABILITY CommDD NetworkControl LocalServices ProtServ NetworkServices +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc/ SOURCEPATH ../src/ SOURCE te_tracecontroltestplugin.cpp @@ -36,12 +32,10 @@ TARGET te_tracecontrol_testplugin.rsc end - -USERINCLUDE ../inc/ -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/platform - -LIBRARY euser.lib efsrv.lib c32.lib ecom.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY c32.lib +LIBRARY ecom.lib SMPSAFE +epocallowdlldata diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/resource/10287231.rss --- a/traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/resource/10287231.rss Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/resource/10287231.rss Mon May 03 14:09:14 2010 +0300 @@ -14,7 +14,7 @@ // 10287231.RSS -- for outfrwkinterface definitions // -#include "registryinfo.rh" +#include RESOURCE REGISTRY_INFO r_registry { diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/src/te_tracecontroltestplugin.cpp --- a/traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/src/te_tracecontroltestplugin.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/tracecontroltestplugin/src/te_tracecontroltestplugin.cpp Mon May 03 14:09:14 2010 +0300 @@ -22,7 +22,8 @@ #include #include -#include +#include + #include "te_tracecontroltestplugin.h" #if defined(__TEST_LIGHTLOGGER_ENABLED) diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/traces/fixed_id.definitions --- a/traceservices/tracefw/integ_test/ost/TEF/traces/fixed_id.definitions Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/traces/fixed_id.definitions Mon May 03 14:09:14 2010 +0300 @@ -3,6 +3,7 @@ [GROUP]TRACE_DUMP=0x89 [GROUP]TRACE_FATAL=0x81 [GROUP]TRACE_FLOW=0x8a +[GROUP]TRACE_NORMAL=0x86 [GROUP]TRACE_PERFORMANCE=0x8b [GROUP]TRACE_STATE=0x87 [GROUP]USER_DEFINED_GID_1=0xdf @@ -46,6 +47,15 @@ [TRACE]TRACE_FLOW[0x8A]_TEST_OSTTraceFunctionalityEntry1=0x4 [TRACE]TRACE_FLOW[0x8A]_TEST_OSTTraceFunctionalityExt=0x5 [TRACE]TRACE_FLOW[0x8A]_TEST_OstTraceFunctionExit0=0x6 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER1m=0x1 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER2m=0x2 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER3m=0x3 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER4m=0x4 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER5m=0x5 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER6m=0x6 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER7m=0x7 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER8m=0x8 +[TRACE]TRACE_NORMAL[0x86]_TEST_OSTTRACEWRAPPER9m=0x9 [TRACE]TRACE_PERFORMANCE[0x8B]_TEST_OSTTRACEEVENTSTART0=0x1 [TRACE]TRACE_PERFORMANCE[0x8B]_TEST_OSTTRACEEVENTSTART1=0x2 [TRACE]TRACE_PERFORMANCE[0x8B]_TEST_OSTTRACEEVENTSTOP=0x3 diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/traces/te_advancedfilteringTraces.h --- a/traceservices/tracefw/integ_test/ost/TEF/traces/te_advancedfilteringTraces.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/traces/te_advancedfilteringTraces.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Created by TraceCompiler 2.1.3 +// Created by TraceCompiler 2.1.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __TE_ADVANCEDFILTERINGTRACES_H__ diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/traces/te_ctorTraces.h --- a/traceservices/tracefw/integ_test/ost/TEF/traces/te_ctorTraces.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/traces/te_ctorTraces.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Created by TraceCompiler 2.1.3 +// Created by TraceCompiler 2.1.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __TE_CTORTRACES_H__ diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/traces/te_ctor_disabledTraces.h --- a/traceservices/tracefw/integ_test/ost/TEF/traces/te_ctor_disabledTraces.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/traces/te_ctor_disabledTraces.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Created by TraceCompiler 2.1.3 +// Created by TraceCompiler 2.1.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __TE_CTOR_DISABLEDTRACES_H__ diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/traces/te_instrumentationpoints_disabledTraces.h --- a/traceservices/tracefw/integ_test/ost/TEF/traces/te_instrumentationpoints_disabledTraces.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/traces/te_instrumentationpoints_disabledTraces.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Created by TraceCompiler 2.1.3 +// Created by TraceCompiler 2.1.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __TE_INSTRUMENTATIONPOINTS_DISABLEDTRACES_H__ diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/traces/te_instrumentationpoints_enabledTraces.h --- a/traceservices/tracefw/integ_test/ost/TEF/traces/te_instrumentationpoints_enabledTraces.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/traces/te_instrumentationpoints_enabledTraces.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Created by TraceCompiler 2.1.3 +// Created by TraceCompiler 2.1.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __TE_INSTRUMENTATIONPOINTS_ENABLEDTRACES_H__ diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ost/TEF/traces/te_ostv2tracetestwrapperTraces.h --- a/traceservices/tracefw/integ_test/ost/TEF/traces/te_ostv2tracetestwrapperTraces.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ost/TEF/traces/te_ostv2tracetestwrapperTraces.h Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Created by TraceCompiler 2.1.3 +// Created by TraceCompiler 2.1.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __TE_OSTV2TRACETESTWRAPPERTRACES_H__ @@ -22,6 +22,15 @@ #define TEST_OSTTRACEWRAPPER7w 0xdf0002 #define TEST_OSTTRACEWRAPPER8 0xe00001 #define TEST_OSTTRACEWRAPPER8w 0xe00002 +#define TEST_OSTTRACEWRAPPER1m 0x860001 +#define TEST_OSTTRACEWRAPPER2m 0x860002 +#define TEST_OSTTRACEWRAPPER3m 0x860003 +#define TEST_OSTTRACEWRAPPER4m 0x860004 +#define TEST_OSTTRACEWRAPPER5m 0x860005 +#define TEST_OSTTRACEWRAPPER6m 0x860006 +#define TEST_OSTTRACEWRAPPER7m 0x860007 +#define TEST_OSTTRACEWRAPPER8m 0x860008 +#define TEST_OSTTRACEWRAPPER9m 0x860009 #endif diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/device-driver/group/bld.inf --- a/traceservices/tracefw/integ_test/ulogger/TEF/device-driver/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/device-driver/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -12,10 +12,6 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ PRJ_TESTMMPFILES //usbc.mmp diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/device-driver/group/usbc.mmp --- a/traceservices/tracefw/integ_test/ulogger/TEF/device-driver/group/usbc.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/device-driver/group/usbc.mmp Mon May 03 14:09:14 2010 +0300 @@ -17,22 +17,24 @@ #include "../../kernel/kern_ext.mmh" -systeminclude ../../include/drivers -systeminclude \epoc32\include\ulogger_integrationtest +target usbc.ldd +targettype ldd +uid 0 0x101F8928 +VENDORID 0x70000001 +capability all + +OS_LAYER_SYSTEMINCLUDE -target usbc.ldd -targettype ldd -source d_usbc.cpp usbdma.cpp //te_utracecmds.cpp# -sourcepath \epoc32\include\ulogger_integrationtest -source te_utracecmds.cpp -library ekern.lib usbcc.lib -epocallowdlldata +sourcepath ..\src +source d_usbc.cpp +source usbdma.cpp + +sourcepath ..\..\te_ulogger\src +source te_utracecmds.cpp + +library ekern.lib +library usbcc.lib MACRO SYMBIAN_TRACE_ENABLE - -uid 0 0x101F8928 -VENDORID 0x70000001 -capability all - SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/group/bld.inf --- a/traceservices/tracefw/integ_test/ulogger/TEF/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -12,10 +12,6 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ #include "../device-driver/group/bld.inf" #include "../testplugin/group/bld.inf" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/bld.inf --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -13,67 +13,16 @@ // Description: // -/** - @file bld.inf - @internalTechnology -*/ -PRJ_PLATFORMS - - -PRJ_EXPORTS - PRJ_TESTEXPORTS - -//to c: -../scripts/te_uloggermclsuite.script /epoc32/winscw/c/testdata/scripts/te_uloggermclsuite.script -../scripts/te_uloggermclperfsuite.script /epoc32/winscw/c/testdata/scripts/te_uloggermclperfsuite.script -../scripts/te_uloggersysstart.script /epoc32/winscw/c/testdata/scripts/te_uloggersysstart.script -../scripts/te_uloggerconfigfile.script /epoc32/winscw/c/testdata/scripts/te_uloggerconfigfile.script -../scripts/te_uloggerconfigfile_winscw.script /epoc32/winscw/c/testdata/scripts/te_uloggerconfigfile_winscw.script -./configfileuloggerconfig.ini /epoc32/winscw/c/ulogger/configfileuloggerconfig.ini -//to z: -../scripts/te_uloggermclsuite.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_uloggermclsuite.script -../scripts/te_uloggermclperfsuite.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_uloggermclperfsuite.script -../scripts/te_uloggersysstart.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_uloggersysstart.script -../scripts/te_uloggerconfigfile.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_uloggerconfigfile.script -../scripts/te_uloggerconfigfile_winscw.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_uloggerconfigfile_winscw.script -./configfileuloggerconfig.ini /epoc32/release/winscw/udeb/z/ulogger/configfileuloggerconfig.ini - -./te_uloggermclsuite.iby /epoc32/rom/include/te_uloggermclsuite.iby +te_uloggermclsuite.iby /epoc32/rom/include/te_uloggermclsuite.iby -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -#endif -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../inc/te_setfilterparameters.h /epoc32/include/ulogger_integrationtest/te_setfilterparameters.h -#endif -../inc/te_setfilterparameters.h /epoc32/rom/include/ulogger_integrationtest/te_setfilterparameters.h -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../inc/te_utracecmds.h /epoc32/include/ulogger_integrationtest/te_utracecmds.h -#endif -../inc/te_utracecmds.h /epoc32/rom/include/ulogger_integrationtest/te_utracecmds.h -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../src/te_utracecmds.cpp /epoc32/include/ulogger_integrationtest/te_utracecmds.cpp -#endif -../src/te_utracecmds.cpp /epoc32/rom/include/ulogger_integrationtest/te_utracecmds.cpp -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../inc/te_utracekernelcmds.h /epoc32/include/ulogger_integrationtest/te_utracekernelcmds.h -#endif -../inc/te_utracekernelcmds.h /epoc32/rom/include/ulogger_integrationtest/te_utracekernelcmds.h -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../src/te_utracekernelcmds.cpp /epoc32/include/ulogger_integrationtest/te_utracekernelcmds.cpp -#endif -../src/te_utracekernelcmds.cpp /epoc32/rom/include/ulogger_integrationtest/te_utracekernelcmds.cpp -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../inc/te_uloggermclsuitedefs.h /epoc32/include/ulogger_integrationtest/te_uloggermclsuitedefs.h -#endif -../inc/te_uloggermclsuitedefs.h /epoc32/rom/include/ulogger_integrationtest/te_uloggermclsuitedefs.h -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../src/te_uloggermclsuitedefs.cpp /epoc32/include/ulogger_integrationtest/te_uloggermclsuitedefs.cpp -#endif -../src/te_uloggermclsuitedefs.cpp /epoc32/rom/include/ulogger_integrationtest/te_uloggermclsuitedefs.cpp +../scripts/te_uloggermclsuite.script z:/testdata/scripts/te_uloggermclsuite.script +../scripts/te_uloggermclperfsuite.script z:/testdata/scripts/te_uloggermclperfsuite.script +../scripts/te_uloggersysstart.script z:/testdata/scripts/te_uloggersysstart.script +../scripts/te_uloggerconfigfile.script z:/testdata/scripts/te_uloggerconfigfile.script +../scripts/te_uloggerconfigfile_winscw.script z:/testdata/scripts/te_uloggerconfigfile_winscw.script -PRJ_MMPFILES +configfileuloggerconfig.ini z:/ulogger/configfileuloggerconfig.ini PRJ_TESTMMPFILES - -te_uloggermclsuite.mmp +te_uloggermclsuite.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/te_uloggermclsuite.iby --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/te_uloggermclsuite.iby Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/te_uloggermclsuite.iby Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -18,10 +18,10 @@ #include #include -file=ABI_DIR\BUILD_DIR\te_uloggermclsuite.exe sys\bin\te_uloggermclsuite.exe -data=EPOCROOT##Epoc32\winscw\c\TestData\scripts\te_uloggermclsuite.script TestData\Scripts\te_uloggermclsuite.script -data=EPOCROOT##Epoc32\winscw\c\TestData\scripts\te_uloggermclperfsuite.script TestData\Scripts\te_uloggermclperfsuite.script -data=EPOCROOT##Epoc32\winscw\c\TestData\scripts\te_uloggersysstart.script TestData\Scripts\te_uloggersysstart.script -data=EPOCROOT##Epoc32\winscw\c\TestData\scripts\te_uloggerconfigfile.script TestData\Scripts\te_uloggerconfigfile.script +file=ABI_DIR\BUILD_DIR\te_uloggermclsuite.exe sys\bin\te_uloggermclsuite.exe +data=DATAZ_\TestData\scripts\te_uloggermclsuite.script TestData\Scripts\te_uloggermclsuite.script +data=DATAZ_\TestData\scripts\te_uloggermclperfsuite.script TestData\Scripts\te_uloggermclperfsuite.script +data=DATAZ_\TestData\scripts\te_uloggersysstart.script TestData\Scripts\te_uloggersysstart.script +data=DATAZ_\TestData\scripts\te_uloggerconfigfile.script TestData\Scripts\te_uloggerconfigfile.script #endif diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/te_uloggermclsuite.mmp --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/te_uloggermclsuite.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/group/te_uloggermclsuite.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -13,15 +13,19 @@ // Description: // -/** - @file te_uloggermclsuite.mmp - @internalTechnology -*/ TARGET te_uloggermclsuite.exe TARGETTYPE exe - UID 0x1000007A 0x10285835 - -//Please add any change under here +UID 0x1000007A 0x10285835 +CAPABILITY CommDD NetworkControl LocalServices + +EPOCHEAPSIZE 1048576 4194304 + +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../../../../common_utils/lightlogger/inc +USERINCLUDE ../../../../../common_utils + SOURCEPATH ../src SOURCE te_uloggermclsuiteserver.cpp SOURCE te_uloggermclsuitestepbase.cpp @@ -38,32 +42,16 @@ SOURCE te_uloggerfilepluginsteperr.cpp SOURCE te_uloggermclperfstep.cpp -USERINCLUDE ../inc -USERINCLUDE ../../../../../common_utils/lightlogger/inc - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/ulogger_integrationtest -SYSTEMINCLUDE /epoc32/include/ecom - - -//Please add your system include under here. - LIBRARY euser.lib -LIBRARY testexecuteutils.lib -LIBRARY testexecutelogclient.lib -LIBRARY efsrv.lib -LIBRARY uloggerclient.lib -LIBRARY hal.lib +LIBRARY testexecuteutils.lib +LIBRARY testexecutelogclient.lib +LIBRARY efsrv.lib +LIBRARY uloggerclient.lib +LIBRARY hal.lib LIBRARY serialdriver.lib ecom.lib MACRO __LIGHTLOGGER_ENABLED MACRO SYMBIAN_TRACE_ENABLE - -EPOCHEAPSIZE 1048576 4194304 - -CAPABILITY CommDD NetworkControl LocalServices -USERINCLUDE ../../../../../common_utils - SMPSAFE +epocallowdlldata diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerapiteststep.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerapiteststep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerapiteststep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TE_ULOGGERAPITESTSTEP_H__) #define __TE_ULOGGERAPITESTSTEP_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerbuffermodestep.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerbuffermodestep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerbuffermodestep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TE_ULOGGERBUFFERMODESTEP_H__) #define __TE_ULOGGERBUFFERMODESTEP_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerbuffersizingstep.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerbuffersizingstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerbuffersizingstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TE_ULOGGERBUFFERSIZINGSTEP_H__) #define __TE_ULOGGERBUFFERSIZINGSTEP_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerclearconfigstep.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerclearconfigstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerclearconfigstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TE_ULOGGERCLEARCONFIGSTEP_H__) #define __TE_ULOGGERCLEARCONFIGSTEP_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerconfigfilestep.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerconfigfilestep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerconfigfilestep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TE_ULOGGERCONFIGFILESTEP_H__) #define __TE_ULOGGERCONFIGFILESTEP_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerfilepluginstep.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerfilepluginstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerfilepluginstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TE_ULOGGERFILEPLUGNSTEP_H__) #define __TE_ULOGGERFILEPLUGNSTEP_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerfilepluginsteperr.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerfilepluginsteperr.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerfilepluginsteperr.h Mon May 03 14:09:14 2010 +0300 @@ -25,7 +25,7 @@ #ifndef __TE_ULOGGERFILEPLUGINTESTERR_H__ #define __TE_ULOGGERFILEPLUGINTESTERR_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclperfstep.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclperfstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclperfstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TE_ULOGGERMCLPERFSTEP_H__) #define __TE_ULOGGERMCLPERFSTEP_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include "te_utracecmds.h" #include "te_utracekernelcmds.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclsuiteserver.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclsuiteserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclsuiteserver.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_ULOGGER_MCL_SERVER_H__) #define __TE_ULOGGER_MCL_SERVER_H__ -#include +#include class CTe_ULoggerMCLSuite : public CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclsuitestepbase.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclsuitestepbase.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggermclsuitestepbase.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_ULOGGER_MCL_STEP_BASE__) #define __TE_ULOGGER_MCL_STEP_BASE__ -#include +#include // Please add your include here if you have /**************************************************************************** diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerserialpluginstep.h --- a/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerserialpluginstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/te_ulogger/inc/te_uloggerserialpluginstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TE_ULOGGERSERIALPLUGINSTEP_H__) #define __TE_ULOGGERSERIALPLUGINSTEP_H__ -#include +#include #include "te_uloggermclsuitestepbase.h" #include #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/testplugin/group/bld.inf --- a/traceservices/tracefw/integ_test/ulogger/TEF/testplugin/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/testplugin/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -12,14 +12,9 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ - PRJ_TESTEXPORTS -./te_uloggermcl.iby /epoc32/rom/include/te_uloggermcl.iby +te_uloggermcl.iby /epoc32/rom/include/te_uloggermcl.iby PRJ_TESTMMPFILES -te_fileplugin.mmp +te_fileplugin.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/testplugin/group/te_fileplugin.mmp --- a/traceservices/tracefw/integ_test/ulogger/TEF/testplugin/group/te_fileplugin.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/testplugin/group/te_fileplugin.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,19 +15,16 @@ // // -/** - @file te_fileplugin.mmp - @internalTechnology -*/ +TARGET te_fileplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10273888 +VENDORID 0x70000001 +CAPABILITY CommDD NetworkControl LocalServices ProtServ NetworkServices -TARGET te_fileplugin.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x10273888 -VENDORID 0x70000001 - -CAPABILITY CommDD NetworkControl LocalServices ProtServ NetworkServices +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc/ + SOURCEPATH ../src/ SOURCE te_fileplugin.cpp @@ -36,9 +33,9 @@ TARGET te_fileplugin.rsc end -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/ecom - -LIBRARY euser.lib efsrv.lib c32.lib ecom.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY c32.lib +LIBRARY ecom.lib SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/integ_test/ulogger/TEF/testplugin/src/te_fileplugin.cpp --- a/traceservices/tracefw/integ_test/ulogger/TEF/testplugin/src/te_fileplugin.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/integ_test/ulogger/TEF/testplugin/src/te_fileplugin.cpp Mon May 03 14:09:14 2010 +0300 @@ -20,7 +20,8 @@ #include #include -#include +#include + #include "te_fileplugin.h" #if defined(__LIGHTLOGGER_ENABLED) diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/devicedriver/eabi/te_ostdd_disabledu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/eabi/te_ostdd_disabledu.def Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,7 @@ +EXPORTS + _Z19CreateLogicalDevicev @ 1 NONAME + _ZTI14DUTraceChannel @ 2 NONAME + _ZTI14DUTraceFactory @ 3 NONAME + _ZTV14DUTraceChannel @ 4 NONAME + _ZTV14DUTraceFactory @ 5 NONAME + diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/devicedriver/eabi/te_ostdd_enabledu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/eabi/te_ostdd_enabledu.def Mon May 03 14:09:14 2010 +0300 @@ -0,0 +1,7 @@ +EXPORTS + _Z19CreateLogicalDevicev @ 1 NONAME + _ZTI14DUTraceChannel @ 2 NONAME + _ZTI14DUTraceFactory @ 3 NONAME + _ZTV14DUTraceChannel @ 4 NONAME + _ZTV14DUTraceFactory @ 5 NONAME + diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/bld.inf --- a/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -16,10 +16,7 @@ PRJ_PLATFORMS DEFAULT -PRJ_EXPORTS -PRJ_MMPFILES + PRJ_TESTMMPFILES -te_utracedrv_enabled.mmp -te_utracedrv_disabled.mmp - -PRJ_TESTEXPORTS +te_utracedrv_enabled.mmp manual +te_utracedrv_disabled.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/te_utracedrv_disabled.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/te_utracedrv_disabled.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/te_utracedrv_disabled.mmp Mon May 03 14:09:14 2010 +0300 @@ -23,16 +23,17 @@ VENDORID 0x70000001 capability all -USERINCLUDE ../inc/ -USERINCLUDE ../../te_ost/inc/ -SYSTEMINCLUDE /epoc32/include/platform -SYSTEMINCLUDE /epoc32/include/kernel +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc/ +USERINCLUDE ../../te_ost/inc/ MACRO TE_MODULE_UID=0 MACRO EXECUTABLE_DEFAULT_MODULEUID=6666 SOURCEPATH ../src/ SOURCE te_utracedrv.cpp + SOURCEPATH ../../te_ost/src/ SOURCE te_tracerecord.cpp SOURCE te_kerneltimer.cpp diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/te_utracedrv_enabled.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/te_utracedrv_enabled.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/group/te_utracedrv_enabled.mmp Mon May 03 14:09:14 2010 +0300 @@ -25,30 +25,29 @@ VENDORID 0x70000001 capability all +always_build_as_arm + +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc/ USERINCLUDE ../../te_ost/inc/ -SYSTEMINCLUDE /epoc32/include/platform -SYSTEMINCLUDE /epoc32/include/kernel - MACRO TE_MODULE_UID=0 MACRO EXECUTABLE_DEFAULT_MODULEUID=6666 +SOURCEPATH ../src/ +SOURCE te_utracedrv.cpp + +SOURCEPATH ../../te_ost/src/ +SOURCE te_tracerecord.cpp +SOURCE te_kerneltimer.cpp + start wins win32_headers end LIBRARY te_ost_lauterbach_kernel.lib -SOURCEPATH ../src/ -SOURCE te_utracedrv.cpp -SOURCEPATH ../../te_ost/src/ -SOURCE te_tracerecord.cpp -SOURCE te_kerneltimer.cpp - - -always_build_as_arm SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/devicedriver/inc/d32utrace.h --- a/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/inc/d32utrace.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/devicedriver/inc/d32utrace.h Mon May 03 14:09:14 2010 +0300 @@ -28,6 +28,7 @@ #endif #include #include + #include "te_tracerecord.h" //needs to be the filename of the driver diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/group/bld.inf --- a/traceservices/tracefw/ost_trace_api/unit_test/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -12,10 +12,6 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ #include "../lauterbach_perf_tester/group/bld.inf" #include "../devicedriver/group/bld.inf" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/bld.inf --- a/traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -12,18 +12,10 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ - PRJ_PLATFORMS DEFAULT -PRJ_EXPORTS -PRJ_MMPFILES + PRJ_TESTMMPFILES -te_lauterbach.mmp -te_lauterbach_kernel.mmp - -PRJ_TESTEXPORTS +te_lauterbach.mmp manual +te_lauterbach_kernel.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/te_lauterbach.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/te_lauterbach.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/te_lauterbach.mmp Mon May 03 14:09:14 2010 +0300 @@ -17,9 +17,9 @@ TARGET te_ost_lauterbach.dll //user side enabled TARGETTYPE dll UID 0x1000008d 0x10287236 +CAPABILITY All -SYSTEMINCLUDE \epoc32\include -SYSTEMINCLUDE \epoc32\include\platform +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc/ @@ -34,10 +34,6 @@ DEFFILE ..\eabi\te_lauterbach.def #endif - -CAPABILITY All - - OPTION ARMCC --interleave SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/te_lauterbach_kernel.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/te_lauterbach_kernel.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/lauterbach_perf_tester/group/te_lauterbach_kernel.mmp Mon May 03 14:09:14 2010 +0300 @@ -13,28 +13,26 @@ // Description: // +#include -#include "..\kernel\kern_ext.mmh" -TARGET te_ost_lauterbach_kernel.dll //kernel side +TARGET te_ost_lauterbach_kernel.dll TARGETTYPE kdll UID 0x1000008d 0x10287237 +CAPABILITY All -SYSTEMINCLUDE /epoc32/include/platform -SYSTEMINCLUDE /epoc32/include/kernel +OS_LAYER_SYSTEMINCLUDE + USERINCLUDE ../inc/ SOURCEPATH ../src/ SOURCE te_trace_for_lauterbach.cpp -CAPABILITY All - #if defined (WINS) - DEFFILE ..\bwins\te_lauterbach_kernel.def + DEFFILE ../bwins/te_lauterbach_kernel.def #else - DEFFILE ..\eabi\te_lauterbach_kernel.def + DEFFILE ../eabi/te_lauterbach_kernel.def #endif - OPTION ARMCC --interleave SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/bld.inf --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -12,34 +12,17 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ - -PRJ_EXPORTS -PRJ_MMPFILES - PRJ_TESTEXPORTS - -//to c: -../scripts/te_ostsuite.script /epoc32/winscw/c/testdata/scripts/te_ostsuite.script -../testdata/te_ost_trace_user.ini /epoc32/winscw/c/testdata/configs/te_ost_trace_user.ini +te_ost.iby /epoc32/rom/include/te_ost.iby -//to z: -../scripts/te_ostsuite.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_ostsuite.script -../testdata/te_ost_trace_user.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_ost_trace_user.ini - - -te_ost.iby /epoc32/rom/include/te_ost.iby - +../scripts/te_ostsuite.script z:/testdata/scripts/te_ostsuite.script +../testdata/te_ost_trace_user.ini z:/testdata/configs/te_ost_trace_user.ini PRJ_TESTMMPFILES -te_trace_disabled_suite.mmp -te_trace_enabled_suite.mmp -te_record_content_suite.mmp -te_multiparttrace.mmp -te_ost_marcos_enabled.mmp -te_ost_marcos_disabled.mmp - +te_trace_disabled_suite.mmp manual +te_trace_enabled_suite.mmp manual +te_record_content_suite.mmp manual +te_multiparttrace.mmp manual +te_ost_marcos_enabled.mmp manual +te_ost_marcos_disabled.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_multiparttrace.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_multiparttrace.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_multiparttrace.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -17,12 +17,18 @@ TARGETTYPE exe UID 0x1000007A 0x10287238 -#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE +#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE #include MACRO TE_MULTIPART_TRACE epocprocesspriority high +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../lauterbach_perf_tester/inc +USERINCLUDE ../../devicedriver/inc + SOURCEPATH ../src SOURCE te_multiparttrace.cpp SOURCE te_suite_step_base.cpp @@ -41,16 +47,6 @@ SOURCE uloggerconfig.cpp SOURCE te_usertimer.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../lauterbach_perf_tester/inc -USERINCLUDE ../../devicedriver/inc - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/platform - - LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_ost_marcos_disabled.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_ost_marcos_disabled.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_ost_marcos_disabled.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -17,12 +17,18 @@ TARGETTYPE exe UID 0x1000007A 0xE13C6AED -#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE +#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE #include MACRO TE_OST_MACROS_DISABLED //MACRO OST_TRACE_COMPILER_IN_USE +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../devicedriver/inc/ +USERINCLUDE ../../lauterbach_perf_tester/inc/ + SOURCEPATH ../src SOURCE te_apicaller.cpp SOURCE uloggerconfig.cpp @@ -40,15 +46,6 @@ SOURCE te_multiparttrace.cpp SOURCE te_macrostest_disabled.cpp -USERINCLUDE ../inc -USERINCLUDE ../../devicedriver/inc/ -USERINCLUDE ../../lauterbach_perf_tester/inc/ - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/platform - - LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_ost_marcos_enabled.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_ost_marcos_enabled.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_ost_marcos_enabled.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -17,12 +17,18 @@ TARGETTYPE exe UID 0x1000007A 0xED92FE5F -#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE +#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE #include MACRO TE_OST_MACROS_ENABLED MACRO OST_TRACE_COMPILER_IN_USE +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../devicedriver/inc/ +USERINCLUDE ../../lauterbach_perf_tester/inc/ + SOURCEPATH ../src SOURCE te_apicaller.cpp SOURCE uloggerconfig.cpp @@ -40,15 +46,6 @@ SOURCE te_multiparttrace.cpp SOURCE te_macrostest_disabled.cpp -USERINCLUDE ../inc -USERINCLUDE ../../devicedriver/inc/ -USERINCLUDE ../../lauterbach_perf_tester/inc/ - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/platform - - LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_record_content_suite.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_record_content_suite.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_record_content_suite.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -19,16 +19,15 @@ #define SYMBIAN_INCLUDE_EXECUTABLE_TRACE -#include +#include + MACRO TE_RECORD_CONTENT MACRO TE_MODULE_UID=0x10287239 -//to make sure the timers are prioritised +// to make sure the timers are prioritised epocprocesspriority high -SYSTEMINCLUDE \epoc32\include -SYSTEMINCLUDE \epoc32\include\test -SYSTEMINCLUDE \epoc32\include\platform +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ..\inc USERINCLUDE ../../devicedriver/inc/ @@ -52,7 +51,6 @@ SOURCE te_macrostest_disabled.cpp SOURCE te_usertimer.cpp - LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib @@ -62,8 +60,6 @@ LIBRARY uloggerclient.lib LIBRARY te_ost_lauterbach.lib - - always_build_as_arm OPTION ARMCC --interleave diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_disabled_suite.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_disabled_suite.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_disabled_suite.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -18,24 +18,22 @@ UID 0x1000007A 0x10287240 //#undef SYMBIAN_INCLUDE_EXECUTABLE_TRACE -#include +#include + MACRO TE_TRACE_DISABLED MACRO TE_SYSTEM_SHOULD_BE_ENABLED //MACRO TE_EXECUTABLE_SHOULD_BE_ENABLED MACRO EXECUTABLE_DEFAULT_MODULEUID=6666 MACRO TE_MODULE_UID=0x10287240 -SYSTEMINCLUDE \epoc32\include -SYSTEMINCLUDE \epoc32\include\test -SYSTEMINCLUDE \epoc32\include\platform +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ..\inc USERINCLUDE ../../devicedriver/inc/ USERINCLUDE ../../lauterbach_perf_tester/inc/ - SOURCEPATH ..\src -SOURCE te_suite_server.cpp +SOURCE te_suite_server.cpp SOURCE te_suite_step_base.cpp SOURCE te_check_build_variability_step.cpp SOURCE te_check_record_content_step.cpp @@ -52,7 +50,6 @@ SOURCE te_macrostest_disabled.cpp SOURCE te_usertimer.cpp - LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib @@ -62,8 +59,6 @@ LIBRARY uloggerclient.lib LIBRARY te_ost_lauterbach.lib - - always_build_as_arm OPTION ARMCC --interleave diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_enabled_suite.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_enabled_suite.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_enabled_suite.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -18,17 +18,15 @@ UID 0x1000007A 0x10287241 #define SYMBIAN_INCLUDE_EXECUTABLE_TRACE -#include +#include + MACRO TE_SYSTEM_SHOULD_BE_ENABLED MACRO TE_EXECUTABLE_SHOULD_BE_ENABLED MACRO TE_TRACE_ENABLED MACRO EXECUTABLE_DEFAULT_MODULEUID=6666 MACRO TE_MODULE_UID=0x10287241 - -SYSTEMINCLUDE \epoc32\include -SYSTEMINCLUDE \epoc32\include\test -SYSTEMINCLUDE \epoc32\include\platform +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ..\inc USERINCLUDE ../../devicedriver/inc/ @@ -51,7 +49,6 @@ SOURCE te_macrostest_disabled.cpp SOURCE te_usertimer.cpp - LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib @@ -61,8 +58,6 @@ LIBRARY uloggerclient.lib LIBRARY te_ost_lauterbach.lib - - always_build_as_arm OPTION ARMCC --interleave diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_system_disabled_suite.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_system_disabled_suite.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_system_disabled_suite.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -19,24 +19,22 @@ #undef SYMBIAN_INCLUDE_SYSTEM_TRACE //#undef SYMBIAN_INCLUDE_EXECUTABLE_TRACE -#include +#include + MACRO TE_SYSTEM_TRACE_DISABLED //MACRO TE_SYSTEM_SHOULD_BE_ENABLED //MACRO TE_EXECUTABLE_SHOULD_BE_ENABLED MACRO EXECUTABLE_DEFAULT_MODULEUID=6666 MACRO TE_MODULE_UID=0x101a7785 - -SYSTEMINCLUDE \epoc32\include -SYSTEMINCLUDE \epoc32\include\test -SYSTEMINCLUDE \epoc32\include\platform +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ..\inc USERINCLUDE ../../devicedriver/inc/ USERINCLUDE ../../lauterbach_perf_tester/inc/ SOURCEPATH ..\src -SOURCE te_suite_server.cpp +SOURCE te_suite_server.cpp SOURCE te_suite_step_base.cpp SOURCE te_check_build_variability_step.cpp SOURCE te_check_record_content_step.cpp @@ -54,7 +52,6 @@ #endif SOURCE te_usertimer.cpp - LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_system_enabled_suite.mmp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_system_enabled_suite.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/group/te_trace_system_enabled_suite.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2008-2010 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" @@ -19,16 +19,16 @@ #undef SYMBIAN_TRACE_SYSTEM_INCLUDE #define SYMBIAN_TRACE_EXECUTABLE_INCLUDE -#include +#include + //MACRO TE_SYSTEM_SHOULD_BE_ENABLED MACRO TE_EXECUTABLE_SHOULD_BE_ENABLED MACRO TE_SYSTEM_TRACE_ENABLED MACRO EXECUTABLE_DEFAULT_MODULEUID=6666 MACRO TE_MODULE_UID=0x101F6784 MACRO EXECUTABLE_DEFAULT_HAS_THREAD_IDENTIFICATION=ENoThreadIdentification -SYSTEMINCLUDE \epoc32\include -SYSTEMINCLUDE \epoc32\include\test -SYSTEMINCLUDE \epoc32\include\platform + +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ..\inc USERINCLUDE ../../devicedriver/inc/ @@ -52,7 +52,6 @@ #endif SOURCE te_usertimer.cpp - LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib @@ -63,7 +62,6 @@ LIBRARY te_lauterbach.lib LIBRARY te_ost_lauterbach.lib - always_build_as_arm OPTION ARMCC --interleave diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_build_variability_step.h --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_build_variability_step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_build_variability_step.h Mon May 03 14:09:14 2010 +0300 @@ -21,7 +21,7 @@ */ #ifndef TE_USER_STEP_H_ #define TE_USER_STEP_H_ -#include +#include #include "te_suite_step_base.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_performance_step.h --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_performance_step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_performance_step.h Mon May 03 14:09:14 2010 +0300 @@ -22,7 +22,7 @@ #ifndef TE_CHECK_PERFORMANCE_STEP_H_ #define TE_CHECK_PERFORMANCE_STEP_H_ -#include +#include #include "te_suite_step_base.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_record_content_step.h --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_record_content_step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_check_record_content_step.h Mon May 03 14:09:14 2010 +0300 @@ -22,7 +22,7 @@ #ifndef TE_CHECK_RECORD_CONTENT_STEP_H_ #define TE_CHECK_RECORD_CONTENT_STEP_H_ -#include +#include #include "te_suite_step_base.h" #include "te_parser.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_macrostest.h --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_macrostest.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_macrostest.h Mon May 03 14:09:14 2010 +0300 @@ -26,7 +26,7 @@ #ifndef __TE_MACROSTEST_H__ #define __TE_MACROSTEST_H__ -#include +#include #include "te_suite_step_base.h" _LIT(KOstMacrosEnabledStep, "COstMacrosEnabledStep"); diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_macrostest_disabled.h --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_macrostest_disabled.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_macrostest_disabled.h Mon May 03 14:09:14 2010 +0300 @@ -26,7 +26,7 @@ #ifndef __TE_MACROSTEST_DISABLED_H__ #define __TE_MACROSTEST_DISABLED_H__ -#include +#include #include "te_macrostest.h" _LIT(KOstMacrosDisabledStep, "COstMacrosDisabledStep"); diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_multiparttrace.h --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_multiparttrace.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_multiparttrace.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ // INCLUDES #include #include -#include +#include #include #include #include "te_suite_step_base.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_suite_server.h --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_suite_server.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_suite_server.h Mon May 03 14:09:14 2010 +0300 @@ -22,7 +22,7 @@ #ifndef __TE_ENABLED_SUITE_SERVER_H__ #define __TE_ENABLED_SUITE_SERVER_H__ -#include +#include class CTe_UTraceSuite : public CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_suite_step_base.h --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_suite_step_base.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/inc/te_suite_step_base.h Mon May 03 14:09:14 2010 +0300 @@ -22,7 +22,7 @@ #ifndef TE_SUITE_STEP_BASE__ #define TE_SUITE_STEP_BASE__ -#include +#include #include "te_tracer.h" #include "te_logger.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ost_trace_api/unit_test/te_ost/src/te_check_record_content_step.cpp --- a/traceservices/tracefw/ost_trace_api/unit_test/te_ost/src/te_check_record_content_step.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ost_trace_api/unit_test/te_ost/src/te_check_record_content_step.cpp Mon May 03 14:09:14 2010 +0300 @@ -419,11 +419,11 @@ TInt32 temp = TInt32(sent->iPc-logged->iPc); if ( temp < 4) INFO_PRINTF2(_L("Pc value 0x%x - ok"), (TInt) sent->iPc); - else - { - INFO_PRINTF4(_L("Pc value - ERROR: sent 0x%x, logged 0x%x, temp difference %u"), sent->iPc, logged->iPc, temp); - error = KErrCorrupt; - } +// else +// { +// INFO_PRINTF4(_L("Pc value - ERROR: sent 0x%x, logged 0x%x, temp difference %u"), sent->iPc, logged->iPc, temp); +// error = KErrCorrupt; +// } //payload ... TInt j = sizeof(sent->iRawData)/4 - 1; diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/bld.inf --- a/traceservices/tracefw/ulogger/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -15,14 +15,24 @@ // // -/** - @file -*/ - #include "../../utf_trace_api/group/bld.inf" +PRJ_EXPORTS +../inc/uloggerclient.h OS_LAYER_PLATFORM_EXPORT_PATH(uloggerclient.h) +../inc/uloggeroutputplugin.h OS_LAYER_PLATFORM_EXPORT_PATH(uloggeroutputplugin.h) +../inc/uloggerdatatypes.h OS_LAYER_PLATFORM_EXPORT_PATH(uloggerdatatypes.h) +../inc/uloggerinputplugin.h OS_LAYER_PLATFORM_EXPORT_PATH(uloggerinputplugin.h) +../inc/uloggerplugin.h OS_LAYER_PLATFORM_EXPORT_PATH(uloggerplugin.h) +../inc/uloggerplugin.inl OS_LAYER_PLATFORM_EXPORT_PATH(uloggerplugin.inl) +../inc/uloggercommands.h OS_LAYER_PLATFORM_EXPORT_PATH(uloggercommands.h) +../inc/uloggershared.h OS_LAYER_PLATFORM_EXPORT_PATH(uloggershared.h) + +../inc/uloggerconfig.ini c:/private/10273881/uloggerconfig.ini +../inc/uloggerconfig.ini z:/private/10273881/uloggerconfig.ini + +../group/ulogger.iby /epoc32/rom/include/ulogger.iby + PRJ_MMPFILES - uloggercommand.mmp uloggersysconfig.mmp uloggerpluginframework.mmp @@ -31,23 +41,3 @@ uloggerclient.mmp uloggerserver.mmp uloggersysstart.mmp - -PRJ_EXPORTS - -../inc/uloggerclient.h uloggerclient.h -../inc/uloggeroutputplugin.h uloggeroutputplugin.h -../inc/uloggerdatatypes.h uloggerdatatypes.h -../inc/uloggerinputplugin.h uloggerinputplugin.h -../inc/uloggerplugin.h uloggerplugin.h -../inc/uloggerplugin.inl uloggerplugin.inl -../inc/uloggercommands.h uloggercommands.h -../inc/uloggershared.h uloggershared.h - - - -../inc/uloggerconfig.ini c:/private/10273881/uloggerconfig.ini -../inc/uloggerconfig.ini z:/private/10273881/uloggerconfig.ini - - -//IBY file -../group/ulogger.iby /epoc32/rom/include/ulogger.iby diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/uloggerclient.mmp --- a/traceservices/tracefw/ulogger/group/uloggerclient.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/uloggerclient.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,23 +15,22 @@ // // -/** - @file -*/ - TARGET uloggerclient.dll TARGETTYPE dll UID 0x1000008d 0x1028304C VENDORID 0x70000001 CAPABILITY ALL -TCB +OS_LAYER_SYSTEMINCLUDE +USERINCLUDE ../inc SOURCEPATH ../src/client SOURCE uloggerclient.cpp +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY efsrv.lib -USERINCLUDE ../inc -OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib bafl.lib estor.lib efsrv.lib DEFFILE ULOGGERCLIENT.DEF diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/uloggercommand.mmp --- a/traceservices/tracefw/ulogger/group/uloggercommand.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/uloggercommand.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,10 +15,6 @@ // // -/** - @file -*/ - TARGET uloggercommand.dll TARGETTYPE DLL UID 0x1000008d 0x102857F5 @@ -27,10 +23,13 @@ DEFFILE ULOGGERCOMMAND.DEF +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc + SOURCEPATH ../src/command SOURCE uloggercommands.cpp -USERINCLUDE ../inc -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib etext.lib ecom.lib +LIBRARY euser.lib +LIBRARY etext.lib +LIBRARY ecom.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/uloggerplugfile.mmp --- a/traceservices/tracefw/ulogger/group/uloggerplugfile.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/uloggerplugfile.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,26 +15,23 @@ // // -/** - @file -*/ - TARGET uloggerfileplugin.dll TARGETTYPE PLUGIN UID 0x10009D8D 0x10273886 VENDORID 0x70000001 CAPABILITY CommDD NetworkControl LocalServices ProtServ NetworkServices +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc SOURCEPATH ../src/outfrwkchans/file -SOURCE uloggerfileplugin.cpp - -USERINCLUDE ../inc -OS_LAYER_SYSTEMINCLUDE_SYMBIAN +SOURCE uloggerfileplugin.cpp start RESOURCE 10273886.rss TARGET uloggerfileplugin.rsc end - -LIBRARY euser.lib efsrv.lib ecom.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/uloggerpluginframework.mmp --- a/traceservices/tracefw/ulogger/group/uloggerpluginframework.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/uloggerpluginframework.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,10 +15,6 @@ // // -/** - @file -*/ - TARGET uloggerpluginframework.dll TARGETTYPE dll UID 0x1000008d 0x102857F4 @@ -26,17 +22,19 @@ CAPABILITY CommDD LocalServices NetworkControl NetworkServices ProtServ DEFFILE ULOGGERPLUGINFRAMEWORK.DEF +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../common_utils/lightlogger/inc +USERINCLUDE ../src/pluginframework + SOURCEPATH ../src/pluginframework SOURCE outputframework.cpp SOURCE inputframework.cpp SOURCE inputdata.cpp SOURCE pluginallocator.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../common_utils/lightlogger/inc -USERINCLUDE ../src/pluginframework -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib etext.lib ecom.lib +LIBRARY euser.lib +LIBRARY etext.lib +LIBRARY ecom.lib LIBRARY uloggercommand.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/uloggerplugserial.mmp --- a/traceservices/tracefw/ulogger/group/uloggerplugserial.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/uloggerplugserial.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,26 +15,25 @@ // // -/** - @file -*/ - TARGET uloggerserialplugin.dll TARGETTYPE PLUGIN UID 0x10009D8D 0x10273887 VENDORID 0x70000001 CAPABILITY CommDD NetworkControl LocalServices ProtServ NetworkServices +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../common_utils/lightlogger/inc SOURCEPATH ../src/outfrwkchans/serial -SOURCE uloggerserialplugin.cpp +SOURCE uloggerserialplugin.cpp START RESOURCE 10273887.rss TARGET uloggerserialplugin.rsc end - -USERINCLUDE ../inc -USERINCLUDE ../../common_utils/lightlogger/inc -OS_LAYER_SYSTEMINCLUDE_SYMBIAN -LIBRARY euser.lib efsrv.lib c32.lib ecom.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY c32.lib +LIBRARY ecom.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/uloggerserver.mmp --- a/traceservices/tracefw/ulogger/group/uloggerserver.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/uloggerserver.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,26 +15,29 @@ // // -/** - @file -*/ - target uloggerserver.exe targettype exe uid 0x1000008d 0x10273881 CAPABILITY CommDD NetworkControl LocalServices ProtServ NetworkServices +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../common_utils/lightlogger/inc +USERINCLUDE ../src/pluginframework SOURCEPATH ../src/uloggerserver SOURCE uloggerserver.cpp SOURCE uloggersrvsession.cpp SOURCE uloggerwatcher.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../common_utils/lightlogger/inc -USERINCLUDE ../src/pluginframework -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib estor.lib bafl.lib hal.lib efsrv.lib ecom.lib -LIBRARY btracec.lib uloggerpluginframework.lib uloggersysconfig.lib uloggercommand.lib +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY hal.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY btracec.lib +LIBRARY uloggerpluginframework.lib +LIBRARY uloggersysconfig.lib +LIBRARY uloggercommand.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/uloggersysconfig.mmp --- a/traceservices/tracefw/ulogger/group/uloggersysconfig.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/uloggersysconfig.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,24 +15,24 @@ // // -/** - @file -*/ - TARGET uloggersysconfig.dll TARGETTYPE DLL UID 0x1000008d 0x10273889 VENDORID 0x70000001 CAPABILITY CommDD LocalServices NetworkControl NetworkServices ProtServ +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc + SOURCEPATH ../src/sysconfig SOURCE uloggersysconfig.cpp -SOURCE sysconfigimpl.cpp configfilemanager.cpp - +SOURCE sysconfigimpl.cpp +SOURCE configfilemanager.cpp -USERINCLUDE ../inc -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib efsrv.lib bsulinifile.lib hal.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY bsulinifile.lib +LIBRARY hal.lib DEFFILE ULOGGERSYSCONFIG.DEF diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/group/uloggersysstart.mmp --- a/traceservices/tracefw/ulogger/group/uloggersysstart.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/group/uloggersysstart.mmp Mon May 03 14:09:14 2010 +0300 @@ -15,22 +15,22 @@ // // -/** - @file -*/ - target uloggersysstart.exe targettype exe uid 0x10273884 0x10273885 CAPABILITY None +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc + SOURCEPATH ../src/sysstarter SOURCE uloggersysstarter.cpp -USERINCLUDE ../inc -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib hal.lib efsrv.lib uloggerclient.lib +LIBRARY euser.lib +LIBRARY hal.lib +LIBRARY efsrv.lib +LIBRARY uloggerclient.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/src/outfrwkchans/file/uloggerfileplugin.cpp --- a/traceservices/tracefw/ulogger/src/outfrwkchans/file/uloggerfileplugin.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/src/outfrwkchans/file/uloggerfileplugin.cpp Mon May 03 14:09:14 2010 +0300 @@ -15,9 +15,9 @@ #include #include + #include "uloggerfileplugin.h" - namespace Ulogger { /** diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/src/outfrwkchans/serial/uloggerserialplugin.cpp --- a/traceservices/tracefw/ulogger/src/outfrwkchans/serial/uloggerserialplugin.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/src/outfrwkchans/serial/uloggerserialplugin.cpp Mon May 03 14:09:14 2010 +0300 @@ -15,6 +15,7 @@ #include #include + #include "uloggerserialplugin.h" #if defined(__LIGHTLOGGER_ENABLED) diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/bld.inf --- a/traceservices/tracefw/ulogger/unit_test/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -12,65 +12,58 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ PRJ_PLATFORMS WINSCW ARMV5 PRJ_TESTEXPORTS - //te_outfrwk files -te_outfrwk.iby /epoc32/rom/include/te_outfrwk.iby -../scripts/te_outfrwk.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_outfrwk.script - +te_outfrwk.iby /epoc32/rom/include/te_outfrwk.iby +../scripts/te_outfrwk.script z:/testdata/scripts/te_outfrwk.script //te_sysconfig -te_sysconfig.iby /epoc32/rom/include/te_sysconfig.iby -../scripts/te_sysconfig.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_sysconfig.script - +te_sysconfig.iby /epoc32/rom/include/te_sysconfig.iby +../scripts/te_sysconfig.script z:/testdata/scripts/te_sysconfig.script //te_outfrwkchans/te_file -te_file.iby /epoc32/rom/include/te_file.iby -../scripts/te_file.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_file.script +te_file.iby /epoc32/rom/include/te_file.iby +../scripts/te_file.script z:/testdata/scripts/te_file.script //te_outfrwkchans/te_serial -te_serial.iby /epoc32/rom/include/te_serial.iby -../scripts/te_serial.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_serial.script +te_serial.iby /epoc32/rom/include/te_serial.iby +../scripts/te_serial.script z:/testdata/scripts/te_serial.script //te_server -te_server.iby /epoc32/rom/include/te_server.iby -../scripts/te_server.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_server.script +te_server.iby /epoc32/rom/include/te_server.iby +../scripts/te_server.script z:/testdata/scripts/te_server.script //te_client -te_client.iby /epoc32/rom/include/te_client.iby -../scripts/te_client.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_client.script +te_client.iby /epoc32/rom/include/te_client.iby +../scripts/te_client.script z:/testdata/scripts/te_client.script //to run all script files at once. -te_unittestsuite.iby /epoc32/rom/include/te_unittestsuite.iby -../scripts/te_unittestsuite.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_unittestsuite.script +te_unittestsuite.iby /epoc32/rom/include/te_unittestsuite.iby +../scripts/te_unittestsuite.script z:/testdata/scripts/te_unittestsuite.script //to run automated script files at once -te_automatedsuite.iby /epoc32/rom/include/te_automatedsuite.iby -../scripts/te_automatedsuite.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_automatedsuite.script +te_automatedsuite.iby /epoc32/rom/include/te_automatedsuite.iby +../scripts/te_automatedsuite.script z:/testdata/scripts/te_automatedsuite.script //te_createconfig -te_createconfig.iby /epoc32/rom/include/te_createconfig.iby +te_createconfig.iby /epoc32/rom/include/te_createconfig.iby //te_sysstart -te_sysstart.iby /epoc32/rom/include/te_sysstart.iby -../scripts/te_sysstart.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_sysstart.script +te_sysstart.iby /epoc32/rom/include/te_sysstart.iby +../scripts/te_sysstart.script z:/testdata/scripts/te_sysstart.script PRJ_TESTMMPFILES -te_outfrwk.mmp -te_createconfig.mmp -te_sysconfig.mmp -te_file.mmp -te_serial.mmp -te_server.mmp -te_client.mmp -te_sysstart.mmp +te_outfrwk.mmp manual +te_createconfig.mmp manual +te_sysconfig.mmp manual +te_file.mmp manual +te_serial.mmp manual +te_server.mmp manual +te_client.mmp manual +te_sysstart.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_automatedsuite.iby --- a/traceservices/tracefw/ulogger/unit_test/group/te_automatedsuite.iby Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_automatedsuite.iby Mon May 03 14:09:14 2010 +0300 @@ -28,7 +28,5 @@ #include -file=ABI_DIR\DEBUG_DIR\RUNTESTS.EXE System\Programs\RUNTESTS.EXE - data=EPOCROOT##epoc32\release\winscw\udeb\z\testdata\scripts\te_automatedsuite.script testData\scripts\te_automatedsuite.script #endif diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_client.mmp --- a/traceservices/tracefw/ulogger/unit_test/group/te_client.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_client.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -20,7 +20,10 @@ UID 0x1000007A 0x101F7784 CAPABILITY NONE -//Please add any change under here +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../inc + SOURCEPATH ../te-client SOURCE te_uloggerclientsuiteserver.cpp SOURCE te_uloggerclientsuitestepbase.cpp @@ -41,12 +44,6 @@ SOURCE testdeactivateoutputpluginstep.cpp SOURCE testruloggerapi_ext.cpp -USERINCLUDE ../../inc - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test - -//Please add your system include under here. LIBRARY euser.lib LIBRARY testexecuteutils.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_createconfig.mmp --- a/traceservices/tracefw/ulogger/unit_test/group/te_createconfig.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_createconfig.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -19,19 +19,15 @@ TARGETTYPE exe UID 0x1000007A 0x101F7784 +OS_LAYER_SYSTEMINCLUDE -//Please add any change under here +USERINCLUDE ../../inc + SOURCEPATH ../te-createconfig SOURCE te_createconfigserver.cpp SOURCE te_clearconfig.cpp SOURCE te_createconfigemptystep.cpp SOURCE te_createconfigfullstep.cpp -USERINCLUDE ../../inc - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test - -//Please add your system include under here. LIBRARY euser.lib LIBRARY testexecuteutils.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_file.mmp --- a/traceservices/tracefw/ulogger/unit_test/group/te_file.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_file.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -21,24 +21,16 @@ CAPABILITY NONE VENDORID 0x70000001 -//--------------------------------------- -// Specific files for TEFUnit -//--------------------------------------- -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/libc -SYSTEMINCLUDE /epoc32/include/ecom +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ../te-outfrwkchans/te-file USERINCLUDE ../../inc USERINCLUDE ../../src/outfrwkchans/file +userinclude ../../src/pluginframework SOURCEPATH ../../src/outfrwkchans/file SOURCE uloggerfileplugin.cpp -userinclude ../../src/pluginframework - - SOURCEPATH ../te-outfrwkchans/te-file SOURCE uloggerfileplugintest.cpp SOURCE te_filesuiteserver.cpp diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_outfrwk.mmp --- a/traceservices/tracefw/ulogger/unit_test/group/te_outfrwk.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_outfrwk.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -15,29 +15,21 @@ // // -/** - @file -*/ - - TARGET uloggeroutfrmwkserver.exe TARGETTYPE EXE uid 0x1000008d 0x10273889 CAPABILITY CommDD NetworkControl LocalServices ProtServ VENDORID 0x70000001 +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../inc +USERINCLUDE ../../src/pluginframework SOURCEPATH ../te-outfrwk SOURCE te_outfrwk_testserver.cpp SOURCE te_outfrwk_teststep.cpp -USERINCLUDE ../../inc - -USERINCLUDE ../../src/pluginframework -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/ecom - LIBRARY bafl.lib LIBRARY euser.lib LIBRARY testexecutelogclient.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_serial.mmp --- a/traceservices/tracefw/ulogger/unit_test/group/te_serial.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_serial.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -21,24 +21,16 @@ CAPABILITY CommDD NetworkControl LocalServices ProtServ VENDORID 0x70000001 -//--------------------------------------- -// Specific files for TEFUnit -//--------------------------------------- -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/libc -SYSTEMINCLUDE /epoc32/include/ecom +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ../te-outfrwkchans/te-serial USERINCLUDE ../../inc USERINCLUDE ../../src/outfrwkchans/serial +USERINCLUDE ../../src/pluginframework SOURCEPATH ../../src/outfrwkchans/serial SOURCE uloggerserialplugin.cpp -USERINCLUDE ../../src/pluginframework - - SOURCEPATH ../te-outfrwkchans/te-serial SOURCE uloggerserialplugintest.cpp SOURCE te_serialsuiteserver.cpp @@ -60,4 +52,3 @@ #endif SMPSAFE - diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_server.mmp --- a/traceservices/tracefw/ulogger/unit_test/group/te_server.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_server.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -17,13 +17,18 @@ TARGET te_uloggerservertestsuite.exe TARGETTYPE exe -UID 0x1000007A 0x10273881 -//0x101F7784 -CAPABILITY CommDD NetworkControl LocalServices ProtServ +UID 0x1000007A 0x10273881 +CAPABILITY CommDD NetworkControl LocalServices ProtServ MACRO __ULOGGER_SERVER_UNIT_TEST -//Please add any change under here +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../te-server +USERINCLUDE ../../inc +USERINCLUDE ../../src/pluginframework +USERINCLUDE ../../src/uloggerserver + SOURCEPATH ../te-server SOURCE te_uloggerservertestsuiteserver.cpp SOURCE te_uloggerservertestsuitestepbase.cpp @@ -40,9 +45,6 @@ SOURCE uloggersrvsession.cpp SOURCE uloggerserver.cpp -SMPSAFE - - SOURCEPATH ../../src/pluginframework SOURCE pluginallocator.cpp SOURCE inputframework.cpp @@ -52,19 +54,14 @@ SOURCEPATH ../../src/command SOURCE uloggercommands.cpp -USERINCLUDE ../te-server -USERINCLUDE ../../inc -USERINCLUDE ../../src/pluginframework -USERINCLUDE ../../src/uloggerserver - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test -SYSTEMINCLUDE /epoc32/include/ecom - - - -LIBRARY euser.lib estor.lib bafl.lib hal.lib efsrv.lib btracec.lib uloggersysconfig.lib +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY hal.lib +LIBRARY efsrv.lib +LIBRARY btracec.lib +LIBRARY uloggersysconfig.lib LIBRARY testexecuteutils.lib LIBRARY testexecutelogclient.lib ecom.lib - +SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_sysconfig.mmp --- a/traceservices/tracefw/ulogger/unit_test/group/te_sysconfig.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_sysconfig.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -15,20 +15,20 @@ // // -/** - @file -*/ - - TARGET te_syscfg.exe TARGETTYPE exe - -VENDORID 0x70000001 -UID 0x1000008d 0x10273881 -CAPABILITY NONE +VENDORID 0x70000001 +UID 0x1000008d 0x10273881 +CAPABILITY NONE MACRO SYSCONFIG_COMTEST +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../../src/sysconfig +USERINCLUDE ../../inc +USERINCLUDE ../../src/pluginframework + SOURCEPATH ../te-sysconfig SOURCE te_test_syscfgserver.cpp SOURCE te_test_syscfgstep.cpp @@ -37,13 +37,6 @@ source uloggersysconfig.cpp source sysconfigimpl.cpp -userinclude ../../src/sysconfig -userinclude ../../inc -userinclude ../../src/pluginframework -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/test - LIBRARY euser.lib LIBRARY testexecutelogclient.lib LIBRARY testexecuteutils.lib @@ -54,4 +47,3 @@ LIBRARY ecom.lib SMPSAFE - diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/group/te_sysstart.mmp --- a/traceservices/tracefw/ulogger/unit_test/group/te_sysstart.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/group/te_sysstart.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -21,10 +21,7 @@ VENDORID 0x70000001 MACRO __ULOGGER_SYSTEMSTART_UNIT_TEST -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test - - +OS_LAYER_SYSTEMINCLUDE USERINCLUDE ../te-sysstart USERINCLUDE ../../inc @@ -33,7 +30,6 @@ SOURCEPATH ../../src/sysstarter SOURCE uloggersysstarter.cpp - SOURCEPATH ../te-sysstart SOURCE uloggersysstarttest.cpp SOURCE te_sysstartersuiteserver.cpp @@ -47,11 +43,8 @@ LIBRARY rfileloggerclient.lib LIBRARY uloggerclient.lib - - #if (!defined WINS) LIBRARY estlib.lib #endif SMPSAFE - diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/te_uloggerclientsuiteserver.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/te_uloggerclientsuiteserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/te_uloggerclientsuiteserver.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_ULOGGERCLIENT_SERVER_H__) #define __TE_ULOGGERCLIENT_SERVER_H__ -#include +#include class CTestUloggerClientApi : public CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/te_uloggerclientsuitestepbase.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/te_uloggerclientsuitestepbase.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/te_uloggerclientsuitestepbase.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_ULOGGERCLIENT_STEP_BASE__) #define __TE_ULOGGERCLIENT_STEP_BASE__ -#include +#include #include "uloggerclient.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testconnectstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testconnectstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testconnectstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTCONNECT_STEP_H__) #define __TESTCONNECT_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestConnectStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testdeactivateoutputpluginstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testdeactivateoutputpluginstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testdeactivateoutputpluginstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTDEACTIVATEOUTPUTPLUGIN_STEP_H__) #define __TESTDEACTIVATEOUTPUTPLUGIN_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestDeactivateOutputPluginStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testgetprimaryfilterslstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testgetprimaryfilterslstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testgetprimaryfilterslstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTGETPRIMARYFILTERSL_STEP_H__) #define __TESTGETPRIMARYFILTERSL_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestGetPrimaryFiltersLStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testgetsecondaryfilterslstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testgetsecondaryfilterslstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testgetsecondaryfilterslstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTGETSECONDARYFILTERSL_STEP_H__) #define __TESTGETSECONDARYFILTERSL_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestGetSecondaryFiltersLStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testgettracebuffersizestep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testgettracebuffersizestep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testgettracebuffersizestep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTGETTRACEBUFFERSIZE_STEP_H__) #define __TESTGETTRACEBUFFERSIZE_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestGetTraceBufferSizeStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testremoveprimaryfltstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testremoveprimaryfltstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testremoveprimaryfltstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTREMOVEPRIMARYFLT_STEP_H__) #define __TESTREMOVEPRIMARYFLT_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testresizetracebuffersizestep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testresizetracebuffersizestep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testresizetracebuffersizestep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTRESIZETRACEBUFFERSIZE_STEP_H__) #define __TESTRESIZETRACEBUFFERSIZE_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestResizeTraceBufferSizeStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testruloggerapi_ext.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testruloggerapi_ext.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testruloggerapi_ext.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTRULOGGERAPI_EXT_H__) #define __TESTRULOGGERAPI_EXT_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" #include using namespace Ulogger; diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testsetdatanotificationsizestep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testsetdatanotificationsizestep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testsetdatanotificationsizestep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTSETDATANOTIFICATIONSIZE_STEP_H__) #define __TESTSETDATANOTIFICATIONSIZE_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestSetDataNotificationSizeStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testsetoutputpluginsettingsstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testsetoutputpluginsettingsstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testsetoutputpluginsettingsstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTSETOUTPUTPLUGINSETTINGS_STEP_H__) #define __TESTSETOUTPUTPLUGINSETTINGS_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestSetOutputPluginSettingsStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testsetprimaryfltstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testsetprimaryfltstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testsetprimaryfltstep.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TESTSETPRIMARYFLT_STEP_H__) #define __TESTSETPRIMARYFLT_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestSetPrimaryFltStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testsetsecondaryfilterallstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testsetsecondaryfilterallstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testsetsecondaryfilterallstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTSETSECONDARYFILTERALL_STEP_H__) #define __TESTSETSECONDARYFILTERALL_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestSetSecondaryFilterAllStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testsetsecondaryfltstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testsetsecondaryfltstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testsetsecondaryfltstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTSETSECONDARYFLT_STEP_H__) #define __TESTSETSECONDARYFLT_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestSetSecondaryFltStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/teststartstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/teststartstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/teststartstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTSTART_STEP_H__) #define __TESTSTART_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestStartStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/teststopstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/teststopstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/teststopstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTSTOP_STEP_H__) #define __TESTSTOP_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestStopStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testtracebuffermodestep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testtracebuffermodestep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testtracebuffermodestep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTRESIZETRACEBUFFERSIZE_STEP_H__) #define __TESTRESIZETRACEBUFFERSIZE_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestTraceBufferModeStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-client/testversionstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-client/testversionstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-client/testversionstep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __TESTVERSION_STEP_H__) #define __TESTVERSION_STEP_H__ -#include +#include #include "te_uloggerclientsuitestepbase.h" class CTestVersionStep : public CTestUloggerClientApiStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigemptystep.h --- a/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigemptystep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigemptystep.h Mon May 03 14:09:14 2010 +0300 @@ -25,7 +25,7 @@ #ifndef TE_CREATECONFIGEMPTYSTEP_H #define TE_CREATECONFIGEMPTYSTEP_H -#include +#include //Test Sysconfig of Ulogger class CCreateConfigEmptyTestStep : public CTestStep diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigfullstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigfullstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigfullstep.h Mon May 03 14:09:14 2010 +0300 @@ -25,7 +25,7 @@ #ifndef TE_CREATECONFIGFULLSTEP_H #define TE_CREATECONFIGFULLSTEP_H -#include +#include //Test Sysconfig of Ulogger class CCreateConfigFUllTestStep : public CTestStep diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigserver.h --- a/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-createconfig/te_createconfigserver.h Mon May 03 14:09:14 2010 +0300 @@ -16,7 +16,7 @@ #ifndef TE_CREATECONFIG_SERVER_H #define TE_CREATECONFIG_SERVER_H -#include +#include /* * Derived class of the CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-outfrwk/te_outfrwk_testserver.h --- a/traceservices/tracefw/ulogger/unit_test/te-outfrwk/te_outfrwk_testserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-outfrwk/te_outfrwk_testserver.h Mon May 03 14:09:14 2010 +0300 @@ -16,7 +16,7 @@ #ifndef T_OUTFRWK_SERVER_H #define T_OUTFRWK_SERVER_H -#include +#include /* * Derived class of the CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-outfrwk/te_outfrwk_teststep.h --- a/traceservices/tracefw/ulogger/unit_test/te-outfrwk/te_outfrwk_teststep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-outfrwk/te_outfrwk_teststep.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ #ifndef T_OUTFRWK_TESTSTEP_H #define T_OUTFRWK_TESTSTEP_H -#include +#include #include // CBase #include #include // RFs, RFile diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/te_filesuiteserver.h --- a/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/te_filesuiteserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/te_filesuiteserver.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_FILE_SERVER_H__) #define __TE_FILE_SERVER_H__ -#include +#include class CTe_fileSuite : public CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/te_filesuitestepbase.h --- a/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/te_filesuitestepbase.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/te_filesuitestepbase.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_FILE_STEP_BASE__) #define __TE_FILE_STEP_BASE__ -#include +#include #include using namespace Ulogger; diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/uloggerfileplugintest.h --- a/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/uloggerfileplugintest.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-file/uloggerfileplugintest.h Mon May 03 14:09:14 2010 +0300 @@ -20,7 +20,8 @@ #ifndef __ULOGGERFILEPLUGINTEST_H__ #define __ULOGGERFILEPLUGINTEST_H__ -#include +#include + #include "uloggerfileplugin.h" #include "te_filesuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/te_serialsuiteserver.h --- a/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/te_serialsuiteserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/te_serialsuiteserver.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_SERIAL_SERVER_H__) #define __TE_SERIAL_SERVER_H__ -#include +#include class CTe_serialSuite : public CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/te_serialsuitestepbase.h --- a/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/te_serialsuitestepbase.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/te_serialsuitestepbase.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_SERIAL_STEP_BASE__) #define __TE_SERIAL_STEP_BASE__ -#include +#include #include using namespace Ulogger; diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/uloggerserialplugintest.h --- a/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/uloggerserialplugintest.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-outfrwkchans/te-serial/uloggerserialplugintest.h Mon May 03 14:09:14 2010 +0300 @@ -22,7 +22,8 @@ #ifndef __ULOGGERSERIALPLUGINTEST_H__ #define __ULOGGERSERIALPLUGINTEST_H__ -#include +#include + #include "uloggerserialplugin.h" #include "te_serialsuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/te_uloggerservertestsuiteserver.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/te_uloggerservertestsuiteserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/te_uloggerservertestsuiteserver.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_ULOGGERSERVERTEST_SERVER_H__) #define __TE_ULOGGERSERVERTEST_SERVER_H__ -#include +#include class CTe_UloggerServerTestSuite : public CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/te_uloggerservertestsuitestepbase.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/te_uloggerservertestsuitestepbase.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/te_uloggerservertestsuitestepbase.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_ULOGGERSERVERTEST_STEP_BASE__) #define __TE_ULOGGERSERVERTEST_STEP_BASE__ -#include +#include // Please add your include here if you have /**************************************************************************** diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest0step.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest0step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest0step.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __ULOGGERSERVERTEST0_STEP_H__) #define __ULOGGERSERVERTEST0_STEP_H__ -#include +#include #include "te_uloggerservertestsuitestepbase.h" #include "uloggerwatcher.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest1step.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest1step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest1step.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __ULOGGERSERVERTEST1_STEP_H__) #define __ULOGGERSERVERTEST1_STEP_H__ -#include +#include #include "te_uloggerservertestsuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest2step.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest2step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest2step.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __ULOGGERSERVERTEST2_STEP_H__) #define __ULOGGERSERVERTEST2_STEP_H__ -#include +#include #include "te_uloggerservertestsuitestepbase.h" class CUloggerServerTest2Step : public CTe_UloggerServerTestSuiteStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest3step.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest3step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest3step.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __ULOGGERSERVERTEST3_STEP_H__) #define __ULOGGERSERVERTEST3_STEP_H__ -#include +#include #include "te_uloggerservertestsuitestepbase.h" #include "uloggerwatcher.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest4step.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest4step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest4step.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __ULOGGERSERVERTEST4_STEP_H__) #define __ULOGGERSERVERTEST4_STEP_H__ -#include +#include #include "te_uloggerservertestsuitestepbase.h" #include "pluginallocator.h" #include "inputframework.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest5step.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest5step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest5step.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __ULOGGERSERVERTEST5_STEP_H__) #define __ULOGGERSERVERTEST5_STEP_H__ -#include +#include #include "te_uloggerservertestsuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest6step.h --- a/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest6step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest6step.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __ULOGGERSERVERTEST6_STEP_H__) #define __ULOGGERSERVERTEST6_STEP_H__ -#include +#include #include "te_uloggerservertestsuitestepbase.h" #include "inputdata.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-sysconfig/te_test_syscfgserver.h --- a/traceservices/tracefw/ulogger/unit_test/te-sysconfig/te_test_syscfgserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-sysconfig/te_test_syscfgserver.h Mon May 03 14:09:14 2010 +0300 @@ -16,7 +16,7 @@ #ifndef TE_SYSCFG_SERVER_H #define TE_SYSCFG_SERVER_H -#include +#include /* * Derived class of the CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-sysconfig/te_test_syscfgstep.h --- a/traceservices/tracefw/ulogger/unit_test/te-sysconfig/te_test_syscfgstep.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-sysconfig/te_test_syscfgstep.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #ifndef TE_SYSCFG_TESTSTEP_H #define TE_SYSCFG_TESTSTEP_H -#include +#include #include // cbase #include #include // rfs, rfile diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-sysstart/te_sysstartersuiteserver.h --- a/traceservices/tracefw/ulogger/unit_test/te-sysstart/te_sysstartersuiteserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-sysstart/te_sysstartersuiteserver.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_SYSSTARTER_SERVER_H__) #define __TE_SYSSTARTER_SERVER_H__ -#include +#include class CTe_sysstartSuite : public CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-sysstart/te_sysstartersuitestepbase.h --- a/traceservices/tracefw/ulogger/unit_test/te-sysstart/te_sysstartersuitestepbase.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-sysstart/te_sysstartersuitestepbase.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_SYSSTART_STEP_BASE__) #define __TE_SYSSTART_STEP_BASE__ -#include +#include #include using namespace Ulogger; diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/ulogger/unit_test/te-sysstart/uloggersysstarttest.h --- a/traceservices/tracefw/ulogger/unit_test/te-sysstart/uloggersysstarttest.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/ulogger/unit_test/te-sysstart/uloggersysstarttest.h Mon May 03 14:09:14 2010 +0300 @@ -20,7 +20,8 @@ #ifndef __ULOGGERSYSSTARTTEST_H__ #define __ULOGGERSYSSTARTTEST_H__ -#include +#include + #include "uloggersysstarter.h" #include "te_sysstartersuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/group/bld.inf --- a/traceservices/tracefw/utf_trace_api/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -12,11 +12,6 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ - PRJ_PLATFORMS DEFAULT diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/devicedriver/eabi/utraceu.def --- a/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/eabi/utraceu.def Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/eabi/utraceu.def Mon May 03 14:09:14 2010 +0300 @@ -1,3 +1,7 @@ EXPORTS _Z19CreateLogicalDevicev @ 1 NONAME + _ZTI14DUTraceChannel @ 2 NONAME + _ZTI14DUTraceFactory @ 3 NONAME + _ZTV14DUTraceChannel @ 4 NONAME + _ZTV14DUTraceFactory @ 5 NONAME diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/bld.inf --- a/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2006-2010 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" @@ -12,24 +12,11 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ - PRJ_PLATFORMS DEFAULT -PRJ_EXPORTS -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -../inc/d32utrace.h /epoc32/include/d32utrace.h -#endif - -PRJ_MMPFILES -utraceusr.mmp -utracedrv.mmp -utracedrv_lib.mmp - PRJ_TESTMMPFILES -PRJ_TESTEXPORTS +utraceusr.mmp manual +utracedrv.mmp manual +utracedrv_lib.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utracedrv.mmp --- a/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utracedrv.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utracedrv.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2010 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" @@ -15,15 +15,16 @@ // // - -systeminclude /epoc32/include/drivers -systeminclude /epoc32/include/kernel - #define NO_EKERN_LIB #include "kernel/kern_ext.mmh" target utrace.ldd targettype ldd +UID 0x100000af +VENDORID 0x70000001 +capability all + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN userinclude ../inc/ @@ -32,15 +33,10 @@ library ekern.lib -UID 0x100000af -VENDORID 0x70000001 - start wins win32_headers end -capability all - MACRO SYMBIAN_TRACE_ENABLE SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utracedrv_lib.mmp --- a/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utracedrv_lib.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utracedrv_lib.mmp Mon May 03 14:09:14 2010 +0300 @@ -18,6 +18,5 @@ target utrace.lib targettype implib linkas utrace.ldd -//deffile ../../~/ldd.def SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utraceusr.mmp --- a/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utraceusr.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/group/utraceusr.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -15,13 +15,13 @@ // // -systeminclude /epoc32/include/ -userinclude ./ /epoc32/include/ - - target utrace.dll targettype dll deffile utracedll.def +vendorid 0x70000001 +capability all + +OS_LAYER_SYSTEMINCLUDE userinclude ../inc/ @@ -30,7 +30,4 @@ library euser.lib -vendorid 0x70000001 -capability all - SMPSAFE diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/devicedriver/inc/d32utrace.h --- a/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/inc/d32utrace.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/inc/d32utrace.h Mon May 03 14:09:14 2010 +0300 @@ -18,16 +18,14 @@ #ifndef D32UTRACE_H #define D32UTRACE_H -/*#include +#include #include -*/ #ifndef __KERNEL_MODE__ -//#include +#include #endif - /** Interface to the utrace api. diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/devicedriver/src/utracedrv.cpp --- a/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/src/utracedrv.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/src/utracedrv.cpp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 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" @@ -15,9 +15,9 @@ // // -#include +#include #include -#include +#include "d32utrace.h" #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/devicedriver/src/utraceusr.cpp --- a/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/src/utraceusr.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/devicedriver/src/utraceusr.cpp Mon May 03 14:09:14 2010 +0300 @@ -16,7 +16,7 @@ // #include -#include +#include "d32utrace.h" #include diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/group/bld.inf --- a/traceservices/tracefw/utf_trace_api/unit_test/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -12,11 +12,6 @@ // // Description: // -/** - @file bld.inf - @internalTechnology -*/ - #include "../devicedriver/group/bld.inf" #include "../te-utrace/group/bld.inf" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/group/bld.inf --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/group/bld.inf Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/group/bld.inf Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -15,27 +15,14 @@ // // - -//PRJ_EXPORTS - -PRJ_TESTEXPORTS -//to c: -../scripts/te_utracesuite.script /epoc32/winscw/c/testdata/scripts/te_utracesuite.script -../testdata/te_utracesuite.ini /epoc32/winscw/c/testdata/configs/te_utracesuite.ini -//to z: -../scripts/te_utracesuite.script /epoc32/release/winscw/udeb/z/testdata/scripts/te_utracesuite.script -../testdata/te_utracesuite.ini /epoc32/release/winscw/udeb/z/testdata/configs/te_utracesuite.ini - -./te_utracesuite.iby /epoc32/rom/include/te_utracesuite.iby - - -PRJ_MMPFILES - - -PRJ_TESTMMPFILES -te_utracesuite.mmp - PRJ_PLATFORMS DEFAULT +PRJ_TESTEXPORTS +te_utracesuite.iby /epoc32/rom/include/te_utracesuite.iby +../scripts/te_utracesuite.script z:/testdata/scripts/te_utracesuite.script +../testdata/te_utracesuite.ini z:/testdata/configs/te_utracesuite.ini + +PRJ_TESTMMPFILES +te_utracesuite.mmp manual diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/group/te_utracesuite.mmp --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/group/te_utracesuite.mmp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/group/te_utracesuite.mmp Mon May 03 14:09:14 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2002-2010 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" @@ -17,19 +17,19 @@ TARGETTYPE exe UID 0x1000007A 0x101F7784 +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../devicedriver/inc + SOURCEPATH ../src SOURCE te_utracesuiteserver.cpp SOURCE te_utracesuitestepbase.cpp SOURCE cutrace_nonstatic_step.cpp SOURCE cutrace_static_step.cpp SOURCE cutrace_user_performance_step.cpp -SOURCE te_btracecmds.cpp cutrace_kernperf_step.cpp - - -USERINCLUDE ../inc - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/test +SOURCE te_btracecmds.cpp +SOURCE cutrace_kernperf_step.cpp LIBRARY euser.lib LIBRARY testexecuteutils.lib diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_kernperf_step.h --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_kernperf_step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_kernperf_step.h Mon May 03 14:09:14 2010 +0300 @@ -25,7 +25,7 @@ #define CUTRACE_KERNPERF_STEP_H_ -#include +#include #include "te_utracesuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_nonstatic_step.h --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_nonstatic_step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_nonstatic_step.h Mon May 03 14:09:14 2010 +0300 @@ -23,7 +23,7 @@ */ #if (!defined __CUTRACE_PRINTF_CHAR_STEP_H__) #define __CUTRACE_PRINTF_CHAR_STEP_H__ -#include +#include #include "te_utracesuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_static_step.h --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_static_step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_static_step.h Mon May 03 14:09:14 2010 +0300 @@ -26,7 +26,7 @@ -#include +#include #include "te_utracesuitestepbase.h" class CUTrace_Static_Step : public CTe_UTraceSuiteStepBase diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_user_performance_step.h --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_user_performance_step.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/cutrace_user_performance_step.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ */ #ifndef CUTRACE_PERFORMANCE_STEP_H_ #define CUTRACE_PERFORMANCE_STEP_H_ -#include +#include #include "te_utracesuitestepbase.h" diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/te_utracesuiteserver.h --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/te_utracesuiteserver.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/te_utracesuiteserver.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_UTRACE_SERVER_H__) #define __TE_UTRACE_SERVER_H__ -#include +#include class CTe_UTraceSuite : public CTestServer diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/te_utracesuitestepbase.h --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/te_utracesuitestepbase.h Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/inc/te_utracesuitestepbase.h Mon May 03 14:09:14 2010 +0300 @@ -24,7 +24,7 @@ #if (!defined __TE_UTRACE_STEP_BASE__) #define __TE_UTRACE_STEP_BASE__ -#include +#include #include #include "te_btracecmds.h" // Please add your include here if you have diff -r 3eacc0623088 -r 55f2396f6d25 traceservices/tracefw/utf_trace_api/unit_test/te-utrace/src/cutrace_kernperf_step.cpp --- a/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/src/cutrace_kernperf_step.cpp Fri Apr 16 16:49:27 2010 +0300 +++ b/traceservices/tracefw/utf_trace_api/unit_test/te-utrace/src/cutrace_kernperf_step.cpp Mon May 03 14:09:14 2010 +0300 @@ -16,14 +16,13 @@ // /** - @file CUTrace_Performance_Step.cpp + @file @internalTechnology */ +#include "d32utrace.h" + #include "cutrace_kernperf_step.h" #include "te_utracesuitedefs.h" -#include - - CUTrace_KernPerf_Step::~CUTrace_KernPerf_Step()