os/ossrv/lowlevellibsandfws/pluginfw/Framework/FrameTests/MagicUnitTests.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// This file contains the definition of the 
sl@0
    15
// class CAllTransitionsUnitTest	
sl@0
    16
// Note	: All the REComSession references from this file
sl@0
    17
// These are simple fudges for early development tests
sl@0
    18
// before the true server migration of the code.
sl@0
    19
// 
sl@0
    20
//
sl@0
    21
sl@0
    22
#include <e32uid.h>
sl@0
    23
sl@0
    24
#include "TestUtilities.h"	// For __FILE__LINE__
sl@0
    25
#include "Interface.h"
sl@0
    26
#include <ecom/test_bed/datalogger.h>
sl@0
    27
sl@0
    28
#include "MagicUnitTests.h"
sl@0
    29
#include "MagicTransitions.h"
sl@0
    30
#include "MagicTransitionValidation.h"
sl@0
    31
sl@0
    32
#include "TlsData.h"		// For GlobalData
sl@0
    33
sl@0
    34
#define UNUSED_VAR(a) a = a
sl@0
    35
sl@0
    36
// ______________________________________________________________________________
sl@0
    37
//
sl@0
    38
_LIT(KInterfaceCreateAndDestroyUnitTest,"CExampleInterfaceCreateAndDestroyUnitTest");
sl@0
    39
sl@0
    40
CExampleInterfaceCreateAndDestroyUnitTest* CExampleInterfaceCreateAndDestroyUnitTest::NewL(CDataLogger& aDataLogger,
sl@0
    41
											MUnitTestObserver& aObserver)
sl@0
    42
	{
sl@0
    43
	CExampleInterfaceCreateAndDestroyUnitTest* self = 
sl@0
    44
					new(ELeave) CExampleInterfaceCreateAndDestroyUnitTest(aDataLogger,
sl@0
    45
																aObserver);
sl@0
    46
	CleanupStack::PushL(self);
sl@0
    47
	// Chain to the base which calls the ConstructL
sl@0
    48
	self->ConstructL();
sl@0
    49
	CleanupStack::Pop();
sl@0
    50
	return self; 
sl@0
    51
	}
sl@0
    52
sl@0
    53
TInt CExampleInterfaceCreateAndDestroyUnitTest::RunError(TInt aError)
sl@0
    54
	{
sl@0
    55
	// The RunL left so chain to the base first and then cleanup
sl@0
    56
	TInt error = CUnitTest::RunError(aError);	// Chain to base
sl@0
    57
	delete iUTContext;
sl@0
    58
	iUTContext = NULL;
sl@0
    59
	delete iStateAccessor;
sl@0
    60
	iStateAccessor = NULL;
sl@0
    61
	delete iCtorValidator;
sl@0
    62
	delete iDtorValidator;
sl@0
    63
	iCtorValidator = 0;
sl@0
    64
	iDtorValidator = 0;
sl@0
    65
sl@0
    66
	return error;
sl@0
    67
	}
sl@0
    68
sl@0
    69
CExampleInterfaceCreateAndDestroyUnitTest::~CExampleInterfaceCreateAndDestroyUnitTest()
sl@0
    70
	{
sl@0
    71
	// Simply delete our test class instance
sl@0
    72
	delete iUTContext;
sl@0
    73
	delete iStateAccessor;
sl@0
    74
	delete iCtorValidator;
sl@0
    75
	delete iDtorValidator;
sl@0
    76
sl@0
    77
	}
sl@0
    78
sl@0
    79
CExampleInterfaceCreateAndDestroyUnitTest::CExampleInterfaceCreateAndDestroyUnitTest(CDataLogger& aDataLogger,
sl@0
    80
																	MUnitTestObserver& aObserver)
sl@0
    81
: CUnitTest(KInterfaceCreateAndDestroyUnitTest, aDataLogger, aObserver)
sl@0
    82
	{
sl@0
    83
	//Do nothing
sl@0
    84
	}
sl@0
    85
sl@0
    86
// Now the Individual transitions need to be added.
sl@0
    87
