/** @SYMTestCaseID SYSLIB-BAFL-CT-0488 @SYMTestCaseDesc Tests for defect number DEF043985 @SYMTestPriority High @SYMTestActions Tests that the table is invalid when creating an RString Check for panic @SYMTestExpectedResults Tests must not fail @SYMREQ REQ0000 */ TInt RStringPoolPanicTest::DEF043985_StringTest_ThreadL(TAny*) { __UHEAP_MARK; RStringPool stringPool; stringPool.OpenL(); // Create a table and make it so it passes some internal tests // for validity as we are testing a particular internal test TStringTable testTable; testTable.iCaseSensitive = ETrue; testTable.iCount = 1; // Test for Panic RString testString = stringPool.String(0, testTable); // Test should never get this far as it Panics testString.Close(); stringPool.Close(); __UHEAP_MARKEND; return KErrNone; }
COCSPTransportDefault::TTransportScheme COCSPTransportDefault::IdentifySchemeL(const TDesC8& aURI) { TTransportScheme ret = ETransportSchemeNotSupported; TUriParser8 uri; TInt error = uri.Parse(aURI); if (error != KErrNone || !uri.IsPresent(EUriScheme)) { return ret; } const TPtrC8 scheme = uri.Extract(EUriScheme); RStringPool stringPool; stringPool.OpenL(); CleanupClosePushL(stringPool); RStringF schemeF = stringPool.OpenFStringL(scheme); CleanupClosePushL(schemeF); RStringF httpF = stringPool.OpenFStringL(KHttpString); CleanupClosePushL(httpF); if (schemeF == httpF) { ret = ETransportSchemeHTTP; } CleanupStack::PopAndDestroy(3); // close httpF, schemeF, stringPool return ret; }
/** Subtest function @SYMTestCaseID SYSLIB-BAFL-CT-0490 @SYMTestCaseDesc Tests for defect number DEF043985 @SYMTestPriority High @SYMTestActions Tests that the table is invalid when creating a folded RString @SYMTestExpectedResults Tests must not fail @SYMREQ REQ0000 */ void RStringPoolPanicTest::DEF043985_IndexTest_SubFunctionL() { __UHEAP_MARK; RStringPool stringPool; stringPool.OpenL(); // Create a table and make it so it passes some internal tests // for validity as we are testing a particular internal test TStringTable testTable; testTable.iCaseSensitive = ETrue; testTable.iCount = 1; RString testString = stringPool.OpenStringL(KDummyString()); CleanupClosePushL(testString); // Test for Panic testString.Index(testTable); // Test should never get this far as it Panics CleanupStack::PopAndDestroy(&testString); stringPool.Close(); __UHEAP_MARKEND; }
void CHTTPTest::DoTestsL() { testHarness->StartTestL(_L("Creating the string pool")); RStringPool pool; pool.OpenL(table); testHarness->EndTest(0); testHarness->StartTestL(_L("Creating 'hello'")); STRDCI_L(hello, KHello); RStringF def; testHarness->EndTest(hello == def); testHarness->StartTestL(_L("Creating another 'hello'")); ASTRDCI_L(hello1, KHello1); testHarness->EndTest(!(hello == hello1.iObj)); testHarness->StartTestL(_L("Testing !=")); testHarness->EndTest(hello != hello1.iObj); testHarness->StartTestL(_L("Creating 'goodbye'")); STRDCI_L(goodbye, KGoodbye); testHarness->EndTest(hello == goodbye); testHarness->StartTestL(_L("Creating string tokens")); RStringTokenF h1, h2(hello), g; h1 = hello; testHarness->EndTest(h1 != h2); testHarness->StartTestL(_L("Testing == on string tokens")); testHarness->EndTest(!(h1 == h2)); testHarness->StartTestL(_L("Making a string from a token")); hello1.iObj = pool.StringF(h1); testHarness->EndTest(hello != hello1.iObj); testHarness->StartTestL(_L("Non-equal tokens")); g = goodbye; testHarness->EndTest(hello == goodbye); testHarness->StartTestL(_L("Operator != on non-equal tokens")); testHarness->EndTest(!(hello != goodbye)); testHarness->StartTestL(_L("Copy function")); hello1.iObj = hello.Copy(); testHarness->EndTest(hello != hello1.iObj); testHarness->StartTestL(_L("String extraction (same)")); testHarness->EndTest(static_cast<const TDesC8&>(hello).Compare(hello1.iObj)); testHarness->StartTestL(_L("String extraction (different)")); testHarness->EndTest(!static_cast<const TDesC8&>(hello).Compare(goodbye)); testHarness->StartTestL(_L("String extraction (original)")); testHarness->EndTest(static_cast<const TDesC8&>(hello).Compare(KHello)); testHarness->StartTestL(_L("Closing pool")); hello.Copy(); hello.Close(); hello.Close(); hello1.iObj.Close(); // The copys here have got a bit confused hello1.iObj.Close(); goodbye.Close(); pool.CloseAll(); testHarness->EndTest(0); }
// --------------------------------------------------------------------------- // Creates an initialised string pool with no pre-loaded string tables. // --------------------------------------------------------------------------- // void TIRXMLElementFormat::OpenStringPoolL( RStringPool& aStringPool ) { IRLOG_DEBUG( "CIRXMLContentHandler::OpenStringPoolL" ); aStringPool.OpenL( IRPoolTable ); IRLOG_DEBUG( "CIRXMLContentHandler::OpenStringPoolL - Exiting." ); }