LbsApi/src/requestorclassesstep.cpp
branchSymbian3
changeset 54 a4835904093b
equal deleted inserted replaced
53:7f293ed715ec 54:a4835904093b
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Example CTestStep derived implementation
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file RequestorClassesStep.cpp
       
    20  @internalTechnology
       
    21 */
       
    22 #include "requestorclassesstep.h"
       
    23 #include "te_lbsapisuitedefs.h"
       
    24 
       
    25 #include "lcfsbucommondefinitions.h"
       
    26 
       
    27 #include <lbs.h>
       
    28 #include <lbssatellite.h>
       
    29 
       
    30 #include <s32mem.h>
       
    31 
       
    32 CRequestorClassesStep::~CRequestorClassesStep()
       
    33 /**
       
    34  * Destructor
       
    35  */
       
    36 	{
       
    37 	}
       
    38 
       
    39 CRequestorClassesStep::CRequestorClassesStep()
       
    40 /**
       
    41  * Constructor
       
    42  */
       
    43 	{
       
    44 	// **MUST** call SetTestStepName in the constructor as the controlling
       
    45 	// framework uses the test step name immediately following construction to set
       
    46 	// up the step's unique logging ID.
       
    47 	SetTestStepName(KRequestorClassesStep);
       
    48 	}
       
    49 
       
    50 TVerdict CRequestorClassesStep::doTestStepPreambleL()
       
    51 /**
       
    52  * @return - TVerdict code
       
    53  * Override of base class virtual
       
    54  */
       
    55 	{
       
    56 	 CTe_LbsApiSuiteStepBase::doTestStepPreambleL();
       
    57 	 if (TestStepResult()!=EPass)
       
    58 	    return   TestStepResult();
       
    59 	// process some pre setting to this test step then set SetTestStepResult to EFail or Epass.
       
    60 	SetTestStepResult(EPass);
       
    61 	return TestStepResult();
       
    62 	}
       
    63 
       
    64 
       
    65 TVerdict CRequestorClassesStep::doTestStepL()
       
    66 /**
       
    67  * @return - TVerdict code
       
    68  * Override of base class pure virtual
       
    69  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    70  * not leave. That being the case, the current test result value will be EPass.
       
    71  */
       
    72 	{
       
    73 	if (TestStepResult()==EPass)
       
    74 		{
       
    75 		TInt test;
       
    76 		if(!GetIntFromConfig(ConfigSection(),KTe_LbsApiSuiteInt,test)
       
    77 			)
       
    78 			{
       
    79 			// Leave if there's any error.
       
    80 			User::Leave(KErrNotFound);
       
    81 			}
       
    82 		SetTestStepResult(EPass);
       
    83 		StartL(test);
       
    84 		}
       
    85 	return TestStepResult();
       
    86 	}
       
    87 
       
    88 
       
    89 
       
    90 TVerdict CRequestorClassesStep::doTestStepPostambleL()
       
    91 /**
       
    92  * @return - TVerdict code
       
    93  * Override of base class virtual
       
    94  */
       
    95 	{
       
    96 	// process something post setting to the test step
       
    97 	// uncomment the following line if you have common post setting to all the test steps in there
       
    98 	// CTe_LbsApiSuiteStepBase::doTestStepPostambleL();
       
    99 	// uncomment the following line if you have post process or remove the following line if no post process
       
   100 	// SetTestStepResult(EPass);		// or EFail
       
   101 	return TestStepResult();
       
   102 	}
       
   103 
       
   104 
       
   105 void CRequestorClassesStep::StartL (TInt aIndex)
       
   106 	{
       
   107 	switch (aIndex)
       
   108 		{
       
   109 	case 0:
       
   110 		RRequestorStack_StreamingL ();
       
   111 		break;
       
   112 	case 1:
       
   113 		RRequestorStack_Streaming2L ();
       
   114 		break;
       
   115 	case 2:
       
   116 		CRequestor_ConstructionL ();
       
   117 		break;
       
   118 	case 3:
       
   119 		CRequestor_SetL ();
       
   120 		break;
       
   121 	case 4:
       
   122 		CRequestor_Construction2L ();
       
   123 		break;
       
   124 	case 5:
       
   125 		CRequestor_StreamingL ();
       
   126 		break;
       
   127 	case 6:
       
   128 		CRequestor_Streaming2L ();
       
   129 		break;
       
   130 	default:
       
   131 		break;
       
   132 		}
       
   133 	}
       
   134 
       
   135 
       
   136 //
       
   137 //
       
   138 // RRequestorStack
       
   139 //
       
   140 //
       
   141 
       
   142 void ResetAndDestroyRequestorStack(TAny* aArray)
       
   143     {
       
   144     RRequestorStack* stack = static_cast<RRequestorStack*>(aArray);
       
   145     stack->ResetAndDestroy();
       
   146     }
       
   147 
       
   148 // 8.1.1. Streaming
       
   149 void CRequestorClassesStep::RRequestorStack_StreamingL()
       
   150 	{
       
   151     DECLARE_ERROR_LOGGING;
       
   152     StandardPrepareL();
       
   153 
       
   154     RRequestorStack requestorStack;
       
   155     CleanupStack::PushL(TCleanupItem(ResetAndDestroyRequestorStack, &requestorStack));
       
   156 
       
   157     _LIT(KDummyLit1, "Hello");
       
   158     const CRequestor::TRequestorType KDummyRequestorType1(CRequestor::ERequestorService);
       
   159     const CRequestor::TRequestorFormat KDummyRequestorFormat1(CRequestor::EFormatTelephone);
       
   160 
       
   161     CRequestor* requestor = CRequestor::NewLC(KDummyRequestorType1, KDummyRequestorFormat1, KDummyLit1);
       
   162     User::LeaveIfError(requestorStack.Append(requestor));        //take ownership of requestor
       
   163     CleanupStack::Pop(requestor);
       
   164     requestor = NULL;        //Just to make it clear we don't one requestor.
       
   165 
       
   166     _LIT(KDummyLit2, "Goodbye");
       
   167     const CRequestor::TRequestorType KDummyRequestorType2(CRequestor::ERequestorContact);
       
   168     const CRequestor::TRequestorFormat KDummyRequestorFormat2(CRequestor::EFormatUrl);
       
   169 
       
   170     requestor = CRequestor::NewLC(KDummyRequestorType2, KDummyRequestorFormat2, KDummyLit2);
       
   171     User::LeaveIfError(requestorStack.Append(requestor));        //take ownership of requestor
       
   172     CleanupStack::Pop(requestor);
       
   173     requestor = NULL;        //Just to make it clear we don't one requestor.
       
   174 
       
   175     //All info in requestorStack. Now stream out and back into a new requestor stack.
       
   176 
       
   177     CBufFlat* buffer = CBufFlat::NewL(512);        //Abritrary size chosen
       
   178     CleanupStack::PushL(buffer);
       
   179     RBufWriteStream writeStream;
       
   180     writeStream.Open(*buffer);
       
   181     writeStream.PushL();
       
   182     // externalize
       
   183     requestorStack.ExternalizeL(writeStream);
       
   184     writeStream.CommitL();
       
   185     writeStream.Pop();
       
   186     //requestorStack now piped into buffer.
       
   187     //get rid of requestorStack.
       
   188     CleanupStack::Pop(buffer);
       
   189     CleanupStack::PopAndDestroy(&requestorStack);
       
   190     CleanupStack::PushL(buffer);
       
   191 
       
   192     RBufReadStream readStream;
       
   193     readStream.Open(*buffer);
       
   194     readStream.PushL();
       
   195 
       
   196     RRequestorStack requestorStack2;
       
   197     CleanupStack::PushL(TCleanupItem(ResetAndDestroyRequestorStack, &requestorStack2));
       
   198     // internalize
       
   199     requestorStack2.InternalizeL(readStream);
       
   200     //requestorStack2 should now be initialised.
       
   201 
       
   202     CHECK_EQUAL_(2, requestorStack2.Count());
       
   203 
       
   204     requestor = requestorStack2[0];
       
   205     CHECK(!TPtrC(KDummyLit1).Compare(requestor->RequestorData()));
       
   206     CHECK_EQUAL_(requestor->RequestorType(), KDummyRequestorType1);
       
   207     CHECK_EQUAL_(requestor->RequestorFormat(), KDummyRequestorFormat1);
       
   208 
       
   209     requestor = requestorStack2[1];
       
   210     CHECK(!TPtrC(KDummyLit2).Compare(requestor->RequestorData()));
       
   211     CHECK_EQUAL_(requestor->RequestorType(), KDummyRequestorType2);
       
   212     CHECK_EQUAL_(requestor->RequestorFormat(), KDummyRequestorFormat2);
       
   213 
       
   214     CleanupStack::PopAndDestroy(3, buffer);
       
   215 
       
   216     StandardCleanup();
       
   217 	}
       
   218 
       
   219 
       
   220 // 8.1.2. Streaming with invalid stream
       
   221 TInt RRequestorStack_Streaming_Invalid(TAny* /*aPtr*/)
       
   222 	{
       
   223     RBufReadStream readStream;
       
   224 
       
   225     // buffer
       
   226         CBufFlat* buffer = CBufFlat::NewL(512);        //Arbitrary size chosen
       
   227     RBufWriteStream writeStream; // make sure it is empty
       
   228     writeStream.Open(*buffer);
       
   229     writeStream.WriteUint16L(12345); // put dummy value there (different from KRequestorStackVersion)
       
   230     writeStream.Close();
       
   231     writeStream.Release();
       
   232 
       
   233     // read-stream
       
   234     readStream.Open(*buffer);
       
   235 
       
   236     TInt err;
       
   237     TRAP(err,
       
   238         // internalize it
       
   239         RRequestorStack requestorStack2;
       
   240         CleanupStack::PushL(TCleanupItem(ResetAndDestroyRequestorStack, &requestorStack2));
       
   241 
       
   242         requestorStack2.InternalizeL(readStream);   //This should panic
       
   243 
       
   244         CleanupStack::Pop();
       
   245     	);
       
   246 
       
   247     readStream.Release();
       
   248     delete buffer;
       
   249 
       
   250     return KErrGeneral;
       
   251 	}
       
   252 
       
   253 
       
   254 void CRequestorClassesStep::RRequestorStack_Streaming2L()
       
   255 	{
       
   256     DECLARE_ERROR_LOGGING;
       
   257     StandardPrepareL();
       
   258 
       
   259     // attempt to internalize from invalid stream
       
   260     DO_PANIC_TEST_L(
       
   261         RRequestorStack_Streaming_Invalid,
       
   262         KPosClientFault,
       
   263         EPositionInvalidClassType,
       
   264         KDefaultTestTimeout);
       
   265 
       
   266     StandardCleanup();
       
   267 	}
       
   268 
       
   269 
       
   270 // 8.1.3. Streaming with No Memory
       
   271 // See NoMemoryTests.cpp
       
   272 
       
   273 //
       
   274 //
       
   275 // CRequestor
       
   276 //
       
   277 //
       
   278 
       
   279 // 8.2.1. Construction
       
   280 void CRequestorClassesStep::CRequestor_ConstructionL()
       
   281 	{
       
   282     DECLARE_ERROR_LOGGING;
       
   283     StandardPrepareL();
       
   284 
       
   285     _LIT(KDummyLit, "Hello");
       
   286     const CRequestor::TRequestorType KDummyRequestorType(CRequestor::ERequestorService);
       
   287     const CRequestor::TRequestorFormat KDummyRequestorFormat(CRequestor::EFormatTelephone);
       
   288 
       
   289     CRequestor* requestor = NULL;
       
   290 
       
   291     requestor = CRequestor::NewL(KDummyRequestorType, KDummyRequestorFormat, KDummyLit);
       
   292     CHECK(requestor->RequestorData().Compare(KDummyLit) == 0);
       
   293     CHECK(requestor->RequestorType()   == KDummyRequestorType);
       
   294     CHECK(requestor->RequestorFormat() == KDummyRequestorFormat);
       
   295     delete requestor;
       
   296 
       
   297     requestor = CRequestor::NewLC(KDummyRequestorType, KDummyRequestorFormat, KDummyLit);
       
   298     CHECK(requestor->RequestorData().Compare(KDummyLit) == 0);
       
   299     CHECK(requestor->RequestorType()   == KDummyRequestorType);
       
   300     CHECK(requestor->RequestorFormat() == KDummyRequestorFormat);
       
   301     CleanupStack::PopAndDestroy(requestor);
       
   302 
       
   303     requestor = static_cast<CRequestor*>( User::LeaveIfNull(CRequestor::New(KDummyRequestorType, KDummyRequestorFormat, KDummyLit)));
       
   304     CHECK(requestor->RequestorData().Compare(KDummyLit) == 0);
       
   305     CHECK(requestor->RequestorType()   == KDummyRequestorType);
       
   306     CHECK(requestor->RequestorFormat() == KDummyRequestorFormat);
       
   307     delete requestor;
       
   308 
       
   309     StandardCleanup();
       
   310 	}
       
   311 
       
   312 
       
   313 // 8.2.2. Setters and Getters
       
   314 void CRequestorClassesStep::CRequestor_SetL()
       
   315 	{
       
   316     DECLARE_ERROR_LOGGING;
       
   317     StandardPrepareL();
       
   318 
       
   319     // Get
       
   320     _LIT(KDummyLit, "Hello");
       
   321     const CRequestor::TRequestorType KDummyRequestorType(CRequestor::ERequestorService);
       
   322     const CRequestor::TRequestorFormat KDummyRequestorFormat(CRequestor::EFormatTelephone);
       
   323     CRequestor* requestor = CRequestor::NewL(KDummyRequestorType, KDummyRequestorFormat, KDummyLit);
       
   324     CleanupStack::PushL(requestor);
       
   325 
       
   326     TPtrC ptr;
       
   327     CRequestor::TRequestorType requestorType;
       
   328     CRequestor::TRequestorFormat requestorFormat;
       
   329 
       
   330     requestor->GetRequestor(requestorType, requestorFormat, ptr);
       
   331 
       
   332     CHECK(ptr.Compare(KDummyLit)    == 0);
       
   333     CHECK(requestorType             == KDummyRequestorType);
       
   334     CHECK(requestorFormat           == KDummyRequestorFormat);
       
   335 
       
   336     // Set
       
   337     _LIT(KNewDummyLit, "Goodbye");
       
   338     const CRequestor::TRequestorType KNewDummyRequestorType(CRequestor::ERequestorContact);
       
   339     const CRequestor::TRequestorFormat KNewDummyRequestorFormat(CRequestor::EFormatUrl);
       
   340     requestor->SetRequestorL(KNewDummyRequestorType, KNewDummyRequestorFormat, KNewDummyLit);
       
   341 
       
   342     // check as properties
       
   343     CHECK(requestor->RequestorData().Compare(KNewDummyLit) == 0);
       
   344     CHECK(requestor->RequestorType()   == KNewDummyRequestorType);
       
   345     CHECK(requestor->RequestorFormat() == KNewDummyRequestorFormat);
       
   346 
       
   347     // check by GetRequestor
       
   348     requestor->GetRequestor(requestorType, requestorFormat, ptr);
       
   349 
       
   350     CHECK(ptr.Compare(KNewDummyLit) == 0);
       
   351     CHECK(requestorType             == KNewDummyRequestorType);
       
   352     CHECK(requestorFormat           == KNewDummyRequestorFormat);
       
   353 
       
   354     CleanupStack::PopAndDestroy();
       
   355 
       
   356     // Now set much longer requestor data, to check if
       
   357     // doesn't matter :-)
       
   358     TBuf<1> shortData;
       
   359     shortData.Append('$');
       
   360     requestor = CRequestor::NewLC(KDummyRequestorType, KDummyRequestorFormat, shortData);
       
   361 
       
   362     TBuf<512> longData;
       
   363     longData.Fill('@', longData.MaxLength());
       
   364     requestor->SetRequestorL(KNewDummyRequestorType, KNewDummyRequestorFormat, longData);
       
   365 
       
   366     // check it
       
   367     CHECK(requestor->RequestorData().Compare(longData) == 0);
       
   368     CHECK(requestor->RequestorType()   == KNewDummyRequestorType);
       
   369     CHECK(requestor->RequestorFormat() == KNewDummyRequestorFormat);
       
   370 
       
   371     // set smaller one again
       
   372     requestor->SetRequestorL(KDummyRequestorType, KDummyRequestorFormat, shortData);
       
   373     CHECK(requestor->RequestorData().Compare(shortData) == 0);
       
   374 
       
   375     CleanupStack::PopAndDestroy();
       
   376 
       
   377     StandardCleanup();
       
   378 	}
       
   379 
       
   380 
       
   381 /*
       
   382 // 8.2.3. Constructors with invalid parameters
       
   383 void CRequestorClassesStep::CRequestor_Construction3L()
       
   384 {
       
   385     // there are no relevant parameters to pass invalid values.
       
   386     // the only one is wrong stream, see 8.3.4 CRequestor_Streaming_Invalid
       
   387 }
       
   388 */
       
   389 
       
   390 // 8.2.4. Constructors with No Memory
       
   391 // See NoMemoryTests.cpp
       
   392 
       
   393 // 8.2.5. SetRequestor with No Memory
       
   394 // See NoMemoryTests.cpp
       
   395 
       
   396 
       
   397 // 8.3.1. Construction from stream
       
   398 void CRequestorClassesStep::CRequestor_Construction2L()
       
   399 	{
       
   400     DECLARE_ERROR_LOGGING;
       
   401     StandardPrepareL();
       
   402 
       
   403     _LIT(KDummyLit, "Hello");
       
   404     const CRequestor::TRequestorType KDummyRequestorType(CRequestor::ERequestorService);
       
   405     const CRequestor::TRequestorFormat KDummyRequestorFormat(CRequestor::EFormatTelephone);
       
   406     CRequestor* requestor1 = CRequestor::NewLC(KDummyRequestorType, KDummyRequestorFormat, KDummyLit);
       
   407 
       
   408     //Make a write stream
       
   409     HBufC8* buffer = HBufC8::NewLC(0x100);        //Should be plenty big enough
       
   410     TPtr8 ptr = buffer->Des();
       
   411     RDesWriteStream writeStream(ptr);        //Opens the write stream
       
   412     CleanupClosePushL(writeStream);
       
   413     requestor1->ExternalizeL(writeStream);
       
   414     writeStream.CommitL();
       
   415     CleanupStack::PopAndDestroy(&writeStream);        //Close the write stream
       
   416 
       
   417     //Make a read stream
       
   418     RDesReadStream readStream(*buffer);
       
   419     CleanupClosePushL(readStream);
       
   420 
       
   421     // construct
       
   422     CRequestor* requestor2 = CRequestor::NewL(readStream);
       
   423 
       
   424     CHECK(!TPtrC(KDummyLit).Compare(requestor2->RequestorData()));
       
   425     CHECK_EQUAL_(requestor2->RequestorType(), KDummyRequestorType);
       
   426     CHECK_EQUAL_(requestor2->RequestorFormat(), KDummyRequestorFormat);
       
   427 
       
   428     delete requestor2;
       
   429     CleanupStack::PopAndDestroy(3, requestor1);        //readStream, buffer, requestor1
       
   430 
       
   431     StandardCleanup();
       
   432 	}
       
   433 
       
   434 
       
   435 // 8.3.2. Externalize/Internalize
       
   436 void CRequestorClassesStep::CRequestor_StreamingL()
       
   437 	{
       
   438     DECLARE_ERROR_LOGGING;
       
   439     StandardPrepareL();
       
   440 
       
   441     _LIT(KDummyLit1, "Hello");
       
   442     const CRequestor::TRequestorType KDummyRequestorType1(CRequestor::ERequestorService);
       
   443     const CRequestor::TRequestorFormat KDummyRequestorFormat1(CRequestor::EFormatTelephone);
       
   444     CRequestor* requestor1 = CRequestor::NewLC(KDummyRequestorType1, KDummyRequestorFormat1, KDummyLit1);
       
   445 
       
   446     // set r2 with other values
       
   447     _LIT(KDummyLit2, "Goodbye");
       
   448     const CRequestor::TRequestorType KDummyRequestorType2(CRequestor::ERequestorContact);
       
   449     const CRequestor::TRequestorFormat KDummyRequestorFormat2(CRequestor::EFormatUrl);
       
   450     CRequestor* requestor2 = CRequestor::NewLC(KDummyRequestorType2, KDummyRequestorFormat2, KDummyLit2);
       
   451 
       
   452     // Make a write stream
       
   453     HBufC8* buffer = HBufC8::NewLC(0x100);        //Should be plenty big enough
       
   454     TPtr8 ptr = buffer->Des();
       
   455     RDesWriteStream writeStream(ptr);        //Opens the write stream
       
   456     CleanupClosePushL(writeStream);
       
   457 
       
   458     // externalize r1
       
   459     writeStream << *requestor1;
       
   460     writeStream.CommitL();
       
   461     CleanupStack::PopAndDestroy(&writeStream);        //Close the write stream
       
   462 
       
   463     RDesReadStream readStream(*buffer);
       
   464     CleanupClosePushL(readStream);
       
   465     // internalize r2
       
   466     requestor2->InternalizeL(readStream);
       
   467     CleanupStack::PopAndDestroy(&readStream);        //Close the readStream
       
   468 
       
   469     // check r2
       
   470     CHECK(requestor2->RequestorData().Compare(KDummyLit1) == 0);
       
   471     CHECK(requestor2->RequestorType()   == KDummyRequestorType1);
       
   472     CHECK(requestor2->RequestorFormat() == KDummyRequestorFormat1);
       
   473 
       
   474     CleanupStack::PopAndDestroy(3, requestor1);
       
   475 
       
   476     StandardCleanup();
       
   477 	}
       
   478 
       
   479 
       
   480 // 8.3.3. Streaming with NoMemory
       
   481 // See NoMemoryTests.cpp
       
   482 
       
   483 // 8.3.4. Invalid stream
       
   484 TInt CRequestor_Internalize_Invalid_Stream(TAny* /*aPtr*/)
       
   485 	{
       
   486     CRequestor* requestor = NULL;
       
   487     RBufReadStream readStream;
       
   488 
       
   489     // buffer
       
   490     CBufFlat* buffer = CBufFlat::NewL(512);        //Abritrary size chosen
       
   491     RBufWriteStream writeStream; // make sure it is empty
       
   492     writeStream.Open(*buffer);
       
   493     writeStream.WriteUint16L(12345); // put dummy value there (different from KRequestorVersion)
       
   494     writeStream.Close();
       
   495     writeStream.Release();
       
   496     readStream.Open(*buffer);
       
   497 
       
   498     TInt err;
       
   499     TRAP(err,
       
   500                 // internalize it
       
   501             requestor = CRequestor::New(DUMMY_REQUESTOR_TYPE_ACCEPTED1, DUMMY_REQUESTOR_FORMAT_ACCEPTED1, DUMMY_REQUESTOR_NAME_ACCEPTED1);
       
   502                 CleanupStack::PushL(requestor);
       
   503 
       
   504             requestor->InternalizeL(readStream);   //This should panic
       
   505 
       
   506             CleanupStack::PopAndDestroy();
       
   507     	);
       
   508     User::LeaveIfError(err);
       
   509 
       
   510     readStream.Release();
       
   511     delete buffer;
       
   512 
       
   513     return KErrGeneral;
       
   514 	}
       
   515 
       
   516 
       
   517 TInt CRequestor_Construct_Invalid_Stream(TAny* /*aPtr*/)
       
   518 	{
       
   519     CRequestor* requestor = NULL;
       
   520     RBufReadStream readStream;
       
   521 
       
   522     // buffer
       
   523     CBufFlat* buffer = CBufFlat::NewL(512);        //Arbitrary size chosen
       
   524     RBufWriteStream writeStream; // make sure it is empty
       
   525     writeStream.Open(*buffer);
       
   526     writeStream.WriteUint16L(12345); // put dummy value there (different from KRequestorVersion)
       
   527     writeStream.Close();
       
   528     writeStream.Release();
       
   529 
       
   530     // read-stream
       
   531     readStream.Open(*buffer);
       
   532 
       
   533     TInt err;
       
   534     TRAP(err,
       
   535         // internalize it
       
   536         requestor = CRequestor::NewL(readStream);   //This should panic
       
   537     	);
       
   538 
       
   539     delete requestor;
       
   540     readStream.Release();
       
   541     delete buffer;
       
   542 
       
   543     return KErrGeneral;
       
   544 	}
       
   545 
       
   546 
       
   547 void CRequestorClassesStep::CRequestor_Streaming2L()
       
   548 	{
       
   549     DECLARE_ERROR_LOGGING;
       
   550     StandardPrepareL();
       
   551 
       
   552     // attempt to internalize from invalid stream
       
   553     DO_PANIC_TEST_L(
       
   554         CRequestor_Internalize_Invalid_Stream,
       
   555         KPosClientFault,
       
   556         EPositionInvalidClassType,
       
   557         KDefaultTestTimeout);
       
   558     // attempt to construct from invalid stream
       
   559     DO_PANIC_TEST_L(
       
   560         CRequestor_Construct_Invalid_Stream,
       
   561         KPosClientFault,
       
   562         EPositionInvalidClassType,
       
   563         KDefaultTestTimeout);
       
   564 
       
   565     StandardCleanup();
       
   566 	}
       
   567