void CExampleInterfaceCreateAndDestroyUnitTest::ConstructL()
sl@0
    88
	{
sl@0
    89
	// Perform the base class initialization
sl@0
    90
	UnitTestConstructL();
sl@0
    91
sl@0
    92
	// Create the Unit test state accessor
sl@0
    93
	iStateAccessor = new(ELeave) TExampleInterface_StateAccessor();
sl@0
    94
	
sl@0
    95
	// context
sl@0
    96
	iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this);
sl@0
    97
sl@0
    98
	// Add the Transitions in the order they are to run
sl@0
    99
	// C'tor first, D'tor last...
sl@0
   100
	iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext);
sl@0
   101
	AddTransitionL(new(ELeave)CExampleInterfaceNewLTransition(*iUTContext,*iCtorValidator));
sl@0
   102
	
sl@0
   103
	iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext);
sl@0
   104
	AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext,*iDtorValidator));
sl@0
   105
	}
sl@0
   106
// ______________________________________________________________________________
sl@0
   107
//
sl@0
   108
_LIT(KExampleInterfaceAltCreateAndDestroyUnitTest,"CExampleInterfaceAltCreateAndDestroyUnitTest");
sl@0
   109
sl@0
   110
CExampleInterfaceAltCreateAndDestroyUnitTest* CExampleInterfaceAltCreateAndDestroyUnitTest::NewL(CDataLogger& aDataLogger,
sl@0
   111
											MUnitTestObserver& aObserver)
sl@0
   112
	{
sl@0
   113
	CExampleInterfaceAltCreateAndDestroyUnitTest* self = 
sl@0
   114
					new(ELeave) CExampleInterfaceAltCreateAndDestroyUnitTest(aDataLogger,
sl@0
   115
																aObserver);
sl@0
   116
	CleanupStack::PushL(self);
sl@0
   117
	// Chain to the base which calls the ConstructL
sl@0
   118
	self->ConstructL();
sl@0
   119
	CleanupStack::Pop(self);
sl@0
   120
	return self; 
sl@0
   121
	}
sl@0
   122
sl@0
   123
TInt CExampleInterfaceAltCreateAndDestroyUnitTest::RunError(TInt aError)
sl@0
   124
	{
sl@0
   125
	// The RunL left so chain to the base first and then cleanup
sl@0
   126
	TInt error = CUnitTest::RunError(aError);	// Chain to base
sl@0
   127
	delete iUTContext;
sl@0
   128
	iUTContext = NULL;
sl@0
   129
	delete iStateAccessor;
sl@0
   130
	iStateAccessor = NULL;
sl@0
   131
	delete iCtorValidator;
sl@0
   132
	iCtorValidator = NULL;
sl@0
   133
	delete iDtorValidator;
sl@0
   134
	iDtorValidator = NULL;
sl@0
   135
sl@0
   136
	return error;
sl@0
   137
	}
sl@0
   138
sl@0
   139
CExampleInterfaceAltCreateAndDestroyUnitTest::~CExampleInterfaceAltCreateAndDestroyUnitTest()
sl@0
   140
	{
sl@0
   141
	// Simply delete our test class instance
sl@0
   142
	delete iUTContext;
sl@0
   143
	delete iStateAccessor;
sl@0
   144
	delete iCtorValidator;
sl@0
   145
	delete iDtorValidator;
sl@0
   146
sl@0
   147
	}
sl@0
   148
sl@0
   149
CExampleInterfaceAltCreateAndDestroyUnitTest::CExampleInterfaceAltCreateAndDestroyUnitTest(CDataLogger& aDataLogger,
sl@0
   150
																	MUnitTestObserver& aObserver)
sl@0
   151
: CUnitTest(KExampleInterfaceAltCreateAndDestroyUnitTest, aDataLogger, aObserver)
sl@0
   152
	{
sl@0
   153
	//Do nothing
sl@0
   154
	}
sl@0
   155
sl@0
   156
// Now the Individual transitions need to be added.
sl@0
   157
