--- a/featuremgmt/featuremgr/group/featmgr.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/group/featmgr.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/featuremgmt/featuremgr/group/featmgrserver.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/group/featmgrserver.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/featuremgmt/featuremgr/src/clientdll/featmgrclient.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/clientdll/featmgrclient.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -384,16 +384,12 @@
// RFeatMgrClient::ReRequestNotification(TUid&, TRequestStatus&)
// -----------------------------------------------------------------------------
//
-TInt RFeatMgrClient::ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus )
+void RFeatMgrClient::ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus )
{
TPckgBuf<TInt> pckg;
- TInt retval( KErrNone );
-
- iFeaturePckg.Set( (TUint8*) &aFeatUid.iUid, sizeof(TUid), sizeof(TUid) );
- TIpcArgs args( &iFeaturePckg );
- SendReceive( EFeatMgrReqNotify, args, aStatus );
-
- return retval;
+ iFeaturePckg.Set( (TUint8*) &aFeatUid.iUid, sizeof(TUid), sizeof(TUid) );
+ TIpcArgs args( &iFeaturePckg );
+ SendReceive( EFeatMgrReqNotify, args, aStatus );
}
// -----------------------------------------------------------------------------
@@ -617,6 +613,9 @@
// DEBUG only API functions
#ifdef EXTENDED_FEATURE_MANAGER_TEST
+
+#pragma BullseyeCoverage off
+
/**
*/
void RFeatMgrClient::ResourceMark()
@@ -685,6 +684,8 @@
return sizePckg();
}
+#pragma BullseyeCoverage on
+
#endif
// End of File
--- a/featuremgmt/featuremgr/src/clientdll/featmgrclient.h Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/clientdll/featmgrclient.h Mon Mar 15 12:46:30 2010 +0200
@@ -75,7 +75,7 @@
TInt RequestNotification( RFeatureUidArray& aFeatures, TUid& aFeatUid,
TRequestStatus& aStatus );
- TInt ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus );
+ void ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus );
TInt RequestNotifyCancel( TUid aFeature ) const;
--- a/featuremgmt/featuremgr/src/clientdll/featmgrresourcetester.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/clientdll/featmgrresourcetester.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/featuremgmt/featuremgr/src/clientdll/featmgrtlsdata.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/clientdll/featmgrtlsdata.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -225,9 +225,9 @@
// CFeatMgrTlsData::ReRequestNotification(TUid&, TRequestStatus&)
// -----------------------------------------------------------------------------
//
-TInt CFeatMgrTlsData::ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus )
+void CFeatMgrTlsData::ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus )
{
- return iFeatMgrClient.ReRequestNotification( aFeatUid, aStatus );
+ iFeatMgrClient.ReRequestNotification( aFeatUid, aStatus );
}
@@ -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
--- a/featuremgmt/featuremgr/src/clientdll/featmgrtlsdata.h Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/clientdll/featmgrtlsdata.h Mon Mar 15 12:46:30 2010 +0200
@@ -100,7 +100,7 @@
TInt RequestNotification( RFeatureUidArray& aFeatures, TUid& aFeatUid,
TRequestStatus& aStatus );
- TInt ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus );
+ void ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus );
TInt RequestNotifyCancel( TUid aFeature ) const;
--- a/featuremgmt/featuremgr/src/clientdll/featureclient.h Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/clientdll/featureclient.h Mon Mar 15 12:46:30 2010 +0200
@@ -153,7 +153,7 @@
* @param aStatus Client request to be signalled asynchronously.
* @return One of the Symbian OS system-wide error codes.
*/
- virtual TInt ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus ) = 0;
+ virtual void ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus ) = 0;
/**
* Cancel notification request for single feature's changes.
--- a/featuremgmt/featuremgr/src/clientdll/featurenotifier.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/clientdll/featurenotifier.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -76,6 +76,11 @@
iFeatMgrClient = new (ELeave) RFeatMgrClient;
// Connect to Feature Manager server
TInt err( iFeatMgrClient->Connect() );
+ if (err!=KErrNone)
+ {
+ delete iFeatMgrClient;
+ iFeatMgrClient=NULL;
+ }
User::LeaveIfError(err);
CActiveScheduler::Add( this );
@@ -112,12 +117,20 @@
}
iFeatures.Reset();
- iFeatures.Append( aFeature );
- TInt err = iFeatMgrClient->RequestNotification( iFeatures, iFeatureChanged, iStatus );
+ TInt err=iFeatures.Append( aFeature );
+ if (err!=KErrNone)
+ {
+ return err;
+ }
+ err = iFeatMgrClient->RequestNotification( iFeatures, iFeatureChanged, iStatus );
if ( err == KErrNone )
{
SetActive();
}
+ else
+ {
+ iFeatures.Reset();
+ }
return err;
}
@@ -135,7 +148,7 @@
iFeatures.Reset();
TInt count = aFeatures.Count();
-
+ TInt err=KErrNone;
for(TInt i = 0; i < count; i++ )
{
// Do not append duplicate entries
@@ -143,16 +156,24 @@
TInt index = iFeatures.Find( uid, FindByUid );
if( index == KErrNotFound )
{
- iFeatures.Append( uid );
+ err=iFeatures.Append( uid );
+ if (err!=KErrNone)
+ {
+ iFeatures.Reset();
+ return err;
+ }
}
}
- TInt err = iFeatMgrClient->RequestNotification( iFeatures, iFeatureChanged, iStatus );
+ err = iFeatMgrClient->RequestNotification( iFeatures, iFeatureChanged, iStatus );
if ( err == KErrNone )
{
SetActive();
}
-
+ else
+ {
+ iFeatures.Reset();
+ }
return err;
}
--- a/featuremgmt/featuremgr/src/featdiscovery/featdiscovery.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/featdiscovery/featdiscovery.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -46,6 +46,7 @@
TInt err;
TFeatureStat feature;
feature.iFeatureID = aFeature;
+ feature.iSupported=EFalse;
err = iStatus.Append( feature );
if( err == KErrNone )
--- a/featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -191,7 +191,7 @@
flags.Set( EFeatureRuntime );
//Check the feature falg is valid
- TRAP(err, err = ValidateRuntimeFeatureFlagL(flags));
+ TRAP(err,ValidateRuntimeFeatureFlagL(flags));
if (err != KErrNone)
return err;
@@ -607,7 +607,7 @@
if ((err == KErrCorrupt) || (err == KErrArgument))
{
- iFs.Delete(path);
+ User::LeaveIfError(iFs.Delete(path));
aFeaturesReady = ETrue;
}
else if ( err != KErrNone && err != KErrNotFound && err != KErrPathNotFound )
@@ -866,7 +866,7 @@
// Write header and entry
RFeatureServerArray temp(1);
CleanupClosePushL( temp );
- temp.Append( aFeature );
+ temp.AppendL( aFeature );
WriteHeaderAndEntriesL( writeStream, temp );
CleanupStack::PopAndDestroy( &temp );
CleanupStack::PopAndDestroy( &writeStream );
@@ -961,13 +961,14 @@
{
aArray[i].ExternalizeL( aStream );
}
+ aStream.CommitL();
}
// -----------------------------------------------------------------------------
// CFeatMgrFeatureRegistry::MergePluginFeatures
// -----------------------------------------------------------------------------
//
-void CFeatMgrFeatureRegistry::MergePluginFeatures(
+void CFeatMgrFeatureRegistry::MergePluginFeaturesL(
RArray<FeatureInfoCommand::TFeature>& aList )
{
FUNC_LOG
@@ -1006,6 +1007,7 @@
TInt err = iFeatureList.InsertInOrder( newFeature, FindByUid );
INFO_LOG2( "CFeatMgrFeatureRegistry::MergePluginFeatures - 0x%08x insert result %d",
newFeature.FeatureUid().iUid, err );
+ User::LeaveIfError(err);
}
}
}
@@ -1014,7 +1016,7 @@
// CFeatMgrFeatureRegistry::MergePluginFeatures
// -----------------------------------------------------------------------------
//
-void CFeatMgrFeatureRegistry::MergePluginFeatures( RFeatureArray& aList )
+void CFeatMgrFeatureRegistry::MergePluginFeaturesL( RFeatureArray& aList )
{
FUNC_LOG
@@ -1048,6 +1050,7 @@
TInt err = iFeatureList.InsertInOrder( newFeature, FindByUid );
INFO_LOG2( "CFeatMgrFeatureRegistry::MergePluginFeatures - 0x%08x insert result %d",
newFeature.FeatureUid().iUid, err );
+ User::LeaveIfError(err);
}
}
}
@@ -1107,9 +1110,8 @@
* The following are the rules to check for errors in the run time defined feature flags
* Rule 1)Blacklisting of a run-time defined feature flag is an error
* Rule 2)Un-initialised feature flag should be modifiable.
- * Funtion returns KErrArgument if a rule is broken otherwise KErrNone
*/
-TInt CFeatMgrFeatureRegistry::ValidateRuntimeFeatureFlagL(TBitFlags32 aFlags)
+void CFeatMgrFeatureRegistry::ValidateRuntimeFeatureFlagL(TBitFlags32 aFlags)
{
//Rule 1 (Blacklisting of run-time defined feature aFlags is not allowed)
@@ -1125,8 +1127,6 @@
//error
User::Leave( KErrArgument );
}
-
- return KErrNone;
}
@@ -1136,7 +1136,7 @@
* to discover if any changes have taken place: then it will handle the required
* notifications for new, deleted and changed featuers.
*/
-TInt CFeatMgrFeatureRegistry::HandleRestoredFeatureNotificationsL( void )
+void CFeatMgrFeatureRegistry::HandleRestoredFeatureNotificationsL()
{
// All comparisons are between the new list iFeatureList and the old list iFeatureListBackup
TInt new_count = iFeatureList.Count();
@@ -1161,7 +1161,7 @@
if( KErrNotFound == index )
{
// Recently added feature
- added.Append( iFeatureList[i] );
+ added.AppendL( iFeatureList[i] );
}
else
{
@@ -1177,7 +1177,7 @@
if( !( old_flags == new_flags) || !( old_data == new_data) )
{
// changed in the "new" iFeatureList array
- changed.Append( iFeatureList[i] );
+ changed.AppendL( iFeatureList[i] );
}
}
@@ -1199,7 +1199,7 @@
if( KErrNotFound == index )
{
// Recently removed feature
- removed.Append( iFeatureListBackup[i] );
+ removed.AppendL( iFeatureListBackup[i] );
}
// the else has already been completed in previous loop
@@ -1233,8 +1233,6 @@
TFeatureChangeType changeType( EFeatureFeatureDeleted );
iObserver.HandleFeatureChange( entry, changeType );
}
-
- return( 0 );
}
// -----------------------------------------------------------------------------
--- a/featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.h Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/serverexe/featmgrfeatureregistry.h Mon Mar 15 12:46:30 2010 +0200
@@ -108,12 +108,12 @@
/**
* Merges features to common feature array from plugin.
*/
- void MergePluginFeatures( RArray<FeatureInfoCommand::TFeature>& aList );
+ void MergePluginFeaturesL( RArray<FeatureInfoCommand::TFeature>& aList );
/**
* Merges features to common feature array from plugin.
*/
- void MergePluginFeatures( RFeatureArray& aList );
+ void MergePluginFeaturesL( RFeatureArray& aList );
/**
* Returns feature support status.
@@ -161,7 +161,7 @@
* This function will handle the required notifications for new, deleted and changed features
* after a restore operation has taken place.
*/
- TInt HandleRestoredFeatureNotificationsL( void );
+ void HandleRestoredFeatureNotificationsL();
/**
* Returns the fully qualified path and filename for the runtime feature data file.
@@ -243,7 +243,7 @@
void ValidateHeaderL( RFileReadStream& stream, TUint32& count, TUint32& countDSRs );
void WriteHeaderAndEntriesL( RFileWriteStream &aStream, RFeatureServerArray& aArray );
TInt ValidateFeatureFlag(TBitFlags32 aFlags);
- TInt ValidateRuntimeFeatureFlagL(TBitFlags32 aFlags);
+ void ValidateRuntimeFeatureFlagL(TBitFlags32 aFlags);
private:
--- a/featuremgmt/featuremgr/src/serverexe/featmgrserver.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/serverexe/featmgrserver.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -226,7 +226,6 @@
}
delete iTimer;
- iFs.Close();
iPluginList.Close();
// De register Backup and Restore and cleanup memory
@@ -239,6 +238,7 @@
}
delete iRegistry;
+ iFs.Close();
}
@@ -528,7 +528,7 @@
{
if ( iPluginList[i].iPluginHandler == aPluginHandler )
{
- iRegistry->MergePluginFeatures( aFeatureList );
+ iRegistry->MergePluginFeaturesL( aFeatureList );
// Send command to load enhanced feature info
TRAPD( err, iPluginList[i].iPluginHandler->SendCommandL(
FeatureInfoCommand::ELoadEnhancedFeatureInfoCmdId ) );
@@ -572,7 +572,7 @@
{
if ( iPluginList[i].iPluginHandler == aPluginHandler )
{
- iRegistry->MergePluginFeatures( aFeatureList );
+ iRegistry->MergePluginFeaturesL( aFeatureList );
// Send another command if something left to process
iPluginList[i].iPluginReady = ETrue;
}
@@ -820,8 +820,6 @@
void CFeatMgrServer::HandleRestoredNotificationsL( void )
{
iRegistry->HandleRestoredFeatureNotificationsL();
-
- return;
}
/**
--- a/featuremgmt/featuremgr/src/serverexe/featmgrsession.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/src/serverexe/featmgrsession.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -143,7 +143,18 @@
else
{
INFO_LOG( "CFeatMgrSession::ServiceL() - plugins not ready" );
- iList.AddLast( *CFeatMgrPendingRequest::NewL( aMessage ) );
+ CFeatMgrPendingRequest* request=NULL;
+ TRAPD(error,request=CFeatMgrPendingRequest::NewL( aMessage ));
+ if (error!=KErrNone)
+ {
+ LOG_IF_ERROR1( error, "CFeatMgrSession::ServiceL(): Error in Adding Pending Request: %d", error );
+ //cannot create pending request so need to indicate to the client rather than letting the cient wait forever.
+ aMessage.Complete(error);
+ }
+ else
+ {
+ iList.AddLast(*request);
+ }
}
}
else
@@ -537,6 +548,8 @@
#ifdef EXTENDED_FEATURE_MANAGER_TEST
+#pragma BullseyeCoverage off
+
case EFeatMgrResourceMark:
ResourceCountMarkStart();
break;
@@ -586,7 +599,10 @@
aMessage.WriteL( 0, resPckg );
break;
- }
+ }
+
+#pragma BullseyeCoverage on
+
#endif
// Cannot identify the message.
--- a/featuremgmt/featuremgr/test/rtest/group/t_fmgrstartup.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/test/rtest/group/t_fmgrstartup.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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,6 +20,9 @@
CAPABILITY ProtServ ReadDeviceData AllFiles
+//CodeWarrior compilation options - disable the "illegal pragma" warning
+OPTION CW -w noillpragmas
+
USERINCLUDE .
USERINCLUDE ../../../inc
USERINCLUDE ../../../src/inc
--- a/featuremgmt/featuremgr/test/rtest/src/t_fmgrbadclient.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgrbadclient.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -20,8 +20,8 @@
#include "featurepanics.h"
#include <featurecontrol.h>
#include <featurenotifier.h>
-#include "..\src\inc\featmgrconfiguration.h"
-#include "..\src\inc\featmgrclientserver.h"
+#include "../src/inc/featmgrconfiguration.h"
+#include "../src/inc/featmgrclientserver.h"
using namespace NFeature;
--- a/featuremgmt/featuremgr/test/rtest/src/t_fmgroom.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgroom.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -39,10 +39,8 @@
static TInt TheProcessHandleCount = 0;
static TInt TheThreadHandleCount = 0;
static TInt TheAllocatedCellsCount = 0;
+static const TInt KBurstRate = 20;
-#ifdef EXTENDED_FEATURE_MANAGER_TEST
-static const TInt KBurstRate = 20;
-#endif
enum TFeatMgrOomTestMode
{
@@ -560,14 +558,15 @@
TEntry entry;
TInt err = fsSession.Entry(KZFeaturesDir, entry);
+ TEST2 (err, KErrNone);
if (err == KErrNone)
{
+ //if not extended this is attempting to delte from the Z drive
+#ifdef EXTENDED_FEATURE_MANAGER_TEST
err = BaflUtils::DeleteFile(fsSession,KZFeaturesFile);
TEST2 (err, KErrNone);
-
+#endif
}
- TEST2 (err, KErrNone);
-
// close file server session
fsSession.Close();
}
--- a/featuremgmt/featuremgr/test/rtest/src/t_fmgrswi.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgrswi.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -21,7 +21,7 @@
#include <featureuids.h>
#include <featurecontrol.h>
#include <featdiscovery.h>
-#include "..\src\inc\featmgrconfiguration.h"
+#include "../src/inc/featmgrconfiguration.h"
///////////////////////////////////////////////////////////////////////////////////////
--- a/featuremgmt/featuremgr/test/tef/tef_efm_unit/src/efm_unit_teststeps.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/featuremgmt/featuremgr/test/tef/tef_efm_unit/src/efm_unit_teststeps.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -285,7 +285,7 @@
TVerdict CServerMergePluginFeaturesTestStep::doTestStepL()
{
// This is a void method, so we can't actually check directly if this worked
- ifeatureSet->MergePluginFeatures(irfa);
+ ifeatureSet->MergePluginFeaturesL(irfa);
// .. so get the supported features in this array and check
RFeatureUidArray rf;
@@ -363,7 +363,7 @@
TVerdict CServerMergePluginFeaturesTestStep2::doTestStepL()
{
// This is a void method, so we can't actually check directly if this worked
- ifeatureSet->MergePluginFeatures(ifc);
+ ifeatureSet->MergePluginFeaturesL(ifc);
// .. so get the supported features in this array and check
RFeatureUidArray rf;
--- a/loggingservices/eventlogger/Rom/logengtest.iby Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/Rom/logengtest.iby Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/group/BLD.INF Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/group/BLD.INF Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/group/logengtests.bat Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/group/logengtests.bat Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/T_LogSecurity.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/T_LogSecurity.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/inc/t_logsecuritypolicy.h Mon Mar 15 12:46:30 2010 +0200
@@ -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 <e32std.h>
+
+/**
+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 <TSecurityPolicy::TType> (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 <TCapability> (iSecurityPolicy.iCaps[aIndex]);
+ }
+ else if(aIndex < 7)
+ {
+ return static_cast <TCapability> (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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/inc/t_logutil.h Mon Mar 15 12:46:30 2010 +0200
@@ -0,0 +1,50 @@
+// 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 <e32test.h>
+
+//Define "TheTest" variable in the cpp test file
+extern RTest TheTest;
+
+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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/inc/t_logutil2.h Mon Mar 15 12:46:30 2010 +0200
@@ -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 <e32test.h>
+#include <s32file.h>
+#include <logcli.h>
+#include <logengdurations.h>
+#include <logengevents.h>
+#include <logwraplimits.h>
+#include <logfilterandeventconstants.hrh>
+#include <e32base.h>
+#include <f32file.h>
+#include <logviewchangeobserver.h>
+#include <logclientchangeobserver.h>
+#include "LogChangeDefinition.h"
+#include "LogServShared.h"
+#include "LogCliServShared.h"
+#include <babackup.h>
+#include "t_logservsession.h"
+#include "logcntdef.h"
+#include "t_logutil.h"
+
+#ifdef LOGGING_ENABLED
+
+#include <f32file.h>
+#include <flogger.h>
+
+
+
+_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<const TDesC> 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<const TDesC>(KString()), BBB); }
+#define LOGTEXT3(AAA, BBB, CCC) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue<const TDesC>(KString()), BBB, CCC); }
+#define LOGTEXT4(AAA, BBB, CCC, DDD) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue<const TDesC>(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
--- a/loggingservices/eventlogger/test/src/T_LogSecurity.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/T_LogSecurity.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <logeng.h>
#include <logengevents.h>
-#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
--- a/loggingservices/eventlogger/test/src/t_logapi.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logapi.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <e32math.h>
#include <logview.h>
#include <s32mem.h>
-#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<KLogMaxSharedStringLength> 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<changeCount; i++)
{
type = changes.At(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);
TEST(changes.Find(logId)==i);
TEST(changes.Find(logId, ELogChangeTypeEventAdded)>=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"));
--- a/loggingservices/eventlogger/test/src/t_logapi2.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logapi2.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <e32math.h>
#include <bautils.h>
#include <logview.h>
-#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;i<TheAddedEventCount;++i)
{
@@ -175,10 +173,10 @@
TEST2(active->iStatus.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
//
--- a/loggingservices/eventlogger/test/src/t_logapi_helper.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logapi_helper.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <e32test.h>
#include <s32file.h>
#include <numberconversion.h>
-
-
-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)
--- a/loggingservices/eventlogger/test/src/t_logbackup.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logbackup.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
#include <babackup.h>
-
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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"));
--- a/loggingservices/eventlogger/test/src/t_logbadclient.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logbadclient.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -18,6 +18,7 @@
#include <e32math.h>
#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<KMaxMessageArguments;++i)
{
- RDebug::Print(_L("##Arg %d, Type %d\r\n"), i + 1, data.iArgType[i]);
+ TheTest.Printf(_L("##Arg %d, Type %d\r\n"), i + 1, data.iArgType[i]);
switch(data.iArgType[i])
{
case EIntArgType:
- RDebug::Print(_L("Integer, value=%d\r\n"), data.iIntArg[i]);
+ TheTest.Printf(_L("Integer, value=%d\r\n"), data.iIntArg[i]);
break;
case ETextArgType:
- RDebug::Print(_L("Text, length=%d\r\n"), data.iTextArg[i].Length());
+ TheTest.Printf(_L("Text, length=%d\r\n"), data.iTextArg[i].Length());
break;
case EBinArgType:
- RDebug::Print(_L("Binary, length=%d\r\n"), data.iBinArg[i].Length());
+ TheTest.Printf(_L("Binary, length=%d\r\n"), data.iBinArg[i].Length());
break;
default:
- RDebug::Print(_L("Invalid argument type: %d\r\n"), data.iArgType[i]);
+ TheTest.Printf(_L("Invalid argument type: %d\r\n"), data.iArgType[i]);
break;
}
}
@@ -325,24 +284,24 @@
{
if(exitReason == KPanicCode)
{
- RDebug::Print(_L("##Server terminated!\r\n"));
- RDebug::Print(_L("##Iteration=%d, Function=%d\r\n"), data.iIteration, data.iFunction);
+ TheTest.Printf(_L("##Server terminated!\r\n"));
+ TheTest.Printf(_L("##Iteration=%d, Function=%d\r\n"), data.iIteration, data.iFunction);
for(TInt i=0;i<KMaxMessageArguments;++i)
{
- RDebug::Print(_L("##Arg %d, Type %d\r\n"), i + 1, data.iArgType[i]);
+ TheTest.Printf(_L("##Arg %d, Type %d\r\n"), i + 1, data.iArgType[i]);
switch(data.iArgType[i])
{
case EIntArgType:
- RDebug::Print(_L("Integer, value=%d\r\n"), data.iIntArg[i]);
+ TheTest.Printf(_L("Integer, value=%d\r\n"), data.iIntArg[i]);
break;
case ETextArgType:
- RDebug::Print(_L("Text, length=%d\r\n"), data.iTextArg[i].Length());
+ TheTest.Printf(_L("Text, length=%d\r\n"), data.iTextArg[i].Length());
break;
case EBinArgType:
- RDebug::Print(_L("Binary, length=%d\r\n"), data.iBinArg[i].Length());
+ TheTest.Printf(_L("Binary, length=%d\r\n"), data.iBinArg[i].Length());
break;
default:
- RDebug::Print(_L("Invalid argument type: %d\r\n"), data.iArgType[i]);
+ TheTest.Printf(_L("Invalid argument type: %d\r\n"), data.iArgType[i]);
break;
}
}
--- a/loggingservices/eventlogger/test/src/t_logbench.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logbench.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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,13 @@
#define __PROFILING__
#include <s32file.h>
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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"));
--- a/loggingservices/eventlogger/test/src/t_logcntmatch.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logcntmatch.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <bautils.h>
#include <logserv.rsg>
#include <barsc.h>
-#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();
--- a/loggingservices/eventlogger/test/src/t_logcompat.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logcompat.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <e32math.h>
#include <bautils.h>
#include <logview.h>
-#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
--- a/loggingservices/eventlogger/test/src/t_logcontact.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logcontact.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <logview.h>
-#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);
--- a/loggingservices/eventlogger/test/src/t_logenvcreate.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logenvcreate.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <e32test.h>
#include <bautils.h>
+#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;
--- a/loggingservices/eventlogger/test/src/t_logenvdestroy.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logenvdestroy.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <e32test.h>
#include <bautils.h>
+#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)
{
--- a/loggingservices/eventlogger/test/src/t_logevent.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logevent.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
-#include "TEST.H"
+#include "t_logutil2.h"
#include <s32mem.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 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"));
}
--- a/loggingservices/eventlogger/test/src/t_logfile.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logfile.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
-#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<KLogMaxSharedStringLength> 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
--- a/loggingservices/eventlogger/test/src/t_logfilter.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logfilter.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
-#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"));
}
--- a/loggingservices/eventlogger/test/src/t_logheap.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logheap.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
#include <logview.h>
-#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();
}
--- a/loggingservices/eventlogger/test/src/t_loghicaphelper.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_loghicaphelper.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <bautils.h>
#include <barsc.h>
#include <logserv.rsg>
-#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)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/src/t_logmaxnumlen.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
+#include <e32math.h>
+#include <bautils.h>
+#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
+ }
--- a/loggingservices/eventlogger/test/src/t_lognotify.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_lognotify.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <logview.h>
-#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();
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/src/t_logorderbyid.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
+#include <e32math.h>
+#include <logview.h>
+#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<KLogMaxDirectionLength> 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;
+ }
--- a/loggingservices/eventlogger/test/src/t_logplatformsecurity.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logplatformsecurity.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
#include <logcntdef.h>
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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
}
--- a/loggingservices/eventlogger/test/src/t_logpurge.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logpurge.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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
--- a/loggingservices/eventlogger/test/src/t_logsecureview.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logsecureview.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <logview.h>
-#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);
--- a/loggingservices/eventlogger/test/src/t_logservIPC.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logservIPC.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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();
--- a/loggingservices/eventlogger/test/src/t_logservercrash.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logservercrash.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
#include <e32math.h>
-
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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);
}
--- a/loggingservices/eventlogger/test/src/t_logsimid.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logsimid.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <bautils.h>
#include <logview.h>
#include <logcli.h>
-#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;i<TheAddedEventCount;++i)
{
@@ -286,10 +284,10 @@
TEST2(active->iStatus.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
--- a/loggingservices/eventlogger/test/src/t_logtype.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logtype.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
#include <logview.h>
-#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"));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/src/t_logutil.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -0,0 +1,137 @@
+// 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"
+
+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;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/src/t_logutil2.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -0,0 +1,937 @@
+// 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 <bautils.h>
+#include "t_logutil2.h"
+
+_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<KLogEngLogBufferSize> 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<const TDesC> 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;pos<aLength;++pos)
+ {
+ ptr.Append(TChar(' ' + pos));
+ }
+ return buf;
+ }
+
+//Returns whether the two filters are equal or not.
+TBool TestUtils::FiltersEqual(const CLogFilter& aFilter1, const CLogFilter& aFilter2)
+ {
+ return aFilter1.EventType() == aFilter2.EventType() &&
+ aFilter1.RemoteParty() == aFilter2.RemoteParty() &&
+ aFilter1.Direction() == aFilter2.Direction() &&
+ aFilter1.DurationType() == aFilter2.DurationType() &&
+ aFilter1.Status() == aFilter2.Status() &&
+ aFilter1.Contact() == aFilter2.Contact() &&
+ aFilter1.Number() == aFilter2.Number()
+#ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
+ &&
+ aFilter1.SimId() == aFilter2.SimId()
+#endif
+ ;
+ }
+
+//Creates HBufC8 object and puts it on the cleanup stack.
+//The buffer will be filled with (' ' + pos % (0xff - 32)) characters, where pos is the character position in the buffer.
+HBufC8* TestUtils::CreateBuf8LC(TInt aLength)
+ {
+ HBufC8* buf = HBufC8::NewLC(aLength);
+ TPtr8 ptr = buf->Des();
+ for(TInt pos=0;pos<aLength;++pos)
+ {
+ ptr.Append(TChar(' ' + pos % (0xff - 32)));
+ }
+ return buf;
+ }
+
+//Returns whether the two events are equal or not.
+TBool TestUtils::EventsEqual(const CLogEvent& aEvent1, const CLogEvent& aEvent2)
+ {
+ return aEvent1.Id() == aEvent2.Id() &&
+ aEvent1.EventType() == aEvent2.EventType() &&
+ aEvent1.RemoteParty() == aEvent2.RemoteParty() &&
+ aEvent1.Direction() == aEvent2.Direction() &&
+ aEvent1.Time() == aEvent2.Time() &&
+ aEvent1.DurationType() == aEvent2.DurationType() &&
+ aEvent1.Duration() == aEvent2.Duration() &&
+ aEvent1.Status() == aEvent2.Status() &&
+ aEvent1.Subject() == aEvent2.Subject() &&
+ aEvent1.Number() == aEvent2.Number() &&
+ aEvent1.Contact() == aEvent2.Contact() &&
+ aEvent1.Link() == aEvent2.Link() &&
+ aEvent1.Description() == aEvent2.Description() &&
+ aEvent1.Data() == aEvent2.Data()
+#ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
+ &&
+ aEvent1.SimId() == aEvent2.SimId()
+#endif
+ ;
+ }
+
+//Returns whether the two event types are equal or not.
+TBool TestUtils::TypesEqual(const CLogEventType& aType1, const CLogEventType& aType2)
+ {
+ return aType1.Uid() == aType2.Uid() &&
+ aType1.Description() == aType2.Description() &&
+ aType1.LoggingEnabled() == aType2.LoggingEnabled();
+ }
+
+//Waits for a key to be pressed.
+TBool TestUtils::WaitForKeyL(TTimeIntervalMicroSeconds32 aDelay, TKeyCode& aKeyCode)
+ {
+ TEST(TheTest.Console() != NULL);
+
+ // Create timer
+ CTestTimer* timer = CTestTimer::NewL();
+ CleanupStack::PushL(timer);
+ timer->After(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;
+ }
+
+
--- a/loggingservices/eventlogger/test/src/t_logview1.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logview1.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
#include <s32mem.h>
#include <e32math.h>
-
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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; i<changeCount; i++)
{
type = changes->At(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; i<changeCount; i++)
{
- TEST(changeObs->Changes().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; i<changeCount; i++)
{
type = changes->At(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; i<KTestEventNum; i+=2)
{
active->StartL();
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; i<changeCount; i++)
{
- test(changeObs->Changes().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"));
--- a/loggingservices/eventlogger/test/src/t_logview2.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logview2.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
#include <logeng.h>
#include <tz.h>
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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<KLogMaxDirectionLength> 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);
@@ -6789,7 +6787,7 @@
void doTestsL()
{
- TestUtils::Initialize(_L("T_LOGVIEW2"));
+ TestUtils::Initialize(_L("t_logview2"));
TestUtils::DeleteDatabaseL();
CLogClient* client = CLogClient::NewL(theFs);
@@ -6798,77 +6796,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,28 +6884,28 @@
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"));
--- a/loggingservices/eventlogger/test/src/t_logviewfail.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logviewfail.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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);
--- a/loggingservices/eventlogger/test/src/t_logviewfail2.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logviewfail2.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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"));
--- a/loggingservices/eventlogger/test/src/t_logviewfail3.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logviewfail3.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
-#include "TEST.H"
+#include "t_logutil2.h"
#include <logview.h>
-#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);
--- a/loggingservices/eventlogger/test/src/t_logwrap.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/src/t_logwrap.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <s32file.h>
#include <bautils.h>
-#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"));
}
--- a/loggingservices/eventlogger/test/t_logapi.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logapi.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logapi2.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logapi2.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logapi_helper.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logapi_helper.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logbackup.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logbackup.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logbadclient.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logbadclient.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logbench.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logbench.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logcntmatch.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logcntmatch.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logcompat.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logcompat.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logcontact.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logcontact.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logenvcreate.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logenvcreate.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logenvdestroy.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logenvdestroy.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logevent.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logevent.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logfile.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logfile.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logfilter.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logfilter.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logheap.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logheap.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_loghicapability.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_loghicapability.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_loghicaphelper.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_loghicaphelper.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_loglowcapability.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_loglowcapability.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/t_logmaxnumlen.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_lognotify.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_lognotify.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loggingservices/eventlogger/test/t_logorderbyid.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logpurge.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logpurge.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logsecureview_hicap.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logsecureview_hicap.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logsecureview_lowcap.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logsecureview_lowcap.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
-
-
--- a/loggingservices/eventlogger/test/t_logservIPC.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logservIPC.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logservercrash.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logservercrash.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logsimid.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logsimid.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logtype.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logtype.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logview1.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logview1.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logview2.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logview2.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logviewfail.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logviewfail.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logviewfail2.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logviewfail2.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logviewfail3.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logviewfail3.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/eventlogger/test/t_logwrap.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/eventlogger/test/t_logwrap.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/loggingservices/filelogger/INC/FLOGGER.H Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/filelogger/INC/FLOGGER.H Mon Mar 15 12:46:30 2010 +0200
@@ -16,31 +16,35 @@
//
/**
- @file
- @internalTechnology
+@file
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
*/
-
-
#ifndef __FLOGGER_H__
#define __FLOGGER_H__
#include <e32base.h>
/** Maximum log buffer size.
-@internalTechnology */
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
+*/
const TInt KLogBufferSize=150;
// [All of this start up stuff copied from DBMS]
class FLogger
/** Controls the flogger server.
-@internalComponent */
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
+*/
{
public:
class TSignal
/**
-@internalComponent
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
*/
{
friend class FLogger;
@@ -67,7 +71,9 @@
/** The mode used to write to the log file.
-@internalTechnology */
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
+*/
enum TFileLoggingMode
{
/** Log file mode has not been explicitly set. */
@@ -82,7 +88,9 @@
NONSHARABLE_CLASS(TLogFormatter16Overflow) :public TDes16Overflow
/** Unicode overflow handler.
-@internalComponent */
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
+*/
{
public:
virtual void Overflow(TDes16& aDes);
@@ -90,7 +98,9 @@
NONSHARABLE_CLASS(TLogFormatter8Overflow) :public TDes8Overflow
/** Overflow handler.
-@internalComponent */
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
+*/
{
public:
virtual void Overflow(TDes8& aDes);
@@ -98,7 +108,9 @@
class TLogFormatter
/** Formatting methods for log file data.
-@internalComponent */
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
+*/
{
public:
TLogFormatter();
@@ -120,7 +132,9 @@
class TLogFile
/** General access to packaged log files.
-@internalComponent */
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
+*/
{
public:
TLogFile();
@@ -146,7 +160,9 @@
The file logger API contains both static and non-static versions of access
functions to the file logging system.
-@internalTechnology */
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
+*/
{
public:
IMPORT_C RFileLogger();
--- a/loggingservices/filelogger/INC/FLOGGER.INL Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/filelogger/INC/FLOGGER.INL Mon Mar 15 12:46:30 2010 +0200
@@ -14,8 +14,9 @@
//
/**
- @file
- @internalTechnology
+@file
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
*/
#ifndef __FLOGGER_INL__
--- a/loggingservices/filelogger/group/BLD.INF Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/filelogger/group/BLD.INF Mon Mar 15 12:46:30 2010 +0200
@@ -23,8 +23,8 @@
PRJ_EXPORTS
-../INC/FLOGGER.H SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(flogger.h)
-../INC/FLOGGER.INL SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(flogger.inl)
+../INC/FLOGGER.H SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(flogger.h)
+../INC/FLOGGER.INL SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(flogger.inl)
../group/flogger.iby /epoc32/rom/include/flogger.iby
--- a/loggingservices/rfilelogger/Logger/Src/Client.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/rfilelogger/Logger/Src/Client.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -234,7 +234,7 @@
TBuf16<KMaxFilename> 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;
}
--- a/loggingservices/rfilelogger/Logger/Src/Server.Cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/loggingservices/rfilelogger/Logger/Src/Server.Cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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]<aCount[i-1]) return; // wrong format string from client
+ if(aCount[i]<aCount[i-1])
+ {
+ delete pBuf1;
+ return; // wrong format string from client
+ }
}
// seperating common log message and extra log fields will be easy for future maintaince.
TLogField8* alogField = new TLogField8[6]; // the common part of log message for both
// with and without extra log fields
- if(!alogField) return; // no memory
+ if(!alogField)
+ {
+ delete pBuf1;
+ return; // no memory
+ }
TLogField8* extralogField=NULL; // only applied to extra log fields
@@ -431,7 +439,11 @@
// Retrive the extra log fields
extralogField = new TLogField8[alength];
- if(!extralogField) return; // no memory
+ if(!extralogField)
+ {
+ delete pBuf1;
+ return; // no memory
+ }
for(TInt i=0; i<alength; i++)
{
aCount[6]=aCount[7]+2;
--- a/persistentstorage/centralrepository/common/inc/operations.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/centralrepository/common/inc/operations.h Mon Mar 15 12:46:30 2010 +0200
@@ -63,6 +63,7 @@
{
// create a new placeholder and set as deleted
TServerSetting newSetting(key);
+ newSetting.SetMeta(settingToDelete.Meta());
newSetting.SetDeleted();
GetWritableSettingList().OrderedInsertL(newSetting);
}
--- a/persistentstorage/centralrepository/test/t_cenrep.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/centralrepository/test/t_cenrep.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -38,6 +38,8 @@
const TUid KUidDriveCOnlyRepository = { 0x00000013 };
+const TUid KUidTestRepository3 = { 0x00000103 };
+
//
// Test repository 1
//
@@ -2239,6 +2241,64 @@
CleanupStack::PopAndDestroy();
}
+
+/**
+@SYMTestCaseID PDS-CENTRALREPOSITORY-CT-4113
+@SYMTestCaseDesc Validates meta data is not lost before a transaction is committed
+ when deleting a range of settings.
+@SYMTestPriority High
+@SYMTestActions 1) Start a transaction.
+ 2) Delete a setting using the delete range function.
+ 3) Create a new setting (using the deleted key)
+ 4) Commit the transaction.
+ 5) Check the metadata of the setting.
+@SYMTestExpectedResults When deleting a range of settings in a keyspace, and then
+ creating a new setting (with a key of a previously deleted setting)
+ the meta data should not be reset to 0, it should take on the default
+ metadata, if it exists.
+@SYMDEF DEF144530
+*/
+LOCAL_C void RangeDeleteMetaL()
+ {
+ TheTest.Next(_L(" @SYMTestCaseID:PDS-CENTRALREPOSITORY-CT-4113 "));
+
+ TUint32 partialKey = 0x0000004;
+ TUint32 mask = 0xFFFFFFF;
+ TUint32 meta = 0;
+ TUint32 expectedMeta = 0x10; // 16
+ TUint32 keyCount = 0;
+ TUint32 expectedKeyCount = 1;
+ TUint32 error;
+
+ CRepository* repository;
+ User::LeaveIfNull(repository = CRepository::NewL(KUidTestRepository3)); // 00000103.txt
+
+ repository->StartTransaction(CRepository::EReadWriteTransaction);
+
+ // Only want to delete 1 specific key, using the range delete function.
+ TInt ret = repository->Delete(partialKey, mask, error);
+ // We don't care about 'error' if 'ret==KErrNone'.
+ TEST2(ret, KErrNone);
+
+ // Create a new setting that is the same key and type as the deleted one.
+ ret = repository->Create(partialKey, 200);
+ TEST2(ret, KErrNone);
+
+ ret = repository->CommitTransaction(keyCount);
+ TEST2(ret, KErrNone);
+ // Confirm only 1 setting was updated.
+ TEST2(keyCount, expectedKeyCount);
+
+ // Check the meta data of the newly created setting. It should be the
+ // the same as the defaultmeta value in the keyspace.
+ ret = repository->GetMeta(partialKey, meta);
+ TEST2(ret, KErrNone);
+ TEST2(meta, expectedMeta);
+
+ delete repository;
+ }
+
+
/**
@SYMTestCaseID SYSLIB-CENTRALREPOSITORY-CT-0494
@SYMTestCaseDesc Tests the various functions on CentralRepository
@@ -2292,7 +2352,10 @@
TheTest.Next(_L("Notify-only client optimizations"));
NotifyOnlyL();
-
+
+ TheTest.Next(_L("Meta data after a Range Delete in transaction"));
+ RangeDeleteMetaL();
+
TheTest.End();
}
--- a/persistentstorage/sql/GROUP/BLD.INF Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/GROUP/BLD.INF Mon Mar 15 12:46:30 2010 +0200
@@ -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,7 @@
t_sqloom2.mmp
t_sqloom3.mmp
t_sqloom4.mmp
+t_sqloom5.mmp
t_sqlpanic.mmp
t_sqllang.mmp
t_sqlmulti.mmp
--- a/persistentstorage/sql/GROUP/sqltests.bat Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/GROUP/sqltests.bat Mon Mar 15 12:46:30 2010 +0200
@@ -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,7 @@
T_SQLOOM2.EXE
T_SQLOOM3.EXE
T_SQLOOM4.EXE
+T_SQLOOM5.EXE
T_SQLMULTI.EXE
T_SQLCOLLATE.EXE
T_SQLTRANS.EXE
--- a/persistentstorage/sql/GROUP/sqltests.iby Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/GROUP/sqltests.iby Mon Mar 15 12:46:30 2010 +0200
@@ -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,7 @@
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_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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/GROUP/t_sqloom5.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -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:
+//
+
+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
--- a/persistentstorage/sql/GROUP/t_sqlstartup.mmp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/GROUP/t_sqlstartup.mmp Mon Mar 15 12:46:30 2010 +0200
@@ -61,6 +61,7 @@
SOURCE SqlSrvStatementUtil.cpp
SOURCE SqlSrvSecurityMap.cpp
SOURCE SqlSrvUtil.cpp
+SOURCE SqlSrvResourceProfiler.cpp
SOURCEPATH ../SRC/Server/Compact
SOURCE SqlCompact.cpp
--- a/persistentstorage/sql/OsLayer/FileBuf64.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/OsLayer/FileBuf64.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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)
--- a/persistentstorage/sql/SQLite/attach.c Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SQLite/attach.c Mon Mar 15 12:46:30 2010 +0200
@@ -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
{
--- a/persistentstorage/sql/SQLite/readme.txt Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SQLite/readme.txt Mon Mar 15 12:46:30 2010 +0200
@@ -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.
+
--- a/persistentstorage/sql/SQLite364/attach.c Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SQLite364/attach.c Mon Mar 15 12:46:30 2010 +0200
@@ -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
{
--- a/persistentstorage/sql/SQLite364/readme.txt Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SQLite364/readme.txt Mon Mar 15 12:46:30 2010 +0200
@@ -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.
--- a/persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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;
--- a/persistentstorage/sql/SRC/Common/SqlMap.inl Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Common/SqlMap.inl Mon Mar 15 12:46:30 2010 +0200
@@ -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;
}
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompact.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompact.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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.
*/
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompact.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompact.h Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -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.
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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
@@ -129,13 +129,13 @@
TBuf8<KMaxFileName + 1> 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<sizeof(KMainDb8) + 1> 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;
}
/**
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactConn.h Mon Mar 15 12:46:30 2010 +0200
@@ -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:
--- a/persistentstorage/sql/SRC/Server/Compact/SqlCompactTimer.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/Compact/SqlCompactTimer.h Mon Mar 15 12:46:30 2010 +0200
@@ -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 needed 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.
--- a/persistentstorage/sql/SRC/Server/SqlBur.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlBur.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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<len;++i)
{
- TUint64 carry=total&(0x8000000000000000ULL);
- total<<=1;
- if(carry)
- {
- total|=1;
- }
- TUint in=ptr[i];
- total+=in;
+ total = (total << 1) | (total >> 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;
--- a/persistentstorage/sql/SRC/Server/SqlBur.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlBur.h Mon Mar 15 12:46:30 2010 +0200
@@ -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<TParse> iFileList; // which is populated by the SQL server
RFile64 iFile;
--- a/persistentstorage/sql/SRC/Server/SqlSrvConfig.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvConfig.h Mon Mar 15 12:46:30 2010 +0200
@@ -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:
--- a/persistentstorage/sql/SRC/Server/SqlSrvDatabase.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvDatabase.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -731,7 +731,7 @@
TInt err = FinalizeAttachedDb(aDbName);
if(err == KErrNone)
{
- TRAP(err, RemoveFromMapsL(aDbName));//ignore the error
+ TRAP_IGNORE(RemoveFromMapsL(aDbName));
}
else
{
@@ -1564,6 +1564,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);
--- a/persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvFileData.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -196,12 +196,18 @@
{
__SQLASSERT((TUint)aFileNameArgNum < KMaxMessageArguments, ESqlPanicBadArgument);
__SQLASSERT(iSysDrivePrivatePath.DriveAndPath().Length() > 0, ESqlPanicInternalError);
-
+
if(aFileNameLen < 1 || aFileNameLen > KMaxFileName)
{
__SQLLEAVE(KErrBadName);
}
+#ifdef SQLSRV_STARTUP_TEST
+ aMessage.Int0();//prevents compiler warning
+ aFileNameArgNum = aFileNameArgNum;//prevents compiler warning
+ iFileName.Copy(*(const TDesC*)aConfigStr);
+#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
@@ -217,7 +223,9 @@
::CreatePrivateDataPathL(iFs, iDrive);
}
iReadOnly = ::IsReadOnlyFileL(iFs, FileName());
+#ifndef SQLSRV_STARTUP_TEST
::ExtractConfigParamsL(aConfigStr, iConfigParams, iConfig);
+#endif
}
/**
--- a/persistentstorage/sql/SRC/Server/SqlSrvFileData.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvFileData.h Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -129,7 +129,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)
--- a/persistentstorage/sql/SRC/Server/SqlSrvMain.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvMain.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <stdio.h>
#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, "");
@@ -420,7 +423,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
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -498,9 +506,6 @@
fileNameCol = NULL;
} while((err = findFile.FindWild(fileNameCol)) == KErrNone);//Get the next set of files
}//end of "if(err == KErrNone)"
- //TODO: once DEF144134 gets fixed, the next 2 lines shall be removed
- delete fileNameCol;
- fileNameCol = NULL;
__SQLASSERT(!fileNameCol, ESqlPanicInternalError);
if(err != KErrNotFound && err != KErrNone)
{
--- a/persistentstorage/sql/SRC/Server/SqlSrvSession.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvSession.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -1668,11 +1668,11 @@
TSqlSrvHandleType handleType = static_cast <TSqlSrvHandleType> (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);
}
--- a/persistentstorage/sql/SRC/Server/SqlSrvStatement.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvStatement.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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"
@@ -28,7 +28,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 +90,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 +200,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 +277,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 +306,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.
@@ -692,9 +692,6 @@
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.
-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.
-
@return A pointer to a heap allocated HBufC object with the delcared column types. The caller is responsible
for the HBufC object destruction.
*/
@@ -716,9 +713,10 @@
}
/**
-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 +744,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
--- a/persistentstorage/sql/SRC/Server/SqlSrvStatement.inl Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvStatement.inl Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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 <const TUint16*> (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 <const char*> (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: ";".
--- a/persistentstorage/sql/TEST/t_sqldbconfigfile.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/TEST/t_sqldbconfigfile.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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! ///
/////////////////////////////////////////////////////////////////////////////////////////////////
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/persistentstorage/sql/TEST/t_sqloom5.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -0,0 +1,575 @@
+// 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 <e32test.h>
+#include <bautils.h>
+#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");
+
+extern CSqlServer* TheServer;
+
+static TInt TheProcessHandleCount = 0;
+static TInt TheThreadHandleCount = 0;
+static TInt TheAllocatedCellsCount = 0;
+
+#ifdef _DEBUG
+static const TInt KBurstRate = 20;
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////////
+
+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;
+ }
+
+/**
+@SYMTestCaseID PDS-SQL-UT-4167
+@SYMTestCaseDesc CSqlSrvDatabase::CreateL() OOM test.
+@SYMTestPriority High
+@SYMTestActions The test runs CSqlSrvDatabase::CreateL() in an OOM loop.
+@SYMTestExpectedResults Test must not fail
+@SYMDEF DEF144577
+*/
+void CreateDatabaseOomTest()
+ {
+ (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, (const TDesC8*)&KDbFile));
+ if(err == KErrNone)
+ {
+ CSqlSrvDatabase* db = NULL;
+ TRAP(err, db = CSqlSrvDatabase::CreateL(fdata));
+ delete db;
+ }
+ OomPostStep();
+ }
+
+ delete TheServer;
+ TheServer = NULL;
+
+ if(err != KErrNoMemory)
+ {
+ 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-4168
+@SYMTestCaseDesc CSqlSrvDatabase::OpenL() OOM test - non-secure database.
+@SYMTestPriority High
+@SYMTestActions The test runs CSqlSrvDatabase::OpenL() in an OOM loop.
+@SYMTestExpectedResults Test must not fail
+@SYMDEF DEF144577
+*/
+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, (const TDesC8*)&KDbFile));
+ if(err == KErrNone)
+ {
+ CSqlSrvDatabase* db = NULL;
+ TRAP(err, db = CSqlSrvDatabase::OpenL(fdata));
+ delete db;
+ }
+
+ OomPostStep();
+ }
+
+ delete TheServer;
+ TheServer = NULL;
+
+ if(err != KErrNoMemory)
+ {
+ 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-4169
+@SYMTestCaseDesc CSqlSrvDatabase::CreateSecureL() OOM test.
+@SYMTestPriority High
+@SYMTestActions The test runs CSqlSrvDatabase::CreateSecureL() in an OOM loop.
+@SYMTestExpectedResults Test must not fail
+@SYMDEF DEF144577
+*/
+void CreateSecureDatabaseOomTest()
+ {
+ (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, (const TDesC8*)&KDbFile2));
+ 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;
+
+ if(err != KErrNoMemory)
+ {
+ 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-4170
+@SYMTestCaseDesc CSqlSrvDatabase::OpenL() OOM test - secure database.
+@SYMTestPriority High
+@SYMTestActions The test runs CSqlSrvDatabase::OpenL() in an OOM loop.
+@SYMTestExpectedResults Test must not fail
+@SYMDEF DEF144577
+*/
+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, (const TDesC8*)&KDbFile2));
+ if(err == KErrNone)
+ {
+ CSqlSrvDatabase* db = NULL;
+ TRAP(err, db = CSqlSrvDatabase::OpenL(fdata));
+ delete db;
+ }
+
+ OomPostStep();
+ }
+
+ delete TheServer;
+ TheServer = NULL;
+
+ if(err != KErrNoMemory)
+ {
+ TEST2(err, KErrNone);
+ }
+ TheTest.Printf(_L("\r\n===CSqlSrvDatabase::OpenL() [secure db] OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo);
+ }
+
+/////////////////////////////////////////////////////////////
+
+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<KDbConnCount;++i) \
+ { \
+ delete db[i]; \
+ }
+
+//Creates CSqlSrvDatabase object where the database file is dbFile (the second macro parameter).
+//The CSqlSrvDatabase pointer db[N - 1] (N is the first macro parameter) will be set to point to
+//the created CSqlSrvDatabase object.
+//N is the number of the database to be opened, between 1 and KDbConnCount.
+#define TEST_OPEN_DB(N, dbFile) \
+ __ASSERT_DEBUG(N > 0 && N <= KDbConnCount, User::Invariant()); \
+ TRAP(err, fdata.SetL(msg, dbFile.Length(), 0, (const TDesC8*)&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<M>", 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, (const TDesC8*)&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>" (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)
+ {
+ (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, (const TDesC8*)&aDbFile));
+
+ CSqlSrvDatabase* db = NULL;
+ TRAP(err, db = CSqlSrvDatabase::CreateSecureL(fdata, policy));
+ delete db;
+ TEST2(err, KErrNone);
+ }
+
+/**
+@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).
+@SYMTestExpectedResults Test must not fail
+@SYMDEF DEF144577, DEF144603
+*/
+void OpenAttachDatabaseOomTest()
+ {
+ //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);
+ CreateSecureTestDb(KDbFile4);
+
+ //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<M>", 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<M>", 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;
+
+ if(err != KErrNoMemory)
+ {
+ TEST2(err, KErrNone);
+ }
+ TheTest.Printf(_L("\r\n===CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo);
+ }
+
+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"));
+ CreateDatabaseOomTest();
+
+ TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4168 CSqlSrvDatabase::OpenL() OOM unit test - non-secure database"));
+ OpenDatabaseOomTest();
+
+ TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4169 CSqlSrvDatabase::CreateSecureL() OOM unit test"));
+ CreateSecureDatabaseOomTest();
+
+ TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4170 CSqlSrvDatabase::OpenL() OOM unit test - secure database"));
+ OpenSecureDatabaseOomTest();
+
+ TheTest.Next(_L(" @SYMTestCaseID:PDS-SQL-UT-4171 CSqlSrvDatabase::OpenL() & CSqlSrvDatabase::AttachDbL() OOM unit test"));
+ OpenAttachDatabaseOomTest();
+
+ 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;
+ }
--- a/persistentstorage/sql/TEST/t_sqlstartup.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sql/TEST/t_sqlstartup.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -347,6 +347,7 @@
TheTest.Title();
CTrapCleanup* tc = CTrapCleanup::New();
+ TheTest(tc != NULL);
__UHEAP_MARK;
--- a/persistentstorage/sqlite3api/OsLayer/FileBuf64.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sqlite3api/OsLayer/FileBuf64.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/persistentstorage/sqlite3api/OsLayer/FileBuf64.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sqlite3api/OsLayer/FileBuf64.h Mon Mar 15 12:46:30 2010 +0200
@@ -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).
--- a/persistentstorage/sqlite3api/OsLayer/os_symbian.h Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sqlite3api/OsLayer/os_symbian.h Mon Mar 15 12:46:30 2010 +0200
@@ -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
--- a/persistentstorage/sqlite3api/OsLayer/os_symbian_mt.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/persistentstorage/sqlite3api/OsLayer/os_symbian_mt.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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_<type> 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,
--- a/traceservices/commsdebugutility/INC/commsdebugutility.h Fri Mar 12 15:51:02 2010 +0200
+++ b/traceservices/commsdebugutility/INC/commsdebugutility.h Mon Mar 15 12:46:30 2010 +0200
@@ -16,8 +16,9 @@
//
/**
- @file
- @internalTechnology
+@file
+@publishedAll
+@deprecated Migrate to Open System Trace Instrumentation API instead
*/
#ifndef __COMMSDEBUGUTILITY_H__
@@ -67,7 +68,8 @@
/**
* Panic codes
*
- * @internalTechnology
+ * @publishedAll
+ * @deprecated Migrate to Open System Trace Instrumentation API instead
* @note The order of the panic numbers should not be changed.
* New panic codes must be added at the end of this enum.
* All panic codes are assigned to values to ease debugging.
@@ -81,7 +83,7 @@
/**
* Logging Mode codes
*
- * @internalTechnology
+ * @publishedAll
* @deprecated As of version 8.0 the logging modes are deprecated due to the introduction
* of a single log file. Appent mode is the default for all write operations,
* while Overwrite can be achieved using new __FLOG_CLEAR macro, or ClearLog API.
@@ -101,7 +103,9 @@
/**
* Flogger - File and Serial Logger client interface
*
- * @internalTechnology
+ * @publishedAll
+ * @deprecated Migrate to Open System Trace Instrumentation API instead
+ *
* This class is responsible for providing all functions
* clients require of the flogger system. It is preferred, though,
* that clients use the provided macros which refer to these API's
--- a/traceservices/commsdebugutility/TE_commsdebugutility/src/TE_comsdbgServer.cpp Fri Mar 12 15:51:02 2010 +0200
+++ b/traceservices/commsdebugutility/TE_commsdebugutility/src/TE_comsdbgServer.cpp Mon Mar 15 12:46:30 2010 +0200
@@ -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;
--- a/traceservices/commsdebugutility/group/BLD.INF Fri Mar 12 15:51:02 2010 +0200
+++ b/traceservices/commsdebugutility/group/BLD.INF Mon Mar 15 12:46:30 2010 +0200
@@ -21,7 +21,7 @@
../tools/splitlog.bat /epoc32/tools/splitlog.bat
../tools/extractlog.pl /epoc32/tools/extractlog.pl
-../INC/commsdebugutility.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(comms-infras/commsdebugutility.h)
+../INC/commsdebugutility.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(comms-infras/commsdebugutility.h)
../group/commsdebugutility.iby /epoc32/rom/include/commsdebugutility.iby
../group/commslog.iby /epoc32/rom/include/commslog.iby