os/kernelhwsrv/kerneltest/e32test/buffer/t_des.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/buffer/t_des.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,1521 @@
     1.4 +// Copyright (c) 1995-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 the License "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 +// e32test\buffer\t_des.cpp
    1.18 +// Overview:
    1.19 +// Test methods of the TDes template class.
    1.20 +// API Information:
    1.21 +// TDes
    1.22 +// Details:
    1.23 +// - Test assigning TPtrs in various ways and confirm results are as expected.
    1.24 +// - Test locating in reverse on an empty TPtr, verify it returns KErrNoFound.
    1.25 +// - For TBuf, TBuf8 and TBuf16 objects: 
    1.26 +// - Construct a default TBuf object and verify Length and MaxLength values are
    1.27 +// as expected.
    1.28 +// - Construct a TBuf object with length and verify Length and MaxLength values 
    1.29 +// are as expected.
    1.30 +// - Construct a TBuf object over a string, verify Length and MaxLength values 
    1.31 +// are as expected. Verify the string data is correct.
    1.32 +// - Construct a TBuf object over a descriptor, verify Length and MaxLength values 
    1.33 +// are as expected. Verify the data is correct.
    1.34 +// - Construct a TBuf object over a buffer, verify Length and MaxLength values 
    1.35 +// are as expected. Verify the data is correct.
    1.36 +// - Construct a TBuf object and assign a string to it, verify Length and MaxLength 
    1.37 +// values are as expected. Verify the data is correct.
    1.38 +// - Construct a TBuf object and assign a descriptor to it, verify Length and MaxLength 
    1.39 +// values are as expected. Verify the data is correct.
    1.40 +// - Construct a TBuf object and assign a buffer to it, verify Length and MaxLength 
    1.41 +// values are as expected. Verify the data is correct.
    1.42 +// - Check the available user heap space and check for memory leaks by comparing it to 
    1.43 +// the initial value.
    1.44 +// - For TPtrC, TPtrC8 and TPtrC16 objects: 
    1.45 +// - Verify the invariant for a null pointer descriptor
    1.46 +// - Construct a TPtrC object over a constant string, verify Length and string data 
    1.47 +// are correct.
    1.48 +// - Construct a TPtrC object over a constant descriptor, verify Length and data are 
    1.49 +// correct.
    1.50 +// - Construct a TPtrC object over a constant buffer with length, verify Length and 
    1.51 +// data are correct.
    1.52 +// - Check the available user heap space and check for memory leaks by comparing it to 
    1.53 +// the initial value.
    1.54 +// - For TPtr, TPtr8 and TPtr16 objects: 
    1.55 +// - Verify the invariant for a null pointer descriptor
    1.56 +// - Construct a TPtr object over a buffer with length and maxlength, verify Length,
    1.57 +// MaxLength and data are correct.
    1.58 +// - Construct a TPtr object over a buffer with maxlength, verify Length, MaxLength 
    1.59 +// and Ptr are correct.
    1.60 +// - Construct a TPtr object and assign a string to it. Verify Length, MaxLength and
    1.61 +// the string data are correct.
    1.62 +// - Construct a TPtr object and assign a buffer to it. Verify Length, MaxLength and
    1.63 +// the data are correct.
    1.64 +// - Construct a TPtr object and assign a descriptor to it. Verify Length, MaxLength
    1.65 +// and the data are correct.
    1.66 +// - Check the available user heap space and check for memory leaks by comparing it to 
    1.67 +// the initial value.
    1.68 +// - Verify the TPtr copy constructor by setting and checking a text string.
    1.69 +// - For TBufC, TBufC8 and TBufC16 objects: 
    1.70 +// - Construct a default TBufC object. Verify default Length is as expected.
    1.71 +// - Construct a TBufC object over a string, verify Length and data are correct.
    1.72 +// - Construct a TBufC object over a TBufC, verify Length and data are correct.
    1.73 +// - Construct a TBufC object and assign a string to it, verify Length and data 
    1.74 +// are correct.
    1.75 +// - Construct a TBufC object and assign a descriptor to it, verify Length and data 
    1.76 +// are correct.
    1.77 +// - Construct a TBufC object and assign a TBufC to it, verify Length and data 
    1.78 +// are correct.
    1.79 +// - Check the available user heap space and check for memory leaks by comparing it to 
    1.80 +// the initial value.
    1.81 +// - For HBufC, HBufC8 and HBufC16 objects: 
    1.82 +// - Create a new descriptor using the New() method, verify non-NULL return value.
    1.83 +// - Construct a HBufC object and assign a string to it, verify Length and data 
    1.84 +// are correct.
    1.85 +// - Construct a HBufC object and assign a descriptor to it, verify Length and data 
    1.86 +// are correct.
    1.87 +// - Construct a HBufC object and assign a HBufC to it, verify Length and data 
    1.88 +// are correct.
    1.89 +// - Construct a HBufC object and call ReAlloc method, verify Length and data are 
    1.90 +// correct.
    1.91 +// - Check the available user heap space and check for memory leaks by comparing it to 
    1.92 +// the initial value.
    1.93 +// - Test ASCII destination with Unicode source. Verify string results are as expected.
    1.94 +// - For TLitC, TLitC8 and TLitC16 objects: 
    1.95 +// - Verify member operators.
    1.96 +// - Assign and validate literal values
    1.97 +// - For TBuf, TBuf8 and TBuf16 objects, test TDes derived objects that return TPtrs.
    1.98 +// - Extract and verify the left portion of the descriptor (LeftTPtr).
    1.99 +// - Extract and verify the right portion of the descriptor (RightTPtr).
   1.100 +// - Extract and verify the middle portion of the descriptor (MidTPtr).
   1.101 +// - For TPtr, TPtr8 and TPtr16 objects, test TDes derived objects that return TPtrs.
   1.102 +// - Extract and verify the left portion of the descriptor (LeftTPtr).
   1.103 +// - Extract and verify the right portion of the descriptor (RightTPtr).
   1.104 +// - Extract and verify the middle portion of the descriptor (MidTPtr).
   1.105 +// Platforms/Drives/Compatibility:
   1.106 +// All 
   1.107 +// Assumptions/Requirement/Pre-requisites:
   1.108 +// Failures and causes:
   1.109 +// Base Port information:
   1.110 +// 
   1.111 +//
   1.112 +
   1.113 +#include <e32test.h>
   1.114 +
   1.115 +LOCAL_D RTest test(_L("T_DES"));
   1.116 +
   1.117 +template<class T,class S, class L, class R>	
   1.118 +class TestTDes
   1.119 +	{
   1.120 +public:
   1.121 +	TestTDes(); 		// Test class constructor.
   1.122 +	void Test1();
   1.123 +	void Test2();
   1.124 +	void Test3();
   1.125 +	void Test4();
   1.126 +	void Test5();
   1.127 +	void Test6();
   1.128 +	void Test7();
   1.129 +	void Test8();
   1.130 +	void Test9();
   1.131 +	void Test10();
   1.132 +	void Test11();
   1.133 +	void Test12();
   1.134 +	void Test13();
   1.135 +	void Test14();
   1.136 +	void Test15();
   1.137 +	void Test16();
   1.138 +	void Test17();
   1.139 +	void Test18();
   1.140 +	void TestA();
   1.141 +	void TestB();
   1.142 +	void TestC();
   1.143 +	void TestD();
   1.144 +	void TestE();
   1.145 +	void TestF();
   1.146 +	void TestG();
   1.147 +	void TestH();
   1.148 +	void TestI();
   1.149 +	void TestJ();
   1.150 +	void TestK();
   1.151 +	void TestL();
   1.152 +	void TestM();
   1.153 +	void TestN();
   1.154 +	void TestO();
   1.155 +	void TestP();
   1.156 +	void test_TPtrC(); 	// Test TPtrC classes
   1.157 +	void test_TPtr();	// Test TPtr classes
   1.158 +	void test_TBuf();	// Test TBuf classes
   1.159 +	void test_TBufC();	// Test TBufC classes
   1.160 +	void test_HBufC();	// Test HBufC classes
   1.161 +	void test_TBufReturningModifiable();
   1.162 +	void test_TPtrReturningModifiable();
   1.163 +	void test_TDesReturningModifiable(const T& a, R& b);
   1.164 +	void testHeapSpace(TInt);
   1.165 +	};
   1.166 +
   1.167 +template <class T, class S, class L, class R>
   1.168 +GLDEF_C TestTDes<T,S,L,R>::TestTDes()
   1.169 +//
   1.170 +//	Constructor
   1.171 +//
   1.172 +	{}
   1.173 +
   1.174 +template <class T,class S,class L,class R>
   1.175 +GLDEF_C void TestTDes<T,S,L,R>::testHeapSpace(TInt startAvail)
   1.176 +//
   1.177 +//	Test no memory leakage has occured
   1.178 +//
   1.179 +	{
   1.180 +
   1.181 +	test.Next(_L("Testing for memory leaks"));
   1.182 +	TInt endAvail,temp;
   1.183 +	endAvail=User::Available(temp);
   1.184 +	test(endAvail==startAvail);
   1.185 +	}
   1.186 +
   1.187 +template <class T, class S, class L, class R>
   1.188 +GLDEF_C void TestTDes<T,S,L,R>::Test1()
   1.189 +//
   1.190 +//	Constructs a view over a constant string
   1.191 +//
   1.192 +	{
   1.193 +
   1.194 +	T a(_TL("ABc"));
   1.195 +	a.__DbgTestInvariant();
   1.196 +	test(a.Length()==3);
   1.197 +	test(*a.Ptr()=='A');
   1.198 +	test(*(a.Ptr()+1)=='B');
   1.199 +	test(*(a.Ptr()+2)=='c');
   1.200 +	}
   1.201 +
   1.202 +template<class T, class S, class L, class R>
   1.203 +GLDEF_C void TestTDes<T,S,L,R>::Test2()
   1.204 +//
   1.205 +//	Constructs a view over a descriptor
   1.206 +//
   1.207 +	{
   1.208 +
   1.209 +	T aDes(_TL("ABc"));
   1.210 +	aDes.__DbgTestInvariant();
   1.211 +	T b(aDes);
   1.212 +	b.__DbgTestInvariant();
   1.213 +	test(b.Length()==aDes.Length());
   1.214 +	test(*b.Ptr()==*aDes.Ptr());
   1.215 +	test(*(b.Ptr()+1)==*(aDes.Ptr()+1));
   1.216 +	test(*(b.Ptr()+2)==*(aDes.Ptr()+2));
   1.217 +	}
   1.218 +
   1.219 +template<class T, class S, class L, class R>
   1.220 +GLDEF_C void TestTDes<T,S,L,R>::Test3()
   1.221 +//
   1.222 +//	Constructs a view over a length specified buffer
   1.223 +//
   1.224 +	{
   1.225 +
   1.226 +	S* aBuf = _TL("ABCDEF");
   1.227 +	T aDes(aBuf,6);
   1.228 +	aDes.__DbgTestInvariant();
   1.229 +	test(aDes.Length()==6);
   1.230 +	for(S count=0; count<aDes.Length(); count++)
   1.231 +		test(*(aDes.Ptr()+count)==('A' + count));
   1.232 +	test(aDes.Ptr()==aBuf);
   1.233 +	}
   1.234 +
   1.235 +template<class T, class S, class L, class R>
   1.236 +GLDEF_C void TestTDes<T,S,L,R>::Test4()
   1.237 +//
   1.238 +//	Constructs a r/w view over a buffer with length & maxlength
   1.239 +//
   1.240 +	{
   1.241 +
   1.242 +	S* aBuf;
   1.243 +	aBuf=_TL("LMNOPQ");
   1.244 +	T aDesW(aBuf,6,0x0A);
   1.245 +	aDesW.__DbgTestInvariant();
   1.246 +	test(aDesW.Length()==6);
   1.247 +	for(S count=0; count<aDesW.Length(); count++)
   1.248 +		test(*(aDesW.Ptr()+count)==('L' + count));
   1.249 +	test(aDesW.Ptr()==aBuf);
   1.250 +	test(aDesW.MaxLength()==0x0A);
   1.251 +	}
   1.252 +
   1.253 +template<class T, class S, class L, class R>
   1.254 +GLDEF_C void TestTDes<T,S,L,R>::Test5()
   1.255 +//
   1.256 +//	Constructs a r/w view over a buffer with maxlength
   1.257 +//
   1.258 +	{
   1.259 +
   1.260 +	S* aBuf;
   1.261 +	aBuf=_TL("ZYXWVU");
   1.262 +	T aDesW(aBuf,0x06);
   1.263 +	aDesW.__DbgTestInvariant();
   1.264 +	test(aDesW.Length()==0);
   1.265 +	test(aDesW.MaxLength()==0x06);
   1.266 +	test(aDesW.Ptr()==aBuf);
   1.267 +	}
   1.268 +
   1.269 +template<class T, class S, class L, class R>
   1.270 +GLDEF_C void TestTDes<T,S,L,R>::Test6()
   1.271 +//
   1.272 +//	Constructs a r/w view over a LcbBase with maxlength
   1.273 +//
   1.274 +	{
   1.275 +	// Cant use yet, see calling function
   1.276 +	}
   1.277 +
   1.278 +template<class T, class S, class L, class R>
   1.279 +GLDEF_C void TestTDes<T,S,L,R>::Test7()
   1.280 +//
   1.281 +//	Constructs a default TBuf view 
   1.282 +//
   1.283 +	{
   1.284 +
   1.285 +	T aBuf;
   1.286 +	aBuf.__DbgTestInvariant();
   1.287 +	test(aBuf.Length()==0);
   1.288 +	test(aBuf.MaxLength()==0x40);
   1.289 +	}
   1.290 +
   1.291 +template<class T, class S, class L, class R>
   1.292 +GLDEF_C void TestTDes<T,S,L,R>::Test8()
   1.293 +//
   1.294 +//	Constructs a TBuf view with length
   1.295 +//
   1.296 +	{
   1.297 +
   1.298 +	T aBuf(10);
   1.299 +	aBuf.__DbgTestInvariant();
   1.300 +	test(aBuf.Length()==10);
   1.301 +	test(aBuf.MaxLength()==0x40);
   1.302 +	}
   1.303 +
   1.304 +template<class T, class S, class L, class R>
   1.305 +GLDEF_C void TestTDes<T,S,L,R>::Test9()
   1.306 +//
   1.307 +//	Constructs a TBuf view over a string
   1.308 +//
   1.309 +	{
   1.310 +
   1.311 +	T aBuf(_TL("ABCDEF"));
   1.312 +	aBuf.__DbgTestInvariant();
   1.313 +	test(aBuf.Length()==6);
   1.314 +	test(aBuf.MaxLength()==0x40);
   1.315 +	for(S count=0;count<aBuf.Length();count++)
   1.316 +		test(*(aBuf.Ptr()+count)==('A' + count));
   1.317 +	}
   1.318 +
   1.319 +template<class T, class S, class L, class R>
   1.320 +GLDEF_C void TestTDes<T,S,L,R>::Test10()
   1.321 +//
   1.322 +//	Constructs a TBuf view over a descriptor
   1.323 +//
   1.324 +	{
   1.325 +
   1.326 +	R aDesR(_TL("ABCDEF"));
   1.327 +	aDesR.__DbgTestInvariant();
   1.328 +	T aBuf(aDesR);
   1.329 +	aBuf.__DbgTestInvariant();
   1.330 +	test(aBuf.MaxLength()==0x40);
   1.331 +	test(aBuf.Length()==aDesR.Length());
   1.332 +	test(aBuf.Length()==6);
   1.333 +	for(S count=0;count<aBuf.Length();count++)
   1.334 +		{
   1.335 +		test(*(aBuf.Ptr()+count)==('A' + count));
   1.336 +		test(*(aBuf.Ptr()+count)==*(aDesR.Ptr()+count));
   1.337 +		}
   1.338 +	}
   1.339 +
   1.340 +template<class T, class S, class L, class R>
   1.341 +GLDEF_C void TestTDes<T,S,L,R>::Test11()
   1.342 +//
   1.343 +//	Constructs a TBuf view over a buffer
   1.344 +//
   1.345 +	{
   1.346 +
   1.347 +	T aBuf(_TL("ABCDEF"));
   1.348 +	aBuf.__DbgTestInvariant();
   1.349 +	T bBuf(aBuf);
   1.350 +	bBuf.__DbgTestInvariant();
   1.351 +	test(bBuf.MaxLength()==aBuf.MaxLength());
   1.352 +	test(bBuf.MaxLength()==0x40);
   1.353 +	test(bBuf.Length()==aBuf.Length());
   1.354 +	test(bBuf.Length()==6);
   1.355 +	for(S count=0;count<bBuf.Length();count++)
   1.356 +		{
   1.357 +		test(*(bBuf.Ptr()+count)==('A' + count));
   1.358 +		test(*(bBuf.Ptr()+count)==*(aBuf.Ptr()+count));
   1.359 +		}
   1.360 +	}
   1.361 +
   1.362 +template<class T,class S,class L,class R>
   1.363 +GLDEF_C void TestTDes<T,S,L,R>::Test12()
   1.364 +//
   1.365 +//	Exercise the default TBufC constructor
   1.366 +//
   1.367 +	{
   1.368 +
   1.369 +	T buf;
   1.370 +	buf.__DbgTestInvariant();
   1.371 +	test(buf.Length()==0);
   1.372 +	}
   1.373 +
   1.374 +template<class T,class S,class L,class R>
   1.375 +GLDEF_C void TestTDes<T,S,L,R>::Test13()
   1.376 +//
   1.377 +//	Constructor over a string
   1.378 +//
   1.379 +	{
   1.380 +
   1.381 +	S* pString=(_TL("12"));
   1.382 +	T buf(pString);
   1.383 +	buf.__DbgTestInvariant();
   1.384 +	test(buf.Length()==2);
   1.385 +	test(*(buf.Ptr())=='1');
   1.386 +	test(*(buf.Ptr()+1)=='2');
   1.387 +	}
   1.388 +
   1.389 +template<class T,class S,class L,class R>
   1.390 +GLDEF_C void TestTDes<T,S,L,R>::Test14()
   1.391 +//
   1.392 +//	Constructor over a TDesC (TPtrC)
   1.393 +//
   1.394 +	{
   1.395 +
   1.396 +	R des(_TL("Test 14"));
   1.397 +	des.__DbgTestInvariant();
   1.398 +	T buf(des);
   1.399 +	buf.__DbgTestInvariant();
   1.400 +	test(buf.Length()==7);
   1.401 +	test(buf.Length()==des.Length());
   1.402 +	test(*(buf.Ptr())=='T');
   1.403 +	test(*(buf.Ptr()+1)=='e');
   1.404 +	test(*(buf.Ptr()+2)=='s');
   1.405 +	test(*(buf.Ptr()+3)=='t');
   1.406 +	test(*(buf.Ptr()+4)==' ');
   1.407 +	test(*(buf.Ptr()+5)=='1');
   1.408 +	test(*(buf.Ptr()+6)=='4');
   1.409 +	}
   1.410 +
   1.411 +
   1.412 +template<class T,class S,class L,class R>
   1.413 +GLDEF_C void TestTDes<T,S,L,R>::Test15()
   1.414 +//
   1.415 +//	Constructor over a TBufC
   1.416 +//
   1.417 +	{
   1.418 +
   1.419 +	T oldBuf(_TL("Test  15"));
   1.420 +	oldBuf.__DbgTestInvariant();
   1.421 +	T newBuf(oldBuf);
   1.422 +	newBuf.__DbgTestInvariant();
   1.423 +	test(newBuf.Length()==8);
   1.424 +	test(newBuf.Length()==oldBuf.Length());
   1.425 +	test(*(newBuf.Ptr())=='T');
   1.426 +	test(*(newBuf.Ptr()+1)=='e');
   1.427 +	test(*(newBuf.Ptr()+2)=='s');
   1.428 +	test(*(newBuf.Ptr()+3)=='t');
   1.429 +	test(*(newBuf.Ptr()+4)==' ');
   1.430 +	test(*(newBuf.Ptr()+5)==' ');
   1.431 +	test(*(newBuf.Ptr()+6)=='1');
   1.432 +	test(*(newBuf.Ptr()+7)=='5');
   1.433 +	}
   1.434 +
   1.435 +template<class T,class S,class L,class R>
   1.436 +GLDEF_C void TestTDes<T,S,L,R>::Test16()
   1.437 +//
   1.438 +//	New operator - without leave
   1.439 +//
   1.440 +	{
   1.441 +
   1.442 +	T* pBuf=T::New(0x40);
   1.443 +	test(pBuf!=NULL);
   1.444 +	pBuf->__DbgTestInvariant();
   1.445 +	User::Free(pBuf);
   1.446 +	}
   1.447 +
   1.448 +template<class T,class S,class L,class R>
   1.449 +GLDEF_C void TestTDes<T,S,L,R>::Test17()
   1.450 +//
   1.451 +//	NewL operator - forcing a leave
   1.452 +//
   1.453 +	{
   1.454 +
   1.455 +/*
   1.456 +
   1.457 +    Reinstate if some method is found of forcing alloc fail
   1.458 +    This test no longer works due to heap growing functionality of E32 057
   1.459 +
   1.460 +	T* pBuf;
   1.461 +	TInt temp;
   1.462 +	TInt available=User::Available(temp);
   1.463 +	TAny* pDummy=User::Alloc(available);
   1.464 +	TRAPD(ret,pBuf=T::NewL(0x40))
   1.465 +	test(ret==KErrNoMemory);
   1.466 +	User::Free(pDummy);
   1.467 +*/
   1.468 +	}
   1.469 +
   1.470 +template<class T,class S,class L,class R>
   1.471 +GLDEF_C void TestTDes<T,S,L,R>::Test18()
   1.472 +//
   1.473 +//	NewL operator - forcing success
   1.474 +//
   1.475 +	{
   1.476 +
   1.477 +	T* pBuf=NULL;
   1.478 +	TRAPD(ret,pBuf=T::NewL(0x40))
   1.479 +	test(ret==0);
   1.480 +	test(pBuf!=NULL);
   1.481 +	pBuf->__DbgTestInvariant();
   1.482 +	User::Free(pBuf);
   1.483 +	}
   1.484 +
   1.485 +template<class T, class S, class L, class R>
   1.486 +GLDEF_C void TestTDes<T,S,L,R>::TestA()
   1.487 +//
   1.488 +//	String Assignment
   1.489 +//
   1.490 +	{
   1.491 +
   1.492 +    S myBuf[7];
   1.493 +    Mem::Copy(myBuf,_TL("ABCDEF"),7*sizeof(S));
   1.494 +	T aDes(myBuf,0x06,0x06);
   1.495 +	aDes=_TL("ZYXWVU");
   1.496 +	aDes.__DbgTestInvariant();
   1.497 +	test(aDes.Length()==6);
   1.498 +	test(aDes.MaxLength()==0x06);
   1.499 +	S count=0;
   1.500 +	for(;count<aDes.Length(); count++)
   1.501 +		{
   1.502 +		test(*(aDes.Ptr()+count)==('Z'-count));
   1.503 +		}	
   1.504 +	aDes=_TL("123");
   1.505 +	aDes.__DbgTestInvariant();
   1.506 +	test(aDes.Length()==3);
   1.507 +	test(aDes.MaxLength()==0x06);
   1.508 +	for(count=0; count<aDes.Length(); count++)
   1.509 +		{
   1.510 +		test(*(aDes.Ptr()+count)==('1'+count));
   1.511 +		}	
   1.512 +	}
   1.513 +
   1.514 +
   1.515 +template<class T, class S, class L, class R>
   1.516 +GLDEF_C void TestTDes<T,S,L,R>::TestB()
   1.517 +//	DesW Assignment
   1.518 +	{
   1.519 +	S aBuf[11];
   1.520 +	S bBuf[11];
   1.521 +	
   1.522 +    Mem::Copy(aBuf,_TL("ZYXWVUTSRQ"),11*sizeof(S));
   1.523 +    Mem::Copy(bBuf,_TL("ABCDEFGHIJ"),11*sizeof(S));
   1.524 +	T aDes(aBuf,0x0A,0x0A);	
   1.525 +	T bDes(bBuf,0x0A);
   1.526 +	bDes=aDes;
   1.527 +	aDes.__DbgTestInvariant();
   1.528 + 	bDes.__DbgTestInvariant();
   1.529 +	test(aDes.Length()==bDes.Length());
   1.530 +	test(aDes.MaxLength()==0x0A);
   1.531 +	test(bDes.MaxLength()==0x0A);		
   1.532 +	for(S count=0; count<bDes.Length(); count++)
   1.533 +		{
   1.534 +		test(*(aDes.Ptr()+count)==*(bDes.Ptr()+count));
   1.535 +		}
   1.536 +	}
   1.537 +
   1.538 +
   1.539 +
   1.540 +template<class T, class S, class L, class R>
   1.541 +GLDEF_C void TestTDes<T,S,L,R>::TestC()
   1.542 +//	DesC Assignment
   1.543 +	{
   1.544 +	S aBuf[11];
   1.545 +	R aDesR(_TL("1234567890"));	
   1.546 +    Mem::Copy(aBuf,_TL("ABCDEFGHIJ"),11*sizeof(S));
   1.547 +	T aDes(aBuf,0x0A,0x0A);
   1.548 +	aDes=aDesR;
   1.549 +	aDes.__DbgTestInvariant();
   1.550 +	test(aDes.Length()==aDesR.Length());
   1.551 +	test(aDes.MaxLength()==0x0A);
   1.552 +	for(S count=0; count<aDes.Length(); count++)
   1.553 +		{
   1.554 +		test(*(aDes.Ptr()+count)==*(aDesR.Ptr()+count));
   1.555 +		}
   1.556 +	}
   1.557 +
   1.558 +
   1.559 +template<class T, class S, class L, class R>
   1.560 +GLDEF_C void TestTDes<T,S,L,R>::TestD()
   1.561 +//	TBuf string Assignment
   1.562 +	{
   1.563 +	T aBuf;
   1.564 +	aBuf=(_TL("ABCDEF"));
   1.565 +	aBuf.__DbgTestInvariant();
   1.566 +	test(aBuf.Length()==6);
   1.567 +	test(aBuf.MaxLength()==0x40);
   1.568 +	for(S count=0; count<aBuf.Length(); count++)
   1.569 +		{
   1.570 +		test(*(aBuf.Ptr()+count)==('A'+count));
   1.571 +		}
   1.572 +	}
   1.573 +
   1.574 +
   1.575 +template<class T, class S, class L, class R>
   1.576 +GLDEF_C void TestTDes<T,S,L,R>::TestE()
   1.577 +//	TBuf descriptor Assignment
   1.578 +	{
   1.579 +	R aDesR(_TL("ABCDEF"));
   1.580 +	T aBuf;
   1.581 +	aBuf=aDesR;
   1.582 +	aBuf.__DbgTestInvariant();
   1.583 +	test(aBuf.MaxLength()==0x40);
   1.584 +	test(aBuf.Length()==aDesR.Length());
   1.585 +	test(aBuf.Length()==6);
   1.586 +	for(S count=0;count<aBuf.Length();count++)
   1.587 +		{
   1.588 +		test(*(aBuf.Ptr()+count)==('A' + count));
   1.589 +		test(*(aBuf.Ptr()+count)==*(aDesR.Ptr()+count));
   1.590 +		}
   1.591 +	}
   1.592 +
   1.593 +
   1.594 +template<class T, class S, class L, class R>
   1.595 +GLDEF_C void TestTDes<T,S,L,R>::TestF()
   1.596 +//	TBuf buffer Assignment
   1.597 +	{
   1.598 +	T aBuf(_TL("ABCDEF"));
   1.599 +	T bBuf;
   1.600 +	bBuf=aBuf;
   1.601 +	bBuf.__DbgTestInvariant();
   1.602 +	test(bBuf.MaxLength()==aBuf.MaxLength());
   1.603 +	test(bBuf.MaxLength()==0x40);
   1.604 +	test(bBuf.Length()==aBuf.Length());
   1.605 +	test(bBuf.Length()==6);
   1.606 +	for(S count=0;count<bBuf.Length();count++)
   1.607 +		{
   1.608 +		test(*(bBuf.Ptr()+count)==('A' + count));
   1.609 +		test(*(bBuf.Ptr()+count)==*(aBuf.Ptr()+count));
   1.610 +		}
   1.611 + 	}
   1.612 +	 
   1.613 +
   1.614 +template<class T, class S, class L, class R>
   1.615 +GLDEF_C void TestTDes<T,S,L,R>::TestG()
   1.616 +//	TBufC string assignment test
   1.617 +	{
   1.618 +	S* pString=_TL("TestG");
   1.619 +	T buf;
   1.620 +
   1.621 +	test(buf.Length()==0);
   1.622 +	buf=pString;
   1.623 +	buf.__DbgTestInvariant();
   1.624 +	test(buf.Length()==5);
   1.625 +	test(*(buf.Ptr())=='T');
   1.626 +	test(*(buf.Ptr()+1)=='e');
   1.627 +	test(*(buf.Ptr()+2)=='s');
   1.628 +	test(*(buf.Ptr()+3)=='t');
   1.629 +	test(*(buf.Ptr()+4)=='G');
   1.630 +	}
   1.631 +
   1.632 +
   1.633 +template<class T, class S, class L, class R>
   1.634 +GLDEF_C void TestTDes<T,S,L,R>::TestH()
   1.635 +//	TBufC descriptor assignment
   1.636 +	{
   1.637 +	R des(_TL("TestH"));
   1.638 +	T buf;
   1.639 +
   1.640 +	test(buf.Length()==0);
   1.641 +	buf=des;
   1.642 +	buf.__DbgTestInvariant();
   1.643 +	test(buf.Length()==5);
   1.644 +	test(buf.Length()==des.Length());
   1.645 +	test(*(buf.Ptr())=='T');
   1.646 +	test(*(buf.Ptr()+1)=='e');
   1.647 +	test(*(buf.Ptr()+2)=='s');
   1.648 +	test(*(buf.Ptr()+3)=='t');
   1.649 +	test(*(buf.Ptr()+4)=='H');
   1.650 +	}
   1.651 +
   1.652 +template<class T, class S, class L, class R>
   1.653 +GLDEF_C void TestTDes<T,S,L,R>::TestI()
   1.654 +//	TBufC TBufC assignment
   1.655 +	{
   1.656 +	T oldBuf(_TL("TEsti"));
   1.657 +	T newBuf;
   1.658 +
   1.659 +	test(newBuf.Length()==0);
   1.660 +	newBuf=oldBuf;
   1.661 +	newBuf.__DbgTestInvariant();
   1.662 +	test(newBuf.Length()==5);
   1.663 +	test(newBuf.Length()==oldBuf.Length());
   1.664 +	test(*(newBuf.Ptr())=='T');
   1.665 +	test(*(newBuf.Ptr()+1)=='E');
   1.666 +	test(*(newBuf.Ptr()+2)=='s');
   1.667 +	test(*(newBuf.Ptr()+3)=='t');
   1.668 +	test(*(newBuf.Ptr()+4)=='i');
   1.669 +	}
   1.670 +
   1.671 +template<class T,class S,class L,class R>
   1.672 +GLDEF_C void TestTDes<T,S,L,R>::TestJ()
   1.673 +//
   1.674 +//	HBufC string assignment
   1.675 +//
   1.676 +	{
   1.677 +
   1.678 +	S* pString=_TL("tEStJ");
   1.679 +	T* pBuf=NULL;
   1.680 +	TRAPD(ret,pBuf=T::NewL(0x40))
   1.681 +	test(ret==0);
   1.682 +	test(pBuf!=NULL);
   1.683 +	*pBuf=pString;
   1.684 +	pBuf->__DbgTestInvariant();
   1.685 +	test(pBuf->Length()==5);
   1.686 +	test(*(pBuf->Ptr())=='t');
   1.687 +	test(*(pBuf->Ptr()+1)=='E');	
   1.688 +	test(*(pBuf->Ptr()+2)=='S');	
   1.689 +	test(*(pBuf->Ptr()+3)=='t');	
   1.690 +	test(*(pBuf->Ptr()+4)=='J');	
   1.691 +	User::Free(pBuf);
   1.692 +	}
   1.693 +
   1.694 +template<class T,class S,class L,class R>
   1.695 +GLDEF_C void TestTDes<T,S,L,R>::TestK()
   1.696 +//
   1.697 +//	HBufC descriptor assignment
   1.698 +//
   1.699 +	{
   1.700 +
   1.701 +	R des(_TL("TestK"));
   1.702 +	T* pBuf=NULL;
   1.703 +	TRAPD(ret,pBuf=T::NewL(0x40))
   1.704 +	test(ret==0);
   1.705 +	test(pBuf!=NULL);
   1.706 +	*pBuf=des;
   1.707 +	pBuf->__DbgTestInvariant();
   1.708 +	test(pBuf->Length()==5);
   1.709 +	test(pBuf->Length()==des.Length());
   1.710 +	test(*(pBuf->Ptr())=='T');
   1.711 +	test(*(pBuf->Ptr()+1)=='e');	
   1.712 +	test(*(pBuf->Ptr()+2)=='s');	
   1.713 +	test(*(pBuf->Ptr()+3)=='t');	
   1.714 +	test(*(pBuf->Ptr()+4)=='K');	
   1.715 +	User::Free(pBuf);
   1.716 +	}
   1.717 +
   1.718 +template<class T,class S,class L,class R>
   1.719 +GLDEF_C void TestTDes<T,S,L,R>::TestL()
   1.720 +//
   1.721 +//	HBufC HBufC assignment
   1.722 +//
   1.723 +	{
   1.724 +
   1.725 +	S* pString=_TL("testl");
   1.726 +	T* pOldBuf=NULL;
   1.727 +	T* pNewBuf=NULL;
   1.728 +	TRAPD(ret,pOldBuf=T::NewL(0x40))
   1.729 +	test(ret==0);
   1.730 +	TRAP(ret,pNewBuf=T::NewL(0x40))
   1.731 +	test(ret==0);
   1.732 +	test(pNewBuf!=NULL);
   1.733 +	test(pOldBuf!=NULL);
   1.734 +	*pOldBuf=pString;
   1.735 +	*pNewBuf=*pOldBuf;
   1.736 +	pOldBuf->__DbgTestInvariant();
   1.737 +	pNewBuf->__DbgTestInvariant();
   1.738 +	test(pNewBuf->Length()==5);
   1.739 +	test(pOldBuf->Length()==pNewBuf->Length());
   1.740 +	test(*(pNewBuf->Ptr())=='t');
   1.741 +	test(*(pNewBuf->Ptr()+1)=='e');	
   1.742 +	test(*(pNewBuf->Ptr()+2)=='s');	
   1.743 +	test(*(pNewBuf->Ptr()+3)=='t');	
   1.744 +	test(*(pNewBuf->Ptr()+4)=='l');	
   1.745 +	User::Free(pOldBuf);
   1.746 +	User::Free(pNewBuf);
   1.747 +//
   1.748 +	TRAP(ret,pOldBuf=T::NewMaxL(0x40))
   1.749 +	test(ret==0);
   1.750 +	TRAP(ret,pNewBuf=T::NewMaxL(0x40))
   1.751 +	test(ret==0);
   1.752 +	test(pNewBuf!=NULL);
   1.753 +	test(pOldBuf!=NULL);
   1.754 +	pOldBuf->__DbgTestInvariant();
   1.755 +	pNewBuf->__DbgTestInvariant();
   1.756 +	test(pNewBuf->Length()==0x40);
   1.757 +	test(pOldBuf->Length()==0x40);
   1.758 +	pNewBuf->Des().Zero();
   1.759 +	pOldBuf->Des().Zero();
   1.760 +	pOldBuf->__DbgTestInvariant();
   1.761 +	pNewBuf->__DbgTestInvariant();
   1.762 +	test(pNewBuf->Length()==0);
   1.763 +	test(pOldBuf->Length()==0);
   1.764 +	*pOldBuf=pString;
   1.765 +	*pNewBuf=*pOldBuf;
   1.766 +	pOldBuf->__DbgTestInvariant();
   1.767 +	pNewBuf->__DbgTestInvariant();
   1.768 +	test(pNewBuf->Length()==5);
   1.769 +	test(pOldBuf->Length()==pNewBuf->Length());
   1.770 +	test(*(pNewBuf->Ptr())=='t');
   1.771 +	test(*(pNewBuf->Ptr()+1)=='e');	
   1.772 +	test(*(pNewBuf->Ptr()+2)=='s');	
   1.773 +	test(*(pNewBuf->Ptr()+3)=='t');	
   1.774 +	test(*(pNewBuf->Ptr()+4)=='l');	
   1.775 +	User::Free(pOldBuf);
   1.776 +	User::Free(pNewBuf);
   1.777 +	}
   1.778 +
   1.779 +template<class T,class S,class L,class R>
   1.780 +GLDEF_C void TestTDes<T,S,L,R>::TestM()
   1.781 +//
   1.782 +//	HBufC ReAlloc
   1.783 +//
   1.784 +	{
   1.785 +
   1.786 +	S* pString=_TL("TESTM");
   1.787 +	T* pBuf;
   1.788 +	pBuf=T::NewL(0x40);
   1.789 +	*pBuf=pString;
   1.790 +	pBuf->ReAlloc(0x40);
   1.791 +	test(pBuf!=NULL);
   1.792 +	pBuf->__DbgTestInvariant();
   1.793 +	test(pBuf->Length()==5);
   1.794 +	test(*(pBuf->Ptr())=='T');
   1.795 +	test(*(pBuf->Ptr()+1)=='E');	
   1.796 +	test(*(pBuf->Ptr()+2)=='S');	
   1.797 +	test(*(pBuf->Ptr()+3)=='T');	
   1.798 +	test(*(pBuf->Ptr()+4)=='M');	
   1.799 +	User::Free(pBuf);
   1.800 +	}
   1.801 +
   1.802 +template<class T,class S,class L,class R>
   1.803 +GLDEF_C void TestTDes<T,S,L,R>::TestN()
   1.804 +//
   1.805 +//	HBufC ReAllocL - forcing a leave
   1.806 +//
   1.807 +	{
   1.808 +
   1.809 +/*
   1.810 +
   1.811 +    Reinstate if some method is found of forcing alloc fail
   1.812 +    This test no longer works due to heap growing functionality of E32 057
   1.813 +
   1.814 +	S* pString=_TL("tEStJ");
   1.815 +	T* pBuf;
   1.816 +	TInt available, temp;
   1.817 +	TAny* pDummy;
   1.818 +	pBuf=T::NewL(0x40);
   1.819 +	test(pBuf!=NULL);
   1.820 +	*pBuf=pString;
   1.821 +	available=User::Available(temp);
   1.822 +	pDummy=User::Alloc(available);
   1.823 +	TRAPD(ret,pBuf->ReAllocL(0x50))
   1.824 +	test(ret==KErrNoMemory);
   1.825 +	User::Free(pDummy);
   1.826 +	User::Free(pBuf);
   1.827 +*/
   1.828 +	}
   1.829 +
   1.830 +template<class T,class S,class L,class R>
   1.831 +GLDEF_C void TestTDes<T,S,L,R>::TestO()
   1.832 +//	HBufC ReAllocL - forcing success
   1.833 +	{
   1.834 +
   1.835 +	S* pString=_TL("tEStJ");
   1.836 +	T* pBuf;
   1.837 +	pBuf=T::NewL(0x40);
   1.838 +	test(pBuf!=0);
   1.839 +	*pBuf=pString;
   1.840 +	TRAPD(ret,pBuf->ReAllocL(0x40))
   1.841 +	test(ret==0);
   1.842 +	test(pBuf!=NULL);
   1.843 +	pBuf->__DbgTestInvariant();
   1.844 +	test(pBuf->Length()==5);
   1.845 +	test(*(pBuf->Ptr())=='t');
   1.846 +	test(*(pBuf->Ptr()+1)=='E');	
   1.847 +	test(*(pBuf->Ptr()+2)=='S');	
   1.848 +	test(*(pBuf->Ptr()+3)=='t');	
   1.849 +	test(*(pBuf->Ptr()+4)=='J');	
   1.850 +	User::Free(pBuf);
   1.851 +	}
   1.852 +
   1.853 +template<class T,class S,class L,class R>
   1.854 +GLDEF_C void TestTDes<T,S,L,R>::TestP()
   1.855 +//	Invariant for null pointer descriptor
   1.856 +//	Added to reproduce DEF023302
   1.857 +	{
   1.858 +	T p(NULL, 0);
   1.859 +	p.__DbgTestInvariant();
   1.860 +	}
   1.861 +
   1.862 +GLDEF_C void TestCopy16()
   1.863 +//	Test TPtr16 copy constructor
   1.864 +	{
   1.865 +    TBuf16<0x20> buf(_S16("Paddington Station"));
   1.866 +	TPtr16 ptr1((TText16*)buf.Ptr(),buf.Length(),buf.MaxLength());
   1.867 +	ptr1.__DbgTestInvariant();
   1.868 +	TPtr16 ptr2(ptr1);
   1.869 +	ptr2.__DbgTestInvariant();
   1.870 +	ptr2[11]='B';
   1.871 +	ptr2[12]='e';
   1.872 +	ptr2[13]='a';
   1.873 +	ptr2[14]='r';
   1.874 +	ptr2[15]=' ';
   1.875 +	ptr1.SetLength(15);
   1.876 +	ptr2.Append(_L16(" acid"));
   1.877 +	test(ptr1==_L16("Paddington Bear"));
   1.878 +	test(ptr2==_L16("Paddington Bear on acid"));
   1.879 +	}
   1.880 +
   1.881 +GLDEF_C void Test16To8()
   1.882 +//	Test ASCII dest with Unicode source
   1.883 +	{
   1.884 +    TBuf8<0x20> buf(_S8("Paddington Station"));
   1.885 +	TPtr8 ptr1((TText8*)buf.Ptr(),buf.Length(),buf.MaxLength());
   1.886 +	ptr1.__DbgTestInvariant();
   1.887 +	TPtr8 ptr2(ptr1);
   1.888 +	ptr2.__DbgTestInvariant();
   1.889 +	ptr2[11]='B';
   1.890 +	ptr2[12]='e';
   1.891 +	ptr2[13]='a';
   1.892 +	ptr2[14]='r';
   1.893 +	ptr2[15]=' ';
   1.894 +	ptr1.SetLength(15);
   1.895 +	ptr1.__DbgTestInvariant();
   1.896 +	ptr2.Append(_L16(" acid"));
   1.897 +	ptr2.__DbgTestInvariant();
   1.898 +	test(ptr1==_L8("Paddington Bear"));
   1.899 +	test(ptr2==_L8("Paddington Bear on acid"));
   1.900 +	}
   1.901 +
   1.902 +
   1.903 +GLDEF_C void TestCopy8()
   1.904 +//	Test TPtr8 copy constructor
   1.905 +	{
   1.906 +    TBuf8<0x20> buf(_S8("Paddington Station"));
   1.907 +	TPtr8 ptr1((TText8*)buf.Ptr(),buf.Length(),buf.MaxLength());
   1.908 +	TPtr8 ptr2(ptr1);
   1.909 +	ptr2[11]='B';
   1.910 +	ptr2[12]='e';
   1.911 +	ptr2[13]='a';
   1.912 +	ptr2[14]='r';
   1.913 +	ptr2[15]=' ';
   1.914 +	ptr1.SetLength(15);
   1.915 +	ptr2.Append(_L8(" acid"));
   1.916 +	ptr1.__DbgTestInvariant();
   1.917 +	ptr2.__DbgTestInvariant();
   1.918 +	test(ptr1==_L8("Paddington Bear"));
   1.919 +	test(ptr2==_L8("Paddington Bear on acid"));
   1.920 +	}
   1.921 +
   1.922 +GLDEF_C void TestCopy()
   1.923 +//	Test TPtr copy constructor
   1.924 +	{
   1.925 +    TBuf<0x20> buf(_S("Paddington Station"));
   1.926 +	TPtr ptr1((TText*)buf.Ptr(),buf.Length(),buf.MaxLength());
   1.927 +	TPtr ptr2(ptr1);
   1.928 +	ptr2[11]='B';
   1.929 +	ptr2[12]='e';
   1.930 +	ptr2[13]='a';
   1.931 +	ptr2[14]='r';
   1.932 +	ptr2[15]=' ';
   1.933 +	ptr1.SetLength(15);
   1.934 +	ptr2.Append(_L(" acid"));
   1.935 +	ptr1.__DbgTestInvariant();
   1.936 +	ptr2.__DbgTestInvariant();
   1.937 +	test(ptr1==_L("Paddington Bear"));
   1.938 +	test(ptr2==_L("Paddington Bear on acid"));
   1.939 +	}
   1.940 +
   1.941 +template<class T, class S, class L, class R>
   1.942 +GLDEF_C void TestTDes<T,S,L,R>::test_TPtrC()
   1.943 +//
   1.944 +// Test the TDesC class special member functions
   1.945 +//
   1.946 +	{
   1.947 +
   1.948 + 	test.Start(_L("Invariant for null pointer descriptor"));
   1.949 + 	TestP();
   1.950 +	test.Next(_L("R/O view over constant string"));
   1.951 +	Test1();
   1.952 +	test.Next(_L("R/O view over constant descriptor"));
   1.953 +	Test2();
   1.954 +	test.Next(_L("R/O view over constant buffer with length"));
   1.955 +	Test3();
   1.956 +	}
   1.957 +
   1.958 +template<class T, class S, class L, class R>
   1.959 +GLDEF_C void TestTDes<T,S,L,R>::test_TPtr()
   1.960 +//
   1.961 +//	Test the TPtr class special member functions
   1.962 +//
   1.963 +	{
   1.964 +
   1.965 + 	test.Start(_L("Invariant for null pointer descriptor"));
   1.966 + 	TestP();
   1.967 +	test.Next(_L("R/W view over buffer with length & maxlength"));
   1.968 +	Test4();
   1.969 +	test.Next(_L("R/W view over buffer with maxlength"));
   1.970 +	Test5();
   1.971 +//	Skipped the following test because Colly hasn't
   1.972 +//	written the templates yet for the TBufC8 & 16 classes
   1.973 +//	test.Next(_L("R/W view over LcbBase with maxlength"));
   1.974 +//	Test6();
   1.975 +	test.Next(_L("String assignment"));
   1.976 +	TestA();
   1.977 +	test.Next(_L("DesW assignment"));
   1.978 +	TestB();
   1.979 +	test.Next(_L("DesC assignment"));
   1.980 +	TestC();
   1.981 +	}
   1.982 +
   1.983 +template<class T, class S, class L, class R>
   1.984 +GLDEF_C void TestTDes<T,S,L,R>::test_TBuf()
   1.985 +//
   1.986 +// Test the TBuf class special member functions
   1.987 +//
   1.988 +	{
   1.989 +
   1.990 +	test.Start(_L("TBuf default view, no params"));
   1.991 +	Test7();
   1.992 +	test.Next(_L("TBuf view with a length"));
   1.993 +	Test8();
   1.994 +	test.Next(_L("TBuf view over a string"));
   1.995 +	Test9();
   1.996 +	test.Next(_L("TBuf view over a descriptor"));
   1.997 +	Test10();
   1.998 +	test.Next(_L("TBuf view over a buffer"));
   1.999 +	Test11();
  1.1000 +	test.Next(_L("String assignment"));
  1.1001 +	TestD();
  1.1002 +	test.Next(_L("Descriptor assignment"));
  1.1003 +	TestE();
  1.1004 +	test.Next(_L("Buffer assignment"));
  1.1005 +	TestF();
  1.1006 +	}
  1.1007 +
  1.1008 +template<class T,class S,class L,class R>
  1.1009 +GLDEF_C void TestTDes<T,S,L,R>::test_TBufC()
  1.1010 +//
  1.1011 +// Test the TBufC class methods
  1.1012 +//
  1.1013 +	{
  1.1014 +
  1.1015 +	test.Start(_L("Default constructor"));
  1.1016 +	Test12();
  1.1017 +	test.Next(_L("With a string"));
  1.1018 +	Test13();
  1.1019 +	test.Next(_L("With a Descriptor (TPtrC)"));
  1.1020 +	Test14();
  1.1021 +	test.Next(_L("With a TBufC"));
  1.1022 +	Test15();
  1.1023 +	test.Next(_L("String assignment"));
  1.1024 +	TestG();
  1.1025 +	test.Next(_L("Descriptor assignment (TPtrC)"));
  1.1026 +	TestH();
  1.1027 +	test.Next(_L("TBufC assignment"));
  1.1028 +	TestI();
  1.1029 +	}
  1.1030 +
  1.1031 +template<class T,class S,class L,class R>
  1.1032 +GLDEF_C void TestTDes<T,S,L,R>::test_HBufC()
  1.1033 +//
  1.1034 +//	Test the HBufC class methods.
  1.1035 +//
  1.1036 +	{
  1.1037 +
  1.1038 +	test.Start(_L("New"));
  1.1039 +	Test16();
  1.1040 +	test.Next(_L("NewL - forcing a leave"));
  1.1041 +	Test17();
  1.1042 +	test.Next(_L("NewL - showing success"));
  1.1043 +	Test18();
  1.1044 +	test.Next(_L("String assignment"));
  1.1045 +	TestJ();
  1.1046 +	test.Next(_L("Descriptor assignment"));
  1.1047 +	TestK();
  1.1048 +	test.Next(_L("HBufC assignment"));
  1.1049 +	TestL();
  1.1050 +	test.Next(_L("ReAlloc"));
  1.1051 +	TestM();
  1.1052 +	test.Next(_L("ReAllocL - forcing a leave"));
  1.1053 +	TestN();
  1.1054 +	test.Next(_L("ReAllocL - showing success"));
  1.1055 +	TestO();
  1.1056 +	}
  1.1057 +
  1.1058 +template<class T,class S,class L,class R>
  1.1059 +GLDEF_C void TestTDes<T,S,L,R>::test_TBufReturningModifiable()
  1.1060 +	{
  1.1061 +	T a;
  1.1062 +	R b(0,0);
  1.1063 +	a.Copy(_TL("abcdefg"));
  1.1064 +	test_TDesReturningModifiable(a,b);
  1.1065 +	}
  1.1066 +
  1.1067 +template<class T,class S,class L,class R>
  1.1068 +GLDEF_C void TestTDes<T,S,L,R>::test_TPtrReturningModifiable()
  1.1069 +	{
  1.1070 +	S* aBuf;
  1.1071 +	aBuf=_TL("abcdefg");
  1.1072 +	T a(aBuf,7,7);
  1.1073 +	R b(0,0);
  1.1074 +	test_TDesReturningModifiable(a,b);
  1.1075 +	}
  1.1076 +
  1.1077 +template<class T,class S,class L,class R>
  1.1078 +GLDEF_C void TestTDes<T,S,L,R>::test_TDesReturningModifiable(const T& a, R& b)
  1.1079 +	{
  1.1080 +	test.Start(_L("Test TDes derived objects that return TPtrs"));
  1.1081 +
  1.1082 +	test.Next(_L("LeftTPtr"));
  1.1083 +	b.Set(a.LeftTPtr(3));
  1.1084 +	b.__DbgTestInvariant();
  1.1085 +	test(b == a.Left(3));
  1.1086 +
  1.1087 +	b.Set(a.LeftTPtr(0));
  1.1088 +	b.__DbgTestInvariant();
  1.1089 +	test(b == a.Left(0));
  1.1090 +
  1.1091 +	b.Set(a.LeftTPtr(7));
  1.1092 +	b.__DbgTestInvariant();
  1.1093 +	test(b == a.Left(7));
  1.1094 +
  1.1095 +	b = a.LeftTPtr(42);
  1.1096 +	b.__DbgTestInvariant();
  1.1097 +	test(b == a.Left(7));
  1.1098 +
  1.1099 +	test.Next(_L("RightTPtr"));
  1.1100 +	b.Set(a.RightTPtr(5));
  1.1101 +	b.__DbgTestInvariant();
  1.1102 +	test(b == a.Right(5));
  1.1103 +
  1.1104 +	b.Set(a.RightTPtr(7));
  1.1105 +	b.__DbgTestInvariant();
  1.1106 +	test(b == a.Right(7));
  1.1107 +
  1.1108 +	b.Set(a.RightTPtr(0));
  1.1109 +	b.__DbgTestInvariant();
  1.1110 +	test(b == a.Right(0));
  1.1111 +
  1.1112 +	b.Set(a.RightTPtr(42));
  1.1113 +	b.__DbgTestInvariant();
  1.1114 +	test(b == a.Right(42));
  1.1115 +
  1.1116 +	test.Next(_L("MidTPtr"));
  1.1117 +	b.Set(a.MidTPtr(5));
  1.1118 +	b.__DbgTestInvariant();
  1.1119 +	test(b == a.Mid(5));
  1.1120 +
  1.1121 +	b.Set(a.MidTPtr(7));
  1.1122 +	b.__DbgTestInvariant();
  1.1123 +	test(b == a.Mid(7));
  1.1124 +
  1.1125 +	b.Set(a.MidTPtr(0));
  1.1126 +	b.__DbgTestInvariant();
  1.1127 +	test(b == a.Mid(0));
  1.1128 +
  1.1129 +	test.Next(_L("MidTPtr (2 parms)"));
  1.1130 +	b.Set(a.MidTPtr(4,3));
  1.1131 +	b.__DbgTestInvariant();
  1.1132 +	test(b == a.Mid(4,3));
  1.1133 +	test(b == a.Mid(4));
  1.1134 +
  1.1135 +	b.Set(a.MidTPtr(0,0));
  1.1136 +	b.__DbgTestInvariant();
  1.1137 +	test(b == a.Mid(0,0));
  1.1138 +
  1.1139 +	b.Set(a.MidTPtr(3,2));
  1.1140 +	b.__DbgTestInvariant();
  1.1141 +	test(b == a.Mid(3,2));
  1.1142 +
  1.1143 +	b.Set(a.MidTPtr(7,0));
  1.1144 +	b.__DbgTestInvariant();
  1.1145 +	test(b == a.Mid(7,0));
  1.1146 +	}
  1.1147 +
  1.1148 +LOCAL_C void testAssignTPtr()
  1.1149 +//
  1.1150 +// Test assigning TPtr's.
  1.1151 +//
  1.1152 +	{
  1.1153 +
  1.1154 +	TBufC<0x20> x(_S("Hello"));
  1.1155 +	TPtr p=x.Des();
  1.1156 +	p+=_L(" World");
  1.1157 +	test(p==_L("Hello World"));
  1.1158 +	test(x==_L("Hello World"));
  1.1159 +	p.SetLength(5);
  1.1160 +	test(p==_L("Hello"));
  1.1161 +	test(x==_L("Hello"));
  1.1162 +	TBufC<0x20> y(_S("ByeBye"));
  1.1163 +	TPtr q=y.Des();
  1.1164 +	q.Set(p);
  1.1165 +	test(q==p);
  1.1166 +	q+=_L(" World");
  1.1167 +	test(q==_L("Hello World"));
  1.1168 +	test(x==_L("Hello World"));
  1.1169 +	test(y==_L("ByeBye"));
  1.1170 +	q.Set((TText*)x.Ptr(),x.Length(),x.Des().MaxLength());
  1.1171 +	test(q==_L("Hello World"));
  1.1172 +	test(q.MaxLength()==0x20);
  1.1173 +	q.SetLength(1);
  1.1174 +	test(q==_L("H"));
  1.1175 +	test(x==_L("Hello World"));
  1.1176 +	}
  1.1177 +
  1.1178 +LOCAL_C void testTPtrLocateReverse()
  1.1179 +//
  1.1180 +// Test locating in reverse on an empty TPtr
  1.1181 +//
  1.1182 +	{
  1.1183 +
  1.1184 +	TPtrC a;
  1.1185 +	test(a.LocateReverse('0')==KErrNotFound);
  1.1186 +	test(a.LocateReverseF('0')==KErrNotFound);
  1.1187 +	}
  1.1188 +
  1.1189 +_LIT8(KLitTest1_8,"1");
  1.1190 +_LIT8(KLitTest12_8,"12");
  1.1191 +_LIT8(KLitTest123_8,"123");
  1.1192 +_LIT8(KLitTest1234_8,"1234");
  1.1193 +_LIT8(KLitTestalpha_8,"abcdefghijklmnopqrstuvwxyz");
  1.1194 +
  1.1195 +LOCAL_C const TDesC8& testByRef8(TRefByValue<const TDesC8> aRef)
  1.1196 +	{
  1.1197 +	return aRef;
  1.1198 +	}
  1.1199 +
  1.1200 +LOCAL_C void testTLitC8()
  1.1201 +	{
  1.1202 +	test.Start(_L("All members"));
  1.1203 +	test (_L8("")==KNullDesC8);			// operator const TDesC8&
  1.1204 +	test (KNullDesC8()==TPtrC8());		// operator()
  1.1205 +	const TDesC8* pNull=&KNullDesC8;	// operator&
  1.1206 +	test (pNull->Compare(_L8(""))==0);
  1.1207 +	test (&testByRef8(KNullDesC8)==&KNullDesC8);	// operator const TRefByValue<const TDesC8>
  1.1208 +//
  1.1209 +	test.Next(_L("Literal values"));
  1.1210 +	const TDesC8& t1=KLitTest1_8;
  1.1211 +	test (t1.Length()==1);
  1.1212 +	test (t1[0]=='1');
  1.1213 +	test (t1==_L8("1"));
  1.1214 +	const TDesC8& t12=KLitTest12_8;
  1.1215 +	test (t12.Length()==2);
  1.1216 +	test (t12[0]=='1');
  1.1217 +	test (t12==_L8("12"));
  1.1218 +	const TDesC8& t123=KLitTest123_8;
  1.1219 +	test (t123.Length()==3);
  1.1220 +	test (t123[0]=='1');
  1.1221 +	test (t123==_L8("123"));
  1.1222 +	const TDesC8& t1234=KLitTest1234_8;
  1.1223 +	test (t1234.Length()==4);
  1.1224 +	test (t1234[0]=='1');
  1.1225 +	test (t1234==_L8("1234"));
  1.1226 +	const TDesC8& talpha=KLitTestalpha_8;
  1.1227 +	test (talpha.Length()==26);
  1.1228 +	test (talpha[0]=='a');
  1.1229 +	test (talpha==_L8("abcdefghijklmnopqrstuvwxyz"));
  1.1230 +//
  1.1231 +	test.End();
  1.1232 +	}
  1.1233 +
  1.1234 +_LIT16(KLitTest1_16,"1");
  1.1235 +_LIT16(KLitTest12_16,"12");
  1.1236 +_LIT16(KLitTest123_16,"123");
  1.1237 +_LIT16(KLitTest1234_16,"1234");
  1.1238 +_LIT16(KLitTestalpha_16,"abcdefghijklmnopqrstuvwxyz");
  1.1239 +
  1.1240 +LOCAL_C const TDesC16& testByRef16(TRefByValue<const TDesC16> aRef)
  1.1241 +	{
  1.1242 +	return aRef;
  1.1243 +	}
  1.1244 +
  1.1245 +LOCAL_C void testTLitC16()
  1.1246 +	{
  1.1247 +	test.Start(_L("All members"));
  1.1248 +	test (_L16("")==KNullDesC16);			// operator const TDesC16&
  1.1249 +	test (KNullDesC16()==TPtrC16());		// operator()
  1.1250 +	const TDesC16* pNull=&KNullDesC16;	// operator&
  1.1251 +	test (pNull->Compare(_L16(""))==0);
  1.1252 +	test (&testByRef16(KNullDesC16)==&KNullDesC16);	// operator const TRefByValue<const TDesC16>
  1.1253 +//
  1.1254 +	test.Next(_L("Literal values"));
  1.1255 +	const TDesC16& t1=KLitTest1_16;
  1.1256 +	test (t1.Length()==1);
  1.1257 +	test (t1[0]=='1');
  1.1258 +	test (t1==_L16("1"));
  1.1259 +	const TDesC16& t12=KLitTest12_16;
  1.1260 +	test (t12.Length()==2);
  1.1261 +	test (t12[0]=='1');
  1.1262 +	test (t12==_L16("12"));
  1.1263 +	const TDesC16& t123=KLitTest123_16;
  1.1264 +	test (t123.Length()==3);
  1.1265 +	test (t123[0]=='1');
  1.1266 +	test (t123==_L16("123"));
  1.1267 +	const TDesC16& t1234=KLitTest1234_16;
  1.1268 +	test (t1234.Length()==4);
  1.1269 +	test (t1234[0]=='1');
  1.1270 +	test (t1234==_L16("1234"));
  1.1271 +	const TDesC16& talpha=KLitTestalpha_16;
  1.1272 +	test (talpha.Length()==26);
  1.1273 +	test (talpha[0]=='a');
  1.1274 +	test (talpha==_L16("abcdefghijklmnopqrstuvwxyz"));
  1.1275 +//
  1.1276 +	test.End();
  1.1277 +	}
  1.1278 +
  1.1279 +_LIT(KLitTest1,"1");
  1.1280 +_LIT(KLitTest12,"12");
  1.1281 +_LIT(KLitTest123,"123");
  1.1282 +_LIT(KLitTest1234,"1234");
  1.1283 +_LIT(KLitTestalpha,"abcdefghijklmnopqrstuvwxyz");
  1.1284 +
  1.1285 +LOCAL_C const TDesC& testByRef(TRefByValue<const TDesC> aRef)
  1.1286 +	{
  1.1287 +	return aRef;
  1.1288 +	}
  1.1289 +
  1.1290 +LOCAL_C void testTLitC()
  1.1291 +	{
  1.1292 +	test.Start(_L("All members"));
  1.1293 +	test (_L("")==KNullDesC);			// operator const TDesC&
  1.1294 +	test (KNullDesC()==TPtrC());		// operator()
  1.1295 +	const TDesC* pNull=&KNullDesC;	// operator&
  1.1296 +	test (pNull->Compare(_L(""))==0);
  1.1297 +	test (&testByRef(KNullDesC)==&KNullDesC);	// operator const TRefByValue<const TDesC>
  1.1298 +#if defined(_UNICODE)
  1.1299 +	test (_L16("")==KNullDesC);			// operator const TDesC&
  1.1300 +	test (KNullDesC()==TPtrC16());		// operator()
  1.1301 +	const TDesC16* pNull16=&KNullDesC;	// operator&
  1.1302 +	test (pNull16->Compare(_L16(""))==0);
  1.1303 +	test (&testByRef16(KNullDesC)==&KNullDesC);	// operator const TRefByValue<const TDesC>
  1.1304 +#else
  1.1305 +	test (_L8("")==KNullDesC);			// operator const TDesC&
  1.1306 +	test (KNullDesC()==TPtrC8());		// operator()
  1.1307 +	const TDesC8* pNull8=&KNullDesC;	// operator&
  1.1308 +	test (pNull8->Compare(_L8(""))==0);
  1.1309 +	test (&testByRef8(KNullDesC)==&KNullDesC);	// operator const TRefByValue<const TDesC>
  1.1310 +#endif
  1.1311 +//
  1.1312 +	test.Next(_L("Literal values"));
  1.1313 +	const TDesC& t1=KLitTest1;
  1.1314 +	test (t1.Length()==1);
  1.1315 +	test (t1[0]=='1');
  1.1316 +	test (t1==_L("1"));
  1.1317 +	const TDesC& t12=KLitTest12;
  1.1318 +	test (t12.Length()==2);
  1.1319 +	test (t12[0]=='1');
  1.1320 +	test (t12==_L("12"));
  1.1321 +	const TDesC& t123=KLitTest123;
  1.1322 +	test (t123.Length()==3);
  1.1323 +	test (t123[0]=='1');
  1.1324 +	test (t123==_L("123"));
  1.1325 +	const TDesC& t1234=KLitTest1234;
  1.1326 +	test (t1234.Length()==4);
  1.1327 +	test (t1234[0]=='1');
  1.1328 +	test (t1234==_L("1234"));
  1.1329 +	const TDesC& talpha=KLitTestalpha;
  1.1330 +	test (talpha.Length()==26);
  1.1331 +	test (talpha[0]=='a');
  1.1332 +	test (talpha==_L("abcdefghijklmnopqrstuvwxyz"));
  1.1333 +//
  1.1334 +	test.End();
  1.1335 +	}
  1.1336 +
  1.1337 +LOCAL_C void testLiteral()
  1.1338 +	{
  1.1339 +	test.Next(_L("class TLitC8"));
  1.1340 +	testTLitC8();
  1.1341 +	test.Next(_L("class TLitC16"));
  1.1342 +	testTLitC16();
  1.1343 +	test.Next(_L("class TLitC"));
  1.1344 +	testTLitC();
  1.1345 +	}
  1.1346 +
  1.1347 +/**
  1.1348 +@SYMTestCaseID          TI18N-TDESC-CIT-4012
  1.1349 +@SYMTestCaseDesc        Check surrogate function  
  1.1350 +@SYMTestPriority        High
  1.1351 +@SYMTestActions         Test Match, Locate,  FindCorruptSurrogate, Match2
  1.1352 +@SYMTestExpectedResults It works as function specifies
  1.1353 +@SYMREQ                 REQ12064, REQ12065
  1.1354 +*/
  1.1355 +
  1.1356 +LOCAL_C void testSurrogateAwareInterfaces()
  1.1357 +	{
  1.1358 +	test.Next(_L("new TDesC interfaces"));
  1.1359 +	}
  1.1360 +
  1.1361 +
  1.1362 +#ifndef _DEBUG
  1.1363 +#pragma warning (disable: 4702)// Unreachable code
  1.1364 +#pragma warning (disable: 4701)// Local variable used without being initialized
  1.1365 +#pragma warning (disable: 4710)// Function not expanded
  1.1366 +#endif
  1.1367 +
  1.1368 +GLDEF_C TInt E32Main()
  1.1369 +//
  1.1370 +// Test the TDes type.
  1.1371 +//
  1.1372 +    {
  1.1373 +	test.Title();
  1.1374 +//
  1.1375 +	TInt startAvail,temp;
  1.1376 +	startAvail=User::Available(temp);
  1.1377 +//
  1.1378 +	test.Start(_L("Assigning TPtr's"));
  1.1379 +	testAssignTPtr();
  1.1380 +//
  1.1381 +	test.Next(_L("Locate reverse on empty TPtr"));
  1.1382 +	testTPtrLocateReverse();
  1.1383 +//
  1.1384 +	test.Next(_L("class TBuf<0x40>"));
  1.1385 +	TestTDes<TBuf<0x40>,TText,TUint, TPtrC> jj;
  1.1386 +	jj.test_TBuf();
  1.1387 +	jj.testHeapSpace(startAvail);
  1.1388 +	test.End();
  1.1389 +//
  1.1390 +	test.Next(_L("class TBuf8<0x40>"));
  1.1391 +	TestTDes<TBuf8<0x40>,TUint8,TUint8, TPtrC8> ii;
  1.1392 +	ii.test_TBuf();
  1.1393 +	ii.testHeapSpace(startAvail);
  1.1394 +	test.End();
  1.1395 +//
  1.1396 +	test.Next(_L("class TBuf16<0x40>"));
  1.1397 +	TestTDes<TBuf16<0x40>,TUint16,TUint16, TPtrC16> hh;
  1.1398 +	hh.test_TBuf();
  1.1399 +	hh.testHeapSpace(startAvail);
  1.1400 +	test.End();	
  1.1401 +//
  1.1402 +	test.Next(_L("class TPtrC"));
  1.1403 +	TestTDes<TPtrC,TText,TUint, TPtrC> dd;
  1.1404 +	dd.test_TPtrC();
  1.1405 +	dd.testHeapSpace(startAvail);
  1.1406 +	test.End();
  1.1407 +//
  1.1408 +	test.Next(_L("class TPtrC8"));
  1.1409 +	TestTDes<TPtrC8,TUint8,TUint8, TPtrC8> cc;
  1.1410 +	cc.test_TPtrC();
  1.1411 +	cc.testHeapSpace(startAvail);
  1.1412 +	test.End();
  1.1413 +//
  1.1414 +	test.Next(_L("class TPtrC16"));
  1.1415 +	TestTDes<TPtrC16,TUint16,TUint16, TPtrC16> bb;
  1.1416 +	bb.test_TPtrC();
  1.1417 +	bb.testHeapSpace(startAvail);
  1.1418 +	test.End();
  1.1419 +//
  1.1420 +	test.Next(_L("class TPtr"));
  1.1421 +	TestTDes<TPtr,TText,TUint, TPtrC> gg;
  1.1422 +	gg.test_TPtr();
  1.1423 +	gg.testHeapSpace(startAvail);
  1.1424 +	test.Next(_L("Copy constructor"));
  1.1425 +	TestCopy();
  1.1426 +	test.End();	
  1.1427 +//
  1.1428 +	test.Next(_L("class TPtr8"));
  1.1429 +	TestTDes<TPtr8,TUint8,TUint8, TPtrC8> ff;
  1.1430 +	ff.test_TPtr();
  1.1431 +	ff.testHeapSpace(startAvail);
  1.1432 +	test.Next(_L("Copy constructor"));
  1.1433 +	TestCopy8();
  1.1434 +	test.End();	
  1.1435 +//
  1.1436 +	test.Next(_L("class TPtr16"));
  1.1437 +	TestTDes<TPtr16,TUint16,TUint16, TPtrC16> ee;
  1.1438 +	ee.test_TPtr();
  1.1439 +	ee.testHeapSpace(startAvail);
  1.1440 +	test.Next(_L("Copy constructor"));
  1.1441 +	TestCopy16();
  1.1442 +	test.End();	
  1.1443 +//
  1.1444 +	test.Next(_L("class TBufC"));
  1.1445 +	TestTDes<TBufC<0x40>, TText, TUint16, TPtrC> kk;
  1.1446 +	kk.test_TBufC();
  1.1447 +	kk.testHeapSpace(startAvail);
  1.1448 +	test.End();
  1.1449 +//
  1.1450 +	test.Next(_L("class TBufC8"));
  1.1451 +	TestTDes<TBufC8<0x40>, TUint8, TUint8, TPtrC8> ll;
  1.1452 +	ll.test_TBufC();
  1.1453 +	ll.testHeapSpace(startAvail);
  1.1454 +	test.End();
  1.1455 +//
  1.1456 +	test.Next(_L("class TBufC16"));
  1.1457 +	TestTDes<TBufC16<0x40>, TUint16, TUint16, TPtrC16> mm;
  1.1458 +	mm.test_TBufC();
  1.1459 +	mm.testHeapSpace(startAvail);
  1.1460 +	test.End();
  1.1461 +//
  1.1462 +	test.Next(_L("class HBufC"));
  1.1463 +	TestTDes<HBufC, TText, TUint, TPtrC>  nn;
  1.1464 +	nn.test_HBufC();
  1.1465 +	nn.testHeapSpace(startAvail);
  1.1466 +	test.End();
  1.1467 +//
  1.1468 +	test.Next(_L("class HBufC8"));
  1.1469 +	TestTDes<HBufC8, TUint8, TUint8, TPtrC8>  oo;
  1.1470 +	oo.test_HBufC();
  1.1471 +	oo.testHeapSpace(startAvail);
  1.1472 +	test.End();
  1.1473 +
  1.1474 +	test.Next(_L("Test Unicode to Ascii stuff"));
  1.1475 +	Test16To8();
  1.1476 +//
  1.1477 +	test.Next(_L("class HBufC16"));
  1.1478 +	TestTDes<HBufC16, TUint16, TUint16, TPtrC16>  pp;
  1.1479 +	pp.test_HBufC();
  1.1480 +	pp.testHeapSpace(startAvail);
  1.1481 +	test.End();
  1.1482 +//
  1.1483 +	testLiteral();
  1.1484 +//
  1.1485 +	test.Next(_L("class TBuf returning TPtr"));
  1.1486 +	TestTDes<TBuf<0x40>, TText, TUint, TPtr> qq;
  1.1487 +	qq.test_TBufReturningModifiable();
  1.1488 +	test.End();
  1.1489 +
  1.1490 +	test.Next(_L("class TBuf8 returning TPtr8"));
  1.1491 +	TestTDes<TBuf8<0x40>, TText8, TUint8, TPtr8> rr;
  1.1492 +	rr.test_TBufReturningModifiable();
  1.1493 +	test.End();
  1.1494 +
  1.1495 +	test.Next(_L("class TBuf16 returning TPtr16"));
  1.1496 +	TestTDes<TBuf16<0x40>, TText16, TUint16, TPtr16> ss;
  1.1497 +	ss.test_TBufReturningModifiable();
  1.1498 +	test.End();
  1.1499 +
  1.1500 +	test.Next(_L("class TPtr returning TPtr"));
  1.1501 +	TestTDes<TPtr, TText, TUint, TPtr> tt;
  1.1502 +	tt.test_TPtrReturningModifiable();
  1.1503 +	test.End();
  1.1504 +
  1.1505 +	test.Next(_L("class TPtr8 returning TPtr8"));
  1.1506 +	TestTDes<TPtr8, TText8, TUint8, TPtr8> uu;
  1.1507 +	uu.test_TPtrReturningModifiable();
  1.1508 +	test.End();
  1.1509 +
  1.1510 +	test.Next(_L("class TPtr16 returning TPtr16"));
  1.1511 +	TestTDes<TPtr16, TText16, TUint16, TPtr16> vv;
  1.1512 +	vv.test_TPtrReturningModifiable();
  1.1513 +	test.End();
  1.1514 +
  1.1515 +	testSurrogateAwareInterfaces();
  1.1516 +	test.End();
  1.1517 +
  1.1518 +	return(KErrNone);
  1.1519 +    }
  1.1520 +#pragma warning (default: 4702)// Unreachable code
  1.1521 +#pragma warning (default: 4701)// Local variable used without being initialized
  1.1522 +#pragma warning (default: 4710)// Function not expanded
  1.1523 +
  1.1524 +