void CExampleInterfaceAltCreateAndDestroyUnitTest::ConstructL()
sl@0
   158
	{
sl@0
   159
	// Perform the base class initialization
sl@0
   160
	UnitTestConstructL();
sl@0
   161
sl@0
   162
	// Create the Unit test state accessor
sl@0
   163
	iStateAccessor = new(ELeave) TExampleInterface_StateAccessor();
sl@0
   164
	// context
sl@0
   165
	iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this);
sl@0
   166
sl@0
   167
	// Create the required validators
sl@0
   168
	iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext);
sl@0
   169
	iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext);
sl@0
   170
sl@0
   171
	// Add the transitions in the order they are to run
sl@0
   172
	AddTransitionL(new(ELeave)CExampleInterfaceNewWPLTransition(*iUTContext, *iCtorValidator));
sl@0
   173
	AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext, *iDtorValidator));
sl@0
   174
sl@0
   175
	AddTransitionL(new(ELeave)CExampleInterfaceNewResolveLTransition(*iUTContext, *iCtorValidator));
sl@0
   176
	AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext, *iDtorValidator));
sl@0
   177
sl@0
   178
	}
sl@0
   179
sl@0
   180
// ______________________________________________________________________________
sl@0
   181
//
sl@0
   182
_LIT(KExampleInterfaceListAllImplementationsUnitTest,"CExampleInterface_ListImplementations_UnitTest");
sl@0
   183
sl@0
   184
CExampleInterface_ListImplementations_UnitTest* CExampleInterface_ListImplementations_UnitTest::NewL(CDataLogger& aDataLogger,
sl@0
   185
											MUnitTestObserver& aObserver)
sl@0
   186
	{
sl@0
   187
	CExampleInterface_ListImplementations_UnitTest* self = 
sl@0
   188
					new(ELeave) CExampleInterface_ListImplementations_UnitTest(aDataLogger,
sl@0
   189
																aObserver);
sl@0
   190
	CleanupStack::PushL(self);
sl@0
   191
	self->ConstructL();
sl@0
   192
	CleanupStack::Pop();
sl@0
   193
	return self; 
sl@0
   194
	}
sl@0
   195
sl@0
   196
inline TInt CExampleInterface_ListImplementations_UnitTest::RunError(TInt aError)
sl@0
   197
	{
sl@0
   198
	// The RunL left so chain to the base first and then cleanup
sl@0
   199
	TInt error = CUnitTest::RunError(aError);	// Chain to base
sl@0
   200
	delete iUTContext;
sl@0
   201
	iUTContext = NULL;
sl@0
   202
	delete iStateAccessor;
sl@0
   203
	// delete any validators used
sl@0
   204
	delete iCtorValidator;
sl@0
   205
	iCtorValidator = NULL;
sl@0
   206
	delete iListImplementationsValidator;
sl@0
   207
	iListImplementationsValidator = NULL;
sl@0
   208
	delete iDtorValidator;
sl@0
   209
	iDtorValidator = NULL;
sl@0
   210
sl@0
   211
	return error;
sl@0
   212
	}
sl@0
   213
sl@0
   214
inline CExampleInterface_ListImplementations_UnitTest::~CExampleInterface_ListImplementations_UnitTest()
sl@0
   215
	{
sl@0
   216
	delete iUTContext;
sl@0
   217
	delete iStateAccessor;
sl@0
   218
	// delete any validators used
sl@0
   219
	delete iCtorValidator;
sl@0
   220
	delete iListImplementationsValidator;
sl@0
   221
	delete iDtorValidator;
sl@0
   222
	}
sl@0
   223
sl@0
   224
inline CExampleInterface_ListImplementations_UnitTest::CExampleInterface_ListImplementations_UnitTest(CDataLogger& aDataLogger,
sl@0
   225
																	MUnitTestObserver& aObserver)
sl@0
   226
: CUnitTest(KExampleInterfaceListAllImplementationsUnitTest, aDataLogger, aObserver)
sl@0
   227
	{
sl@0
   228
	//Do nothing
sl@0
   229
	}
