1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/tsrc/t_strings/StringPoolUnitTest.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,757 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// The unit test class implementations for the RStringPool class.
1.18 +//
1.19 +//
1.20 +
1.21 +#ifdef __WINS__
1.22 +#pragma warning(disable : 4097) // disable typedef warning
1.23 +#endif
1.24 +
1.25 +#include "StringPoolUnitTest.h"
1.26 +
1.27 +
1.28 +
1.29 +// ______________________________________________________________________________
1.30 +//
1.31 +_LIT(KStringPoolCaseInsensitiveUnitTest,"CStringPool_CaseInsensitive_UnitTest");
1.32 +
1.33 +CStringPool_CaseInsensitive_UnitTest* CStringPool_CaseInsensitive_UnitTest::NewL(CDataLogger& aDataLogger,
1.34 + MUnitTestObserver& aObserver)
1.35 + {
1.36 + CStringPool_CaseInsensitive_UnitTest* self =
1.37 + new(ELeave) CStringPool_CaseInsensitive_UnitTest(aDataLogger,
1.38 + aObserver);
1.39 + CleanupStack::PushL(self);
1.40 + self->ConstructL();
1.41 + CleanupStack::Pop();
1.42 + return self;
1.43 + }
1.44 +
1.45 +inline TInt CStringPool_CaseInsensitive_UnitTest::RunError(TInt aError)
1.46 + {
1.47 + // The RunL left so chain to the base first and then cleanup
1.48 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.49 + delete iUTContext;
1.50 + delete iStateAccessor;
1.51 + delete iTrueValidator;
1.52 + delete iFalseValidator;
1.53 + return error;
1.54 + }
1.55 +
1.56 +inline CStringPool_CaseInsensitive_UnitTest::~CStringPool_CaseInsensitive_UnitTest()
1.57 + {
1.58 + // Simply delete our test class instance
1.59 + delete iUTContext;
1.60 + delete iStateAccessor;
1.61 + delete iTrueValidator;
1.62 + delete iFalseValidator;
1.63 + }
1.64 +
1.65 +inline CStringPool_CaseInsensitive_UnitTest::CStringPool_CaseInsensitive_UnitTest(CDataLogger& aDataLogger,
1.66 + MUnitTestObserver& aObserver)
1.67 +: CUnitTest(KStringPoolCaseInsensitiveUnitTest, aDataLogger, aObserver)
1.68 + {
1.69 + //Do nothing
1.70 + }
1.71 +
1.72 +// Now the Individual transitions need to be added.
1.73 +inline void CStringPool_CaseInsensitive_UnitTest::ConstructL()
1.74 + {
1.75 + // Perform the base class initialization
1.76 + UnitTestConstructL();
1.77 +
1.78 + // Create the Unit test state accessor
1.79 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.80 + // Construct the Unit test context.
1.81 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.82 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.83 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.84 + AddTransitionL(new(ELeave)CStringPool_NewL_Transition(*iUTContext,*iFalseValidator));
1.85 + AddTransitionL(new(ELeave)CStringPool_FAeqA_Transition(*iUTContext,*iTrueValidator));
1.86 + AddTransitionL(new(ELeave)CStringPool_FAneA_Transition(*iUTContext,*iFalseValidator));
1.87 + AddTransitionL(new(ELeave)CStringPool_FAneB_Transition(*iUTContext,*iTrueValidator));
1.88 + AddTransitionL(new(ELeave)CStringPool_FAeqB_Transition(*iUTContext,*iFalseValidator));
1.89 + AddTransitionL(new(ELeave)CStringPool_FAeqD_Transition(*iUTContext,*iTrueValidator));
1.90 + AddTransitionL(new(ELeave)CStringPool_FAneD_Transition(*iUTContext,*iFalseValidator));
1.91 + AddTransitionL(new(ELeave)CStringPool_FDesc_Transition(*iUTContext,*iFalseValidator));
1.92 + AddTransitionL(new(ELeave)CStringPool_FCopy_Transition(*iUTContext,*iTrueValidator));
1.93 + AddTransitionL(new(ELeave)CStringPool_FCDesC_Transition(*iUTContext,*iFalseValidator));
1.94 + AddTransitionL(new(ELeave)CStringPool_FClose_Transition(*iUTContext,*iFalseValidator));
1.95 + AddTransitionL(new(ELeave)CStringPool_FStringToken_Transition(*iUTContext,*iTrueValidator));
1.96 + AddTransitionL(new(ELeave)CStringPool_FCDesC_Transition(*iUTContext,*iFalseValidator));
1.97 + AddTransitionL(new(ELeave)CStringPool_Dtor_Transition(*iUTContext,*iFalseValidator));
1.98 + }
1.99 +
1.100 +
1.101 +// ______________________________________________________________________________
1.102 +//
1.103 +_LIT(KStringPoolSmallTableUnitTest,"CStringPool_ShortTable_UnitTest");
1.104 +
1.105 +CStringPool_ShortTable_UnitTest* CStringPool_ShortTable_UnitTest::NewL(CDataLogger& aDataLogger,
1.106 + MUnitTestObserver& aObserver)
1.107 + {
1.108 + CStringPool_ShortTable_UnitTest* self =
1.109 + new(ELeave) CStringPool_ShortTable_UnitTest(aDataLogger,
1.110 + aObserver);
1.111 + CleanupStack::PushL(self);
1.112 + self->ConstructL();
1.113 + CleanupStack::Pop();
1.114 + return self;
1.115 + }
1.116 +
1.117 +inline TInt CStringPool_ShortTable_UnitTest::RunError(TInt aError)
1.118 + {
1.119 + // The RunL left so chain to the base first and then cleanup
1.120 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.121 + delete iUTContext;
1.122 + delete iStateAccessor;
1.123 + delete iTrueValidator;
1.124 + delete iFalseValidator;
1.125 + return error;
1.126 + }
1.127 +
1.128 +inline CStringPool_ShortTable_UnitTest::~CStringPool_ShortTable_UnitTest()
1.129 + {
1.130 + // Simply delete our test class instance
1.131 + delete iUTContext;
1.132 + delete iStateAccessor;
1.133 + delete iTrueValidator;
1.134 + delete iFalseValidator;
1.135 + }
1.136 +
1.137 +inline CStringPool_ShortTable_UnitTest::CStringPool_ShortTable_UnitTest(CDataLogger& aDataLogger,
1.138 + MUnitTestObserver& aObserver)
1.139 +: CUnitTest(KStringPoolSmallTableUnitTest, aDataLogger, aObserver)
1.140 + {
1.141 + //Do nothing
1.142 + }
1.143 +
1.144 +// Now the Individual transitions need to be added.
1.145 +inline void CStringPool_ShortTable_UnitTest::ConstructL()
1.146 + {
1.147 + // Perform the base class initialization
1.148 + UnitTestConstructL();
1.149 +
1.150 + // Create the Unit test state accessor
1.151 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.152 + // Construct the Unit test context.
1.153 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.154 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.155 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.156 + AddTransitionL(new(ELeave)CStringPool_ShortCtor_Transition(*iUTContext,*iFalseValidator));
1.157 + // testing defect fixes : BEU-55DJG3, KRN-56NDEZ,APY-57TEH3, HAD-57SK27
1.158 + AddTransitionL(new(ELeave)CStringPool_BEU55DJG3_Transition(*iUTContext,*iTrueValidator));
1.159 + AddTransitionL(new(ELeave)CStringPool_KRN56NDEZ_Transition(*iUTContext,*iTrueValidator));
1.160 + AddTransitionL(new(ELeave)CStringPool_APY57TEH3_Transition(*iUTContext,*iTrueValidator));
1.161 + AddTransitionL(new(ELeave)CStringPool_HAD57SK27_Transition(*iUTContext,*iTrueValidator));
1.162 +
1.163 + // end defect fix tests
1.164 + AddTransitionL(new(ELeave)CStringPool_FAeqA_Transition(*iUTContext,*iTrueValidator));
1.165 + AddTransitionL(new(ELeave)CStringPool_FAneA_Transition(*iUTContext,*iFalseValidator));
1.166 + AddTransitionL(new(ELeave)CStringPool_FAneB_Transition(*iUTContext,*iTrueValidator));
1.167 + AddTransitionL(new(ELeave)CStringPool_FAeqB_Transition(*iUTContext,*iFalseValidator));
1.168 + AddTransitionL(new(ELeave)CStringPool_FAeqD_Transition(*iUTContext,*iTrueValidator));
1.169 + AddTransitionL(new(ELeave)CStringPool_FAneD_Transition(*iUTContext,*iFalseValidator));
1.170 + AddTransitionL(new(ELeave)CStringPool_FDesc_Transition(*iUTContext,*iFalseValidator));
1.171 + AddTransitionL(new(ELeave)CStringPool_FCopy_Transition(*iUTContext,*iTrueValidator));
1.172 + AddTransitionL(new(ELeave)CStringPool_FCDesC_Transition(*iUTContext,*iFalseValidator));
1.173 + AddTransitionL(new(ELeave)CStringPool_FClose_Transition(*iUTContext,*iFalseValidator));
1.174 + AddTransitionL(new(ELeave)CStringPool_FInt_Transition(*iUTContext,*iTrueValidator));
1.175 +
1.176 + AddTransitionL(new(ELeave)CStringPool_StringF_Index_Table_Transition(*iUTContext,*iTrueValidator));
1.177 + AddTransitionL(new(ELeave)CStringPool_FStringToken_Transition(*iUTContext,*iTrueValidator));
1.178 + AddTransitionL(new(ELeave)CStringPool_FCDesC_Transition(*iUTContext,*iFalseValidator));
1.179 + AddTransitionL(new(ELeave)CStringPool_Dtor_Transition(*iUTContext,*iFalseValidator));
1.180 + AddTransitionL(new(ELeave)CStringPool_Short_CB_Transition(*iUTContext,*iTrueValidator));
1.181 +
1.182 + }
1.183 +
1.184 +
1.185 +// ______________________________________________________________________________
1.186 +//
1.187 +_LIT(KStringPoolIrrelevantTableUnitTest,"CStringPool_IrrelevantTable_UnitTest");
1.188 +
1.189 +CStringPool_IrrelevantTable_UnitTest* CStringPool_IrrelevantTable_UnitTest::NewL(CDataLogger& aDataLogger,
1.190 + MUnitTestObserver& aObserver)
1.191 + {
1.192 + CStringPool_IrrelevantTable_UnitTest* self =
1.193 + new(ELeave) CStringPool_IrrelevantTable_UnitTest(aDataLogger,
1.194 + aObserver);
1.195 + CleanupStack::PushL(self);
1.196 + self->ConstructL();
1.197 + CleanupStack::Pop();
1.198 + return self;
1.199 + }
1.200 +
1.201 +inline TInt CStringPool_IrrelevantTable_UnitTest::RunError(TInt aError)
1.202 + {
1.203 + // The RunL left so chain to the base first and then cleanup
1.204 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.205 + delete iUTContext;
1.206 + delete iStateAccessor;
1.207 + delete iTrueValidator;
1.208 + delete iFalseValidator;
1.209 + return error;
1.210 + }
1.211 +
1.212 +inline CStringPool_IrrelevantTable_UnitTest::~CStringPool_IrrelevantTable_UnitTest()
1.213 + {
1.214 + // Simply delete our test class instance
1.215 + delete iUTContext;
1.216 + delete iStateAccessor;
1.217 + delete iTrueValidator;
1.218 + delete iFalseValidator;
1.219 + }
1.220 +
1.221 +inline CStringPool_IrrelevantTable_UnitTest::CStringPool_IrrelevantTable_UnitTest(CDataLogger& aDataLogger,
1.222 + MUnitTestObserver& aObserver)
1.223 +: CUnitTest(KStringPoolIrrelevantTableUnitTest, aDataLogger, aObserver)
1.224 + {
1.225 + //Do nothing
1.226 + }
1.227 +
1.228 +// Now the Individual transitions need to be added.
1.229 +inline void CStringPool_IrrelevantTable_UnitTest::ConstructL()
1.230 + {
1.231 + // Perform the base class initialization
1.232 + UnitTestConstructL();
1.233 +
1.234 + // Create the Unit test state accessor
1.235 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.236 + // Construct the Unit test context.
1.237 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.238 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.239 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.240 + AddTransitionL(new(ELeave)CStringPool_IrrelevantCtor_Transition(*iUTContext,*iFalseValidator));
1.241 + AddTransitionL(new(ELeave)CStringPool_FAeqA_Transition(*iUTContext,*iTrueValidator));
1.242 + AddTransitionL(new(ELeave)CStringPool_FAneA_Transition(*iUTContext,*iFalseValidator));
1.243 + AddTransitionL(new(ELeave)CStringPool_FAneB_Transition(*iUTContext,*iTrueValidator));
1.244 + AddTransitionL(new(ELeave)CStringPool_FAeqB_Transition(*iUTContext,*iFalseValidator));
1.245 + AddTransitionL(new(ELeave)CStringPool_FAeqD_Transition(*iUTContext,*iTrueValidator));
1.246 + AddTransitionL(new(ELeave)CStringPool_FAneD_Transition(*iUTContext,*iFalseValidator));
1.247 + AddTransitionL(new(ELeave)CStringPool_FDesc_Transition(*iUTContext,*iFalseValidator));
1.248 + AddTransitionL(new(ELeave)CStringPool_FCopy_Transition(*iUTContext,*iTrueValidator));
1.249 + AddTransitionL(new(ELeave)CStringPool_FCDesC_Transition(*iUTContext,*iFalseValidator));
1.250 + AddTransitionL(new(ELeave)CStringPool_FClose_Transition(*iUTContext,*iFalseValidator));
1.251 + AddTransitionL(new(ELeave)CStringPool_FInt_Transition(*iUTContext,*iTrueValidator));
1.252 + AddTransitionL(new(ELeave)CStringPool_FStringToken_Transition(*iUTContext,*iTrueValidator));
1.253 + AddTransitionL(new(ELeave)CStringPool_FCDesC_Transition(*iUTContext,*iFalseValidator));
1.254 + AddTransitionL(new(ELeave)CStringPool_Dtor_Transition(*iUTContext,*iFalseValidator));
1.255 + }
1.256 +
1.257 +
1.258 +// ______________________________________________________________________________
1.259 +//
1.260 +_LIT(KStringPoolLargeTableUnitTest,"CStringPool_LongTable_UnitTest");
1.261 +
1.262 +CStringPool_LongTable_UnitTest* CStringPool_LongTable_UnitTest::NewL(CDataLogger& aDataLogger,
1.263 + MUnitTestObserver& aObserver)
1.264 + {
1.265 + CStringPool_LongTable_UnitTest* self =
1.266 + new(ELeave) CStringPool_LongTable_UnitTest(aDataLogger,
1.267 + aObserver);
1.268 + CleanupStack::PushL(self);
1.269 + self->ConstructL();
1.270 + CleanupStack::Pop();
1.271 + return self;
1.272 + }
1.273 +
1.274 +inline TInt CStringPool_LongTable_UnitTest::RunError(TInt aError)
1.275 + {
1.276 + // The RunL left so chain to the base first and then cleanup
1.277 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.278 + delete iUTContext;
1.279 + delete iStateAccessor;
1.280 + delete iTrueValidator;
1.281 + delete iFalseValidator;
1.282 + return error;
1.283 + }
1.284 +
1.285 +inline CStringPool_LongTable_UnitTest::~CStringPool_LongTable_UnitTest()
1.286 + {
1.287 + // Simply delete our test class instance
1.288 + delete iUTContext;
1.289 + delete iStateAccessor;
1.290 + delete iTrueValidator;
1.291 + delete iFalseValidator;
1.292 + }
1.293 +
1.294 +inline CStringPool_LongTable_UnitTest::CStringPool_LongTable_UnitTest(CDataLogger& aDataLogger,
1.295 + MUnitTestObserver& aObserver)
1.296 +: CUnitTest(KStringPoolLargeTableUnitTest, aDataLogger, aObserver)
1.297 + {
1.298 + //Do nothing
1.299 + }
1.300 +
1.301 +// Now the Individual transitions need to be added.
1.302 +inline void CStringPool_LongTable_UnitTest::ConstructL()
1.303 + {
1.304 + // Perform the base class initialization
1.305 + UnitTestConstructL();
1.306 +
1.307 + // Create the Unit test state accessor
1.308 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.309 + // Construct the Unit test context.
1.310 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.311 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.312 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.313 + AddTransitionL(new(ELeave)CStringPool_LongCtor_Transition(*iUTContext,*iFalseValidator));
1.314 + AddTransitionL(new(ELeave)CStringPool_FAeqA_Transition(*iUTContext,*iTrueValidator));
1.315 + AddTransitionL(new(ELeave)CStringPool_FAneA_Transition(*iUTContext,*iFalseValidator));
1.316 + AddTransitionL(new(ELeave)CStringPool_FAneB_Transition(*iUTContext,*iTrueValidator));
1.317 + AddTransitionL(new(ELeave)CStringPool_FAeqB_Transition(*iUTContext,*iFalseValidator));
1.318 + AddTransitionL(new(ELeave)CStringPool_FAeqD_Transition(*iUTContext,*iTrueValidator));
1.319 + AddTransitionL(new(ELeave)CStringPool_FAneD_Transition(*iUTContext,*iFalseValidator));
1.320 + AddTransitionL(new(ELeave)CStringPool_FDesc_Transition(*iUTContext,*iFalseValidator));
1.321 + AddTransitionL(new(ELeave)CStringPool_FCopy_Transition(*iUTContext,*iTrueValidator));
1.322 + AddTransitionL(new(ELeave)CStringPool_FCDesC_Transition(*iUTContext,*iFalseValidator));
1.323 + AddTransitionL(new(ELeave)CStringPool_FClose_Transition(*iUTContext,*iFalseValidator));
1.324 + AddTransitionL(new(ELeave)CStringPool_FInt_Transition(*iUTContext,*iTrueValidator));
1.325 +
1.326 + AddTransitionL(new(ELeave)CStringPool_StringF_Index_Table_Transition(*iUTContext,*iTrueValidator));
1.327 + AddTransitionL(new(ELeave)CStringPool_FStringToken_Transition(*iUTContext,*iTrueValidator));
1.328 + AddTransitionL(new(ELeave)CStringPool_FCDesC_Transition(*iUTContext,*iFalseValidator));
1.329 + AddTransitionL(new(ELeave)CStringPool_Dtor_Transition(*iUTContext,*iFalseValidator));
1.330 + }
1.331 +
1.332 +// ______________________________________________________________________________
1.333 +//
1.334 +_LIT(KStringPoolCaseSensitiveUnitTest,"CStringPool_CaseSensitive_UnitTest");
1.335 +
1.336 +CStringPool_CaseSensitive_UnitTest* CStringPool_CaseSensitive_UnitTest::NewL(CDataLogger& aDataLogger,
1.337 + MUnitTestObserver& aObserver)
1.338 + {
1.339 + CStringPool_CaseSensitive_UnitTest* self =
1.340 + new(ELeave) CStringPool_CaseSensitive_UnitTest(aDataLogger,
1.341 + aObserver);
1.342 + CleanupStack::PushL(self);
1.343 + self->ConstructL();
1.344 + CleanupStack::Pop(self);
1.345 + return self;
1.346 + }
1.347 +
1.348 +inline TInt CStringPool_CaseSensitive_UnitTest::RunError(TInt aError)
1.349 + {
1.350 + // The RunL left so chain to the base first and then cleanup
1.351 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.352 + delete iUTContext;
1.353 + delete iStateAccessor;
1.354 + delete iTrueValidator;
1.355 + delete iFalseValidator;
1.356 + return error;
1.357 + }
1.358 +
1.359 +inline CStringPool_CaseSensitive_UnitTest::~CStringPool_CaseSensitive_UnitTest()
1.360 + {
1.361 + // Simply delete our test class instance
1.362 + delete iUTContext;
1.363 + delete iStateAccessor;
1.364 + delete iTrueValidator;
1.365 + delete iFalseValidator;
1.366 + }
1.367 +
1.368 +inline CStringPool_CaseSensitive_UnitTest::CStringPool_CaseSensitive_UnitTest(CDataLogger& aDataLogger,
1.369 + MUnitTestObserver& aObserver)
1.370 +: CUnitTest(KStringPoolCaseSensitiveUnitTest, aDataLogger, aObserver)
1.371 + {
1.372 + //Do nothing
1.373 + }
1.374 +
1.375 +// Now the Individual transitions need to be added.
1.376 +inline void CStringPool_CaseSensitive_UnitTest::ConstructL()
1.377 + {
1.378 + // Perform the base class initialization
1.379 + UnitTestConstructL();
1.380 +
1.381 + // Create the Unit test state accessor
1.382 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.383 + // Construct the Unit test context.
1.384 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.385 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.386 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.387 +
1.388 + AddTransitionL(new(ELeave)CStringPool_ShortCSCtor_Transition(*iUTContext,*iFalseValidator));
1.389 + AddTransitionL(new(ELeave)CStringPool_AeqA_Transition(*iUTContext,*iTrueValidator));
1.390 + AddTransitionL(new(ELeave)CStringPool_AneA_Transition(*iUTContext,*iFalseValidator));
1.391 + AddTransitionL(new(ELeave)CStringPool_AneB_Transition(*iUTContext,*iTrueValidator));
1.392 + AddTransitionL(new(ELeave)CStringPool_AeqB_Transition(*iUTContext,*iFalseValidator));
1.393 + AddTransitionL(new(ELeave)CStringPool_AeqD_Transition(*iUTContext,*iTrueValidator));
1.394 + AddTransitionL(new(ELeave)CStringPool_AneD_Transition(*iUTContext,*iFalseValidator));
1.395 + AddTransitionL(new(ELeave)CStringPool_Desc_Transition(*iUTContext,*iFalseValidator));
1.396 + AddTransitionL(new(ELeave)CStringPool_Copy_Transition(*iUTContext,*iTrueValidator));
1.397 + AddTransitionL(new(ELeave)CStringPool_CDesC_Transition(*iUTContext,*iFalseValidator));
1.398 + AddTransitionL(new(ELeave)CStringPool_Close_Transition(*iUTContext,*iFalseValidator));
1.399 + AddTransitionL(new(ELeave)CStringPool_Int_Transition(*iUTContext,*iTrueValidator));
1.400 +
1.401 + AddTransitionL(new(ELeave)CStringPool_String_Index_Table_Transition(*iUTContext,*iTrueValidator));
1.402 + AddTransitionL(new(ELeave)CStringPool_StringToken_Transition(*iUTContext,*iTrueValidator));
1.403 + AddTransitionL(new(ELeave)CStringPool_CDesC_Transition(*iUTContext,*iFalseValidator));
1.404 + AddTransitionL(new(ELeave)CStringPool_Dtor_Transition(*iUTContext,*iFalseValidator));
1.405 + }
1.406 +
1.407 +// ______________________________________________________________________________
1.408 +//
1.409 +_LIT(KStringPoolSmallTableCSUnitTest,"CStringPool_ShortTableCS_UnitTest");
1.410 +
1.411 +CStringPool_ShortTableCS_UnitTest* CStringPool_ShortTableCS_UnitTest::NewL(CDataLogger& aDataLogger,
1.412 + MUnitTestObserver& aObserver)
1.413 + {
1.414 + CStringPool_ShortTableCS_UnitTest* self =
1.415 + new(ELeave) CStringPool_ShortTableCS_UnitTest(aDataLogger,
1.416 + aObserver);
1.417 + CleanupStack::PushL(self);
1.418 + self->ConstructL();
1.419 + CleanupStack::Pop(self);
1.420 + return self;
1.421 + }
1.422 +
1.423 +inline TInt CStringPool_ShortTableCS_UnitTest::RunError(TInt aError)
1.424 + {
1.425 + // The RunL left so chain to the base first and then cleanup
1.426 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.427 + delete iUTContext;
1.428 + delete iStateAccessor;
1.429 + delete iTrueValidator;
1.430 + delete iFalseValidator;
1.431 + return error;
1.432 + }
1.433 +
1.434 +inline CStringPool_ShortTableCS_UnitTest::~CStringPool_ShortTableCS_UnitTest()
1.435 + {
1.436 + // Simply delete our test class instance
1.437 + delete iUTContext;
1.438 + delete iStateAccessor;
1.439 + delete iTrueValidator;
1.440 + delete iFalseValidator;
1.441 + }
1.442 +
1.443 +inline CStringPool_ShortTableCS_UnitTest::CStringPool_ShortTableCS_UnitTest(CDataLogger& aDataLogger,
1.444 + MUnitTestObserver& aObserver)
1.445 +: CUnitTest(KStringPoolSmallTableCSUnitTest, aDataLogger, aObserver)
1.446 + {
1.447 + //Do nothing
1.448 + }
1.449 +
1.450 +// Now the Individual transitions need to be added.
1.451 +inline void CStringPool_ShortTableCS_UnitTest::ConstructL()
1.452 + {
1.453 + // Perform the base class initialization
1.454 + UnitTestConstructL();
1.455 +
1.456 + // Create the Unit test state accessor
1.457 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.458 + // Construct the Unit test context.
1.459 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.460 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.461 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.462 + AddTransitionL(new(ELeave)CStringPool_ShortCSCtor_Transition(*iUTContext,*iFalseValidator));
1.463 + AddTransitionL(new(ELeave)CStringPool_AeqA_Transition(*iUTContext,*iTrueValidator));
1.464 + AddTransitionL(new(ELeave)CStringPool_AneA_Transition(*iUTContext,*iFalseValidator));
1.465 + AddTransitionL(new(ELeave)CStringPool_AneB_Transition(*iUTContext,*iTrueValidator));
1.466 + AddTransitionL(new(ELeave)CStringPool_AeqB_Transition(*iUTContext,*iFalseValidator));
1.467 + AddTransitionL(new(ELeave)CStringPool_AeqD_Transition(*iUTContext,*iTrueValidator));
1.468 + AddTransitionL(new(ELeave)CStringPool_AneD_Transition(*iUTContext,*iFalseValidator));
1.469 + AddTransitionL(new(ELeave)CStringPool_Desc_Transition(*iUTContext,*iFalseValidator));
1.470 + AddTransitionL(new(ELeave)CStringPool_Copy_Transition(*iUTContext,*iTrueValidator));
1.471 + AddTransitionL(new(ELeave)CStringPool_CDesC_Transition(*iUTContext,*iFalseValidator));
1.472 + AddTransitionL(new(ELeave)CStringPool_Close_Transition(*iUTContext,*iFalseValidator));
1.473 + AddTransitionL(new(ELeave)CStringPool_Int_Transition(*iUTContext,*iTrueValidator));
1.474 +
1.475 + AddTransitionL(new(ELeave)CStringPool_String_Index_Table_Transition(*iUTContext,*iTrueValidator));
1.476 + AddTransitionL(new(ELeave)CStringPool_StringToken_Transition(*iUTContext,*iTrueValidator));
1.477 + AddTransitionL(new(ELeave)CStringPool_CDesC_Transition(*iUTContext,*iFalseValidator));
1.478 + AddTransitionL(new(ELeave)CStringPool_Dtor_Transition(*iUTContext,*iFalseValidator));
1.479 +
1.480 +
1.481 + }
1.482 +
1.483 +// ______________________________________________________________________________
1.484 +//
1.485 +_LIT(KStringPoolIrrelevantTableCSUnitTest,"CStringPool_IrrelevantTableCS_UnitTest");
1.486 +
1.487 +CStringPool_IrrelevantTableCS_UnitTest* CStringPool_IrrelevantTableCS_UnitTest::NewL(CDataLogger& aDataLogger,
1.488 + MUnitTestObserver& aObserver)
1.489 + {
1.490 + CStringPool_IrrelevantTableCS_UnitTest* self =
1.491 + new(ELeave) CStringPool_IrrelevantTableCS_UnitTest(aDataLogger,
1.492 + aObserver);
1.493 + CleanupStack::PushL(self);
1.494 + self->ConstructL();
1.495 + CleanupStack::Pop(self);
1.496 + return self;
1.497 + }
1.498 +
1.499 +inline TInt CStringPool_IrrelevantTableCS_UnitTest::RunError(TInt aError)
1.500 + {
1.501 + // The RunL left so chain to the base first and then cleanup
1.502 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.503 + delete iUTContext;
1.504 + delete iStateAccessor;
1.505 + delete iTrueValidator;
1.506 + delete iFalseValidator;
1.507 + return error;
1.508 + }
1.509 +
1.510 +inline CStringPool_IrrelevantTableCS_UnitTest::~CStringPool_IrrelevantTableCS_UnitTest()
1.511 + {
1.512 + // Simply delete our test class instance
1.513 + delete iUTContext;
1.514 + delete iStateAccessor;
1.515 + delete iTrueValidator;
1.516 + delete iFalseValidator;
1.517 + }
1.518 +
1.519 +inline CStringPool_IrrelevantTableCS_UnitTest::CStringPool_IrrelevantTableCS_UnitTest(CDataLogger& aDataLogger,
1.520 + MUnitTestObserver& aObserver)
1.521 +: CUnitTest(KStringPoolIrrelevantTableCSUnitTest, aDataLogger, aObserver)
1.522 + {
1.523 + //Do nothing
1.524 + }
1.525 +
1.526 +// Now the Individual transitions need to be added.
1.527 +inline void CStringPool_IrrelevantTableCS_UnitTest::ConstructL()
1.528 + {
1.529 + // Perform the base class initialization
1.530 + UnitTestConstructL();
1.531 +
1.532 + // Create the Unit test state accessor
1.533 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.534 + // Construct the Unit test context.
1.535 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.536 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.537 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.538 + AddTransitionL(new(ELeave)CStringPool_IrrelevantCSCtor_Transition(*iUTContext,*iFalseValidator));
1.539 + AddTransitionL(new(ELeave)CStringPool_AeqA_Transition(*iUTContext,*iTrueValidator));
1.540 + AddTransitionL(new(ELeave)CStringPool_AneA_Transition(*iUTContext,*iFalseValidator));
1.541 + AddTransitionL(new(ELeave)CStringPool_AneB_Transition(*iUTContext,*iTrueValidator));
1.542 + AddTransitionL(new(ELeave)CStringPool_AeqB_Transition(*iUTContext,*iFalseValidator));
1.543 + AddTransitionL(new(ELeave)CStringPool_AeqD_Transition(*iUTContext,*iTrueValidator));
1.544 + AddTransitionL(new(ELeave)CStringPool_AneD_Transition(*iUTContext,*iFalseValidator));
1.545 + AddTransitionL(new(ELeave)CStringPool_Desc_Transition(*iUTContext,*iFalseValidator));
1.546 + AddTransitionL(new(ELeave)CStringPool_Copy_Transition(*iUTContext,*iTrueValidator));
1.547 + AddTransitionL(new(ELeave)CStringPool_CDesC_Transition(*iUTContext,*iFalseValidator));
1.548 + AddTransitionL(new(ELeave)CStringPool_Close_Transition(*iUTContext,*iFalseValidator));
1.549 + AddTransitionL(new(ELeave)CStringPool_Int_Transition(*iUTContext,*iTrueValidator));
1.550 + AddTransitionL(new(ELeave)CStringPool_StringToken_Transition(*iUTContext,*iTrueValidator));
1.551 + AddTransitionL(new(ELeave)CStringPool_CDesC_Transition(*iUTContext,*iFalseValidator));
1.552 + AddTransitionL(new(ELeave)CStringPool_Dtor_Transition(*iUTContext,*iFalseValidator));
1.553 + }
1.554 +
1.555 +// ______________________________________________________________________________
1.556 +//
1.557 +_LIT(KStringPoolLargeCSUnitTest,"CStringPool_LongTableCS_UnitTest");
1.558 +
1.559 +CStringPool_LongTableCS_UnitTest* CStringPool_LongTableCS_UnitTest::NewL(CDataLogger& aDataLogger,
1.560 + MUnitTestObserver& aObserver)
1.561 + {
1.562 + CStringPool_LongTableCS_UnitTest* self =
1.563 + new(ELeave) CStringPool_LongTableCS_UnitTest(aDataLogger,
1.564 + aObserver);
1.565 + CleanupStack::PushL(self);
1.566 + self->ConstructL();
1.567 + CleanupStack::Pop(self);
1.568 + return self;
1.569 + }
1.570 +
1.571 +inline TInt CStringPool_LongTableCS_UnitTest::RunError(TInt aError)
1.572 + {
1.573 + // The RunL left so chain to the base first and then cleanup
1.574 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.575 + delete iUTContext;
1.576 + delete iStateAccessor;
1.577 + delete iTrueValidator;
1.578 + delete iFalseValidator;
1.579 + return error;
1.580 + }
1.581 +
1.582 +inline CStringPool_LongTableCS_UnitTest::~CStringPool_LongTableCS_UnitTest()
1.583 + {
1.584 + // Simply delete our test class instance
1.585 + delete iUTContext;
1.586 + delete iStateAccessor;
1.587 + delete iTrueValidator;
1.588 + delete iFalseValidator;
1.589 + }
1.590 +
1.591 +inline CStringPool_LongTableCS_UnitTest::CStringPool_LongTableCS_UnitTest(CDataLogger& aDataLogger,
1.592 + MUnitTestObserver& aObserver)
1.593 +: CUnitTest(KStringPoolLargeCSUnitTest, aDataLogger, aObserver)
1.594 + {
1.595 + //Do nothing
1.596 + }
1.597 +
1.598 +// Now the Individual transitions need to be added.
1.599 +inline void CStringPool_LongTableCS_UnitTest::ConstructL()
1.600 + {
1.601 + // Perform the base class initialization
1.602 + UnitTestConstructL();
1.603 +
1.604 + // Create the Unit test state accessor
1.605 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.606 + // Construct the Unit test context.
1.607 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.608 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.609 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.610 + AddTransitionL(new(ELeave)CStringPool_LargeCSCtor_Transition(*iUTContext,*iFalseValidator));
1.611 + AddTransitionL(new(ELeave)CStringPool_AeqA_Transition(*iUTContext,*iTrueValidator));
1.612 + AddTransitionL(new(ELeave)CStringPool_AneA_Transition(*iUTContext,*iFalseValidator));
1.613 + AddTransitionL(new(ELeave)CStringPool_AneB_Transition(*iUTContext,*iTrueValidator));
1.614 + AddTransitionL(new(ELeave)CStringPool_AeqB_Transition(*iUTContext,*iFalseValidator));
1.615 + AddTransitionL(new(ELeave)CStringPool_AeqD_Transition(*iUTContext,*iTrueValidator));
1.616 + AddTransitionL(new(ELeave)CStringPool_AneD_Transition(*iUTContext,*iFalseValidator));
1.617 + AddTransitionL(new(ELeave)CStringPool_Desc_Transition(*iUTContext,*iFalseValidator));
1.618 + AddTransitionL(new(ELeave)CStringPool_Copy_Transition(*iUTContext,*iTrueValidator));
1.619 + AddTransitionL(new(ELeave)CStringPool_CDesC_Transition(*iUTContext,*iFalseValidator));
1.620 + AddTransitionL(new(ELeave)CStringPool_Close_Transition(*iUTContext,*iFalseValidator));
1.621 + AddTransitionL(new(ELeave)CStringPool_Int_Transition(*iUTContext,*iTrueValidator));
1.622 + AddTransitionL(new(ELeave)CStringPool_String_Index_Table_Transition(*iUTContext,*iTrueValidator));
1.623 + AddTransitionL(new(ELeave)CStringPool_StringToken_Transition(*iUTContext,*iTrueValidator));
1.624 + AddTransitionL(new(ELeave)CStringPool_CDesC_Transition(*iUTContext,*iFalseValidator));
1.625 + AddTransitionL(new(ELeave)CStringPool_Dtor_Transition(*iUTContext,*iFalseValidator));
1.626 + }
1.627 +
1.628 +
1.629 +
1.630 +// ______________________________________________________________________________
1.631 +//
1.632 +_LIT(KStringPoolMultipleTableShortCIUnitTest,"CStringPool_MultipleTableShortCI_UnitTest");
1.633 +
1.634 +CStringPool_MultipleTableShortCI_UnitTest* CStringPool_MultipleTableShortCI_UnitTest::NewL(CDataLogger& aDataLogger,
1.635 + MUnitTestObserver& aObserver)
1.636 + {
1.637 + CStringPool_MultipleTableShortCI_UnitTest* self =
1.638 + new(ELeave) CStringPool_MultipleTableShortCI_UnitTest(aDataLogger,
1.639 + aObserver);
1.640 + CleanupStack::PushL(self);
1.641 + self->ConstructL();
1.642 + CleanupStack::Pop(self);
1.643 + return self;
1.644 + }
1.645 +
1.646 +inline TInt CStringPool_MultipleTableShortCI_UnitTest::RunError(TInt aError)
1.647 + {
1.648 + // The RunL left so chain to the base first and then cleanup
1.649 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.650 + delete iUTContext;
1.651 + delete iStateAccessor;
1.652 + delete iTrueValidator;
1.653 + delete iFalseValidator;
1.654 + return error;
1.655 + }
1.656 +
1.657 +inline CStringPool_MultipleTableShortCI_UnitTest::~CStringPool_MultipleTableShortCI_UnitTest()
1.658 + {
1.659 + // Simply delete our test class instance
1.660 + delete iUTContext;
1.661 + delete iStateAccessor;
1.662 + delete iTrueValidator;
1.663 + delete iFalseValidator;
1.664 + }
1.665 +
1.666 +inline CStringPool_MultipleTableShortCI_UnitTest::CStringPool_MultipleTableShortCI_UnitTest(CDataLogger& aDataLogger,
1.667 + MUnitTestObserver& aObserver)
1.668 +: CUnitTest(KStringPoolMultipleTableShortCIUnitTest, aDataLogger, aObserver)
1.669 + {
1.670 + //Do nothing
1.671 + }
1.672 +
1.673 +// Now the Individual transitions need to be added.
1.674 +inline void CStringPool_MultipleTableShortCI_UnitTest::ConstructL()
1.675 + {
1.676 +// Perform the base class initialization
1.677 + UnitTestConstructL();
1.678 +
1.679 + // Create the Unit test state accessor
1.680 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.681 + // Construct the Unit test context.
1.682 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.683 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.684 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.685 + AddTransitionL(new(ELeave)CStringPool_MultipleTableCICtor_Transition(*iUTContext,*iFalseValidator));
1.686 + AddTransitionL(new(ELeave)CStringPool_FAeqB_Transition(*iUTContext,*iTrueValidator));
1.687 + AddTransitionL(new(ELeave)CStringPool_MutlipleCICeqC_Transition(*iUTContext,*iTrueValidator));
1.688 + AddTransitionL(new(ELeave)CStringPool_MultipleCIStringToIndex_Transition(*iUTContext,*iTrueValidator));
1.689 + AddTransitionL(new(ELeave)CStringPool_MultipleCIDynamicString_Transition(*iUTContext,*iTrueValidator));
1.690 + AddTransitionL(new(ELeave)CStringPool_MultipleCIIndexToStringDynamic_Transition(*iUTContext,*iTrueValidator));
1.691 +
1.692 + AddTransitionL(new(ELeave)CStringPool_MultipleTableDtor_Transition(*iUTContext,*iTrueValidator));
1.693 + }
1.694 +
1.695 +// ______________________________________________________________________________
1.696 +//
1.697 +_LIT(KStringPoolMultipleTableShortCSUnitTest,"CStringPool_MultipleTableShortCS_UnitTest");
1.698 +
1.699 +CStringPool_MultipleTableShortCS_UnitTest* CStringPool_MultipleTableShortCS_UnitTest::NewL(CDataLogger& aDataLogger,
1.700 + MUnitTestObserver& aObserver)
1.701 + {
1.702 + CStringPool_MultipleTableShortCS_UnitTest* self =
1.703 + new(ELeave) CStringPool_MultipleTableShortCS_UnitTest(aDataLogger,
1.704 + aObserver);
1.705 + CleanupStack::PushL(self);
1.706 + self->ConstructL();
1.707 + CleanupStack::Pop(self);
1.708 + return self;
1.709 + }
1.710 +
1.711 +inline TInt CStringPool_MultipleTableShortCS_UnitTest::RunError(TInt aError)
1.712 + {
1.713 + // The RunL left so chain to the base first and then cleanup
1.714 + TInt error = CUnitTest::RunError(aError); // Chain to base
1.715 + delete iUTContext;
1.716 + delete iStateAccessor;
1.717 + delete iTrueValidator;
1.718 + delete iFalseValidator;
1.719 + return error;
1.720 + }
1.721 +
1.722 +inline CStringPool_MultipleTableShortCS_UnitTest::~CStringPool_MultipleTableShortCS_UnitTest()
1.723 + {
1.724 + // Simply delete our test class instance
1.725 + delete iUTContext;
1.726 + delete iStateAccessor;
1.727 + delete iTrueValidator;
1.728 + delete iFalseValidator;
1.729 + }
1.730 +
1.731 +inline CStringPool_MultipleTableShortCS_UnitTest::CStringPool_MultipleTableShortCS_UnitTest(CDataLogger& aDataLogger,
1.732 + MUnitTestObserver& aObserver)
1.733 +: CUnitTest(KStringPoolMultipleTableShortCSUnitTest, aDataLogger, aObserver)
1.734 + {
1.735 + //Do nothing
1.736 + }
1.737 +
1.738 +// Now the Individual transitions need to be added.
1.739 +inline void CStringPool_MultipleTableShortCS_UnitTest::ConstructL()
1.740 + {
1.741 +// Perform the base class initialization
1.742 + UnitTestConstructL();
1.743 +
1.744 + // Create the Unit test state accessor
1.745 + iStateAccessor = new(ELeave) TStringPool_StateAccessor;
1.746 + // Construct the Unit test context.
1.747 + iUTContext = new(ELeave) CStringPool_UnitTestContext(iDataLogger, *iStateAccessor, *this);
1.748 + iTrueValidator = new(ELeave) TStringPool_True_TransitionValidator(*iUTContext);
1.749 + iFalseValidator = new(ELeave) TStringPool_False_TransitionValidator(*iUTContext);
1.750 + AddTransitionL(new(ELeave)CStringPool_MultipleTableCSCtor_Transition(*iUTContext,*iFalseValidator));
1.751 + AddTransitionL(new(ELeave)CStringPool_AeqB_Transition(*iUTContext,*iTrueValidator));
1.752 + AddTransitionL(new(ELeave)CStringPool_MutlipleCSCeqC_Transition(*iUTContext,*iTrueValidator));
1.753 + AddTransitionL(new(ELeave)CStringPool_MultipleCSStringToIndex_Transition(*iUTContext,*iTrueValidator));
1.754 + AddTransitionL(new(ELeave)CStringPool_MultipleCSDynamicString_Transition(*iUTContext,*iTrueValidator));
1.755 + AddTransitionL(new(ELeave)CStringPool_MultipleCSIndexToStringDynamic_Transition(*iUTContext,*iTrueValidator));
1.756 +
1.757 + AddTransitionL(new(ELeave)CStringPool_MultipleTableDtor_Transition(*iUTContext,*iTrueValidator));
1.758 + }
1.759 +
1.760 +