sl@0
   230
sl@0
   231
// Now the Individual transitions need to be added.
sl@0
   232
inline void CExampleInterface_ListImplementations_UnitTest::ConstructL()
sl@0
   233
	{
sl@0
   234
	// Perform the base class initialization
sl@0
   235
	UnitTestConstructL();
sl@0
   236
sl@0
   237
	// Create the Unit test state accessor
sl@0
   238
	iStateAccessor = new(ELeave) TExampleInterface_StateAccessor;
sl@0
   239
	// Construct the Unit test context.
sl@0
   240
	iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this);
sl@0
   241
	// Add the Transitions in the order they are to run
sl@0
   242
	// C'tor first, D'tor last...
sl@0
   243
	//	Examples of C'tor and D'tor transitions on CExampleInterface class.
sl@0
   244
	//	using ctor and dtor validators
sl@0
   245
	iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext);
sl@0
   246
	AddTransitionL(new(ELeave)CExampleInterfaceNewLTransition(*iUTContext,*iCtorValidator));
sl@0
   247
	
sl@0
   248
	iListImplementationsValidator = new(ELeave) TExampleInterface_ListImplementations_TransitionValidator(*iUTContext);
sl@0
   249
	AddTransitionL(new(ELeave)CExampleInterfaceListAllImplementationsLTransition(*iUTContext,*iListImplementationsValidator));
sl@0
   250
	AddTransitionL(new(ELeave)CExampleInterfaceListImplementationsLTransition(*iUTContext,*iListImplementationsValidator));
sl@0
   251
	
sl@0
   252
	iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext);
sl@0
   253
	AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext,*iDtorValidator));
sl@0
   254
	}
sl@0
   255
sl@0
   256
// ______________________________________________________________________________
sl@0
   257
//
sl@0
   258
_LIT(KExampleInterfaceDefectHAN4WZHSYUnitTest,"CExampleInterface_DefectHAN4WZHSY_UnitTest");
sl@0
   259
sl@0
   260
CExampleInterface_DefectHAN4WZHSY_UnitTest* CExampleInterface_DefectHAN4WZHSY_UnitTest::NewL(CDataLogger& aDataLogger,
sl@0
   261
											MUnitTestObserver& aObserver)
sl@0
   262
	{
sl@0
   263
	CExampleInterface_DefectHAN4WZHSY_UnitTest* self = 
sl@0
   264
					new(ELeave) CExampleInterface_DefectHAN4WZHSY_UnitTest(aDataLogger,
sl@0
   265
																aObserver);
sl@0
   266
	CleanupStack::PushL(self);
sl@0
   267
	self->ConstructL();
sl@0
   268
	CleanupStack::Pop();
sl@0
   269
	return self; 
sl@0
   270
	}
sl@0
   271
sl@0
   272
inline TInt CExampleInterface_DefectHAN4WZHSY_UnitTest::RunError(TInt aError)
sl@0
   273
	{
sl@0
   274
	// The RunL left so chain to the base first and then cleanup
sl@0
   275
	TInt error = CUnitTest::RunError(aError);	// Chain to base
sl@0
   276
	delete iUTContext;
sl@0
   277
	delete iStateAccessor;
sl@0
   278
	
sl@0
   279
	iUTContext = 0;
sl@0
   280
	iStateAccessor = 0;
sl@0
   281
sl@0
   282
	delete iCtorValidator;
sl@0
   283
	delete iDtorValidator;
sl@0
   284
sl@0
   285
	iCtorValidator = 0;
sl@0
   286
	iDtorValidator = 0;
sl@0
   287
	
sl@0
   288
	return error;
sl@0
   289
	}
sl@0
   290
sl@0
   291
inline CExampleInterface_DefectHAN4WZHSY_UnitTest::~CExampleInterface_DefectHAN4WZHSY_UnitTest()
sl@0
   292
	{
sl@0
   293
	// Simply delete our test class instance
sl@0
   294
	delete iUTContext;
sl@0
   295
	delete iStateAccessor;
sl@0
   296
sl@0
   297
	delete iCtorValidator;
sl@0
   298
	delete iDtorValidator;
sl@0
   299
	}
sl@0
   300
sl@0
   301
inline CExampleInterface_DefectHAN4WZHSY_UnitTest::CExampleInterface_DefectHAN4WZHSY_UnitTest(CDataLogger& aDataLogger,
sl@0
   302
																	MUnitTestObserver& aObserver)
sl@0
   303
: CUnitTest(KExampleInterfaceDefectHAN4WZHSYUnitTest, aDataLogger, aObserver)
sl@0
   304
	{
sl@0
   305
	//Do nothing
sl@0
   306
	}
sl@0
   307
sl@0
   308
// Now the Individual transitions need to be added.
sl@0
   309
inline void CExampleInterface_DefectHAN4WZHSY_UnitTest::ConstructL()
sl@0
   310
	{
sl@0
   311
	// Perform the base class initialization
sl@0
   312
	UnitTestConstructL();
sl@0
   313
sl@0
   314
	// Create the Unit test state accessor
sl@0
   315
	iStateAccessor = new(ELeave) TExampleInterface_StateAccessor;
sl@0
   316
	// Construct the Unit test context.
sl@0
   317
	iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this);
sl@0
   318
sl@0
   319
	iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext);
sl@0
   320
	iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext);
sl@0
   321
sl@0
   322
	AddTransitionL(new(ELeave)CExampleInterfaceNewLTransition(*iUTContext,*iCtorValidator));
sl@0
   323
	AddTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext,*iDtorValidator));
sl@0
   324
	}
sl@0
   325
sl@0
   326
// ______________________________________________________________________________
sl@0
   327
//
sl@0
   328
_LIT(KExampleInterfaceDefectCUO4YCEUEUnitTest,"CExampleInterface_DefectCUO4YCEUE_UnitTest");
sl@0
   329
sl@0
   330
CExampleInterface_DefectCUO4YCEUE_UnitTest* CExampleInterface_DefectCUO4YCEUE_UnitTest::NewL(CDataLogger& aDataLogger,
sl@0
   331
											MUnitTestObserver& aObserver)
sl@0
   332
	{
sl@0
   333
	CExampleInterface_DefectCUO4YCEUE_UnitTest* self = 
sl@0
   334
					new(ELeave) CExampleInterface_DefectCUO4YCEUE_UnitTest(aDataLogger,
sl@0
   335
																aObserver);
sl@0
   336
	CleanupStack::PushL(self);
sl@0
   337
	self->ConstructL();
sl@0
   338
	CleanupStack::Pop(self);
sl@0
   339
	return self; 
sl@0
   340
	}
sl@0
   341
sl@0
   342
inline TInt CExampleInterface_DefectCUO4YCEUE_UnitTest::RunError(TInt aError)
sl@0
   343
	{
sl@0
   344
	// The RunL left so chain to the base first and then cleanup
sl@0
   345
	TInt error = CUnitTest::RunError(aError);	// Chain to base
sl@0
   346
    delete iUTContext;
sl@0
   347
    delete iStateAccessor;
sl@0
   348
sl@0
   349
    delete iCtorValidator;
sl@0
   350
    delete iDtorValidator;
sl@0
   351
sl@0
   352
    iUTContext = 0;
sl@0
   353
    iStateAccessor = 0;
sl@0
   354
sl@0
   355
    iCtorValidator = 0;
sl@0
   356
    iDtorValidator = 0;
sl@0
   357
sl@0
   358
	return error;
sl@0
   359
	}
sl@0
   360
sl@0
   361
inline CExampleInterface_DefectCUO4YCEUE_UnitTest::~CExampleInterface_DefectCUO4YCEUE_UnitTest()
sl@0
   362
	{
sl@0
   363
	// Simply delete our test class instance
sl@0
   364
	delete iUTContext;
sl@0
   365
	delete iStateAccessor;
sl@0
   366
sl@0
   367
	delete iCtorValidator;
sl@0
   368
	delete iDtorValidator;
sl@0
   369
	}
sl@0
   370
sl@0
   371
inline CExampleInterface_DefectCUO4YCEUE_UnitTest::CExampleInterface_DefectCUO4YCEUE_UnitTest(CDataLogger& aDataLogger,
sl@0
   372
																	MUnitTestObserver& aObserver)
sl@0
   373
: CUnitTest(KExampleInterfaceDefectCUO4YCEUEUnitTest, aDataLogger, aObserver)
sl@0
   374
	{
sl@0
   375
	//Do nothing
sl@0
   376
	}
sl@0
   377
sl@0
   378
// Now the Individual transitions need to be added.
sl@0
   379
inline void CExampleInterface_DefectCUO4YCEUE_UnitTest::ConstructL()
sl@0
   380
	{
sl@0
   381
	// Perform the base class initialization
sl@0
   382
	UnitTestConstructL();
sl@0
   383
sl@0
   384
	// Create the Unit test state accessor
sl@0
   385
	iStateAccessor = new(ELeave) TExampleInterface_StateAccessor;
sl@0
   386
	// Construct the Unit test context.
sl@0
   387
	iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this);
sl@0
   388
sl@0
   389
	iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext);
sl@0
   390
	iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext);
sl@0
   391
sl@0
   392
	AddTransitionL(new(ELeave)CExampleInterfaceDoubleNewLTransition(*iUTContext,*iCtorValidator));
sl@0
   393
	AddTransitionL(new(ELeave)CExampleInterfaceDoubleDtorTransition(*iUTContext,*iDtorValidator));
sl@0
   394
	}
sl@0
   395
sl@0
   396
// ______________________________________________________________________________
sl@0
   397
//
sl@0
   398
_LIT(KExampleInterfaceDefectEVS4Z9BPGUnitTest,"CExampleInterface_DefectEVS4Z9BPG_UnitTest");
sl@0
   399
sl@0
   400
CExampleInterface_DefectEVS4Z9BPG_UnitTest* CExampleInterface_DefectEVS4Z9BPG_UnitTest::NewL(CDataLogger& aDataLogger,
sl@0
   401
											MUnitTestObserver& aObserver)
sl@0
   402
	{
sl@0
   403
	CExampleInterface_DefectEVS4Z9BPG_UnitTest* self = 
sl@0
   404
					new(ELeave) CExampleInterface_DefectEVS4Z9BPG_UnitTest(aDataLogger,
sl@0
   405
																aObserver);
sl@0
   406
	CleanupStack::PushL(self);
sl@0
   407
	self->ConstructL();
sl@0
   408
	CleanupStack::Pop(self);
sl@0
   409
	return self; 
sl@0
   410
	}
sl@0
   411
sl@0
   412
inline TInt CExampleInterface_DefectEVS4Z9BPG_UnitTest::RunError(TInt aError)
sl@0
   413
	{
sl@0
   414
	// The RunL left so chain to the base first and then cleanup
sl@0
   415
	TInt error = CUnitTest::RunError(aError);	// Chain to base
sl@0
   416
    delete iUTContext;
sl@0
   417
    delete iStateAccessor;
sl@0
   418
sl@0
   419
    delete iCtorValidator;
sl@0
   420
    delete iDefaultValidator;
sl@0
   421
    delete iDtorValidator;
sl@0
   422
sl@0
   423
    iUTContext = 0;
sl@0
   424
    iStateAccessor = 0;
sl@0
   425
sl@0
   426
    iCtorValidator = 0;
sl@0
   427
    iDefaultValidator = 0;
sl@0
   428
    iDtorValidator = 0;
sl@0
   429
sl@0
   430
	return error;
sl@0
   431
	}
sl@0
   432
sl@0
   433
inline CExampleInterface_DefectEVS4Z9BPG_UnitTest::~CExampleInterface_DefectEVS4Z9BPG_UnitTest()
sl@0
   434
	{
sl@0
   435
	// Simply delete our test class instance
sl@0
   436
	delete iUTContext;
sl@0
   437
	delete iStateAccessor;
sl@0
   438
sl@0
   439
	delete iCtorValidator;
sl@0
   440
	delete iDefaultValidator;
sl@0
   441
	delete iDtorValidator;
sl@0
   442
	}
sl@0
   443
sl@0
   444
inline CExampleInterface_DefectEVS4Z9BPG_UnitTest::CExampleInterface_DefectEVS4Z9BPG_UnitTest(CDataLogger& aDataLogger,
sl@0
   445
																	MUnitTestObserver& aObserver)
sl@0
   446
: CUnitTest(KExampleInterfaceDefectEVS4Z9BPGUnitTest, aDataLogger, aObserver)
sl@0
   447
	{
sl@0
   448
	//Do nothing
sl@0
   449
	}
sl@0
   450
sl@0
   451
// Now the Individual transitions need to be added.
sl@0
   452
inline void CExampleInterface_DefectEVS4Z9BPG_UnitTest::ConstructL()
sl@0
   453
	{
sl@0
   454
	// Perform the base class initialization
sl@0
   455
	UnitTestConstructL();
sl@0
   456
sl@0
   457
	// Create the Unit test state accessor
sl@0
   458
	iStateAccessor = new(ELeave) TExampleInterface_StateAccessor;
sl@0
   459
	// Construct the Unit test context.
sl@0
   460
	iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this);
sl@0
   461
sl@0
   462
	iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext);
sl@0
   463
	iDefaultValidator = new(ELeave) TExampleInterface_Default_TransitionValidator(*iUTContext);
sl@0
   464
	iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext);
sl@0
   465
sl@0
   466
	AddTransitionL(new(ELeave)CExampleInterfaceDoubleNewLTransition(*iUTContext,*iCtorValidator));
sl@0
   467
	AddTransitionL(new(ELeave)CExampleInterfaceDoMethodLTransition(*iUTContext,*iDefaultValidator));
sl@0
   468
	AddTransitionL(new(ELeave)CExampleInterfaceDoubleDtorTransition(*iUTContext,*iDtorValidator));
sl@0
   469
	}
sl@0
   470
sl@0
   471
// ______________________________________________________________________________
sl@0
   472
//
sl@0
   473
_LIT(KExampleInterfaceDefectKRN53SL4QUnitTest,"CExampleInterface_DefectKRN53SL4Q_UnitTest");
sl@0
   474
sl@0
   475
CExampleInterface_DefectKRN53SL4Q_UnitTest* CExampleInterface_DefectKRN53SL4Q_UnitTest::NewL(CDataLogger& aDataLogger,
sl@0
   476
											MUnitTestObserver& aObserver)
sl@0
   477
	{
sl@0
   478
	CExampleInterface_DefectKRN53SL4Q_UnitTest* self = 
sl@0
   479
					new(ELeave) CExampleInterface_DefectKRN53SL4Q_UnitTest(aDataLogger,
sl@0
   480
																aObserver);
sl@0
   481
	CleanupStack::PushL(self);
sl@0
   482
	self->ConstructL();
sl@0
   483
	CleanupStack::Pop(self);
sl@0
   484
	return self; 
sl@0
   485
	}
sl@0
   486
sl@0
   487
inline TInt CExampleInterface_DefectKRN53SL4Q_UnitTest::RunError(TInt aError)
sl@0
   488
	{
sl@0
   489
	// The RunL left so chain to the base first and then cleanup
sl@0
   490
	TInt error = CUnitTest::RunError(aError);	// Chain to base
sl@0
   491
    delete iUTContext;
sl@0
   492
    delete iStateAccessor;
sl@0
   493
sl@0
   494
    delete iCtorValidator;
sl@0
   495
    delete iDefaultValidator;
sl@0
   496
    delete iDtorValidator;
sl@0
   497
sl@0
   498
    iUTContext = 0;
sl@0
   499
    iStateAccessor = 0;
sl@0
   500
sl@0
   501
    iCtorValidator = 0;
sl@0
   502
    iDefaultValidator = 0;
sl@0
   503
    iDtorValidator = 0;
sl@0
   504
sl@0
   505
	return error;
sl@0
   506
	}
sl@0
   507
sl@0
   508
inline CExampleInterface_DefectKRN53SL4Q_UnitTest::~CExampleInterface_DefectKRN53SL4Q_UnitTest()
sl@0
   509
	{
sl@0
   510
	// Simply delete our test class instance
sl@0
   511
	delete iUTContext;
sl@0
   512
	delete iStateAccessor;
sl@0
   513
sl@0
   514
	delete iCtorValidator;
sl@0
   515
	delete iDefaultValidator;
sl@0
   516
	delete iDtorValidator;
sl@0
   517
	}
sl@0
   518
sl@0
   519
inline CExampleInterface_DefectKRN53SL4Q_UnitTest::CExampleInterface_DefectKRN53SL4Q_UnitTest(CDataLogger& aDataLogger,
sl@0
   520
																	MUnitTestObserver& aObserver)
sl@0
   521
: CUnitTest(KExampleInterfaceDefectKRN53SL4QUnitTest, aDataLogger, aObserver)
sl@0
   522
	{
sl@0
   523
	//Do nothing
sl@0
   524
	}
sl@0
   525
sl@0
   526
TInt ThreadFunc(TAny* aTrapHandler)
sl@0
   527
	{
sl@0
   528
	User::SetTrapHandler(REINTERPRET_CAST(TCleanupTrapHandler*, aTrapHandler));
sl@0
   529
sl@0
   530
	RImplInfoPtrArray implementations;
sl@0
   531
	TRAPD(error, CExampleInterface::ListImplementationsL(implementations));
sl@0
   532
    UNUSED_VAR(error);
sl@0
   533
	return KErrNone;
sl@0
   534
	}
sl@0
   535
sl@0
   536
// Now the Individual transitions need to be added.
sl@0
   537
inline void CExampleInterface_DefectKRN53SL4Q_UnitTest::ConstructL()
sl@0
   538
	{
sl@0
   539
	// Perform the base class initialization
sl@0
   540
	UnitTestConstructL();
sl@0
   541
sl@0
   542
	// Create the Unit test state accessor
sl@0
   543
	iStateAccessor = new(ELeave) TExampleInterface_StateAccessor;
sl@0
   544
	// Construct the Unit test context.
sl@0
   545
	iUTContext = new(ELeave) CExampleInterface_UnitTestContext(iDataLogger, *iStateAccessor, *this);
sl@0
   546
sl@0
   547
	_LIT(KNewThreadName, "ListImpl");
sl@0
   548
	User::Leave (KErrNone != iUTContext->iListImplThread.Create(KNewThreadName(),	// The name of the thread
sl@0
   549
									   ThreadFunc, //CExampleInterface_UnitTestContext::ListImplementationsThreadFunction,	// The function to be called when this thread resumes
sl@0
   550
									   2048,				// The stacksize for this thread
sl@0
   551
									   2048,				// min heap size
sl@0
   552
									   2048,				// max heap size
sl@0
   553
									   User::TrapHandler()));	// Parameter to be passed to function
sl@0
   554
sl@0
   555
		
sl@0
   556
	iCtorValidator = new(ELeave) TExampleInterface_Ctor_TransitionValidator(*iUTContext);
sl@0
   557
	iDefaultValidator = new(ELeave) TExampleInterface_Default_TransitionValidator(*iUTContext);
sl@0
   558
	iDtorValidator = new(ELeave) TExampleInterface_Dtor_TransitionValidator(*iUTContext);
sl@0
   559
sl@0
   560
	AddTransitionL(new(ELeave)CExampleInterfaceNewLTransition(*iUTContext,*iCtorValidator));
sl@0
   561
	AddTransitionL(new(ELeave)CExampleInterfaceListImplementationsLNewThreadTransition(*iUTContext,*iDefaultValidator));
sl@0
   562
	AddBlockingTransitionL(new(ELeave)CExampleInterfaceDtorTransition(*iUTContext,*iDtorValidator));
sl@0
   563
	}
sl@0
   564