diff -r aa99f2208aad -r b8d18c84f71c localisation/apparchitecture/tef/TApparcTestApp.cpp --- a/localisation/apparchitecture/tef/TApparcTestApp.cpp Wed Jul 28 16:03:37 2010 +0100 +++ b/localisation/apparchitecture/tef/TApparcTestApp.cpp Tue Aug 03 10:20:34 2010 +0100 @@ -1,7 +1,7 @@ // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available -// under the terms of the License "Eclipse Public License v1.0" +// under the terms of "Eclipse Public License v1.0" // which accompanies this distribution, and is available // at the URL "http://www.eclipse.org/legal/epl-v10.html". // @@ -45,22 +45,21 @@ // Case 2: Then in B's destructor check that C is still non-null. // Case 3: And in C's destructor check that B is now null. // +// tapparctestapp.cpp // - - #include #include #include #include #include #include -#include +#include #include -#include -#include ////TKAS added for exe-app +#include +#include //TKAS added for exe-app -#include +#include // File which stores the test results _LIT(KApparcTestResultsFileName, "c:\\system\\Apparctest\\ApparcTestResultsFile.txt"); @@ -124,6 +123,8 @@ public: inline CTApparcTestNegativePrioStaticB(); inline static CTApparcTestNegativePrioStaticB* Self(); + static CTApparcTestNegativePrioStaticB* NewL(); + void ConstructL(); ~CTApparcTestNegativePrioStaticB(); RFile iFile; @@ -265,11 +266,11 @@ iFile.Write(KTestFail); } -//////////////////////////////////////////////////////////////////////// +// // // CTApparcTestAppView // -//////////////////////////////////////////////////////////////////////// +// class CTApparcTestAppView : public CCoeControl { public: @@ -323,11 +324,11 @@ gc.DiscardFont(); } -//////////////////////////////////////////////////////////////////////// +// // // CTApparcTestAppUi // -//////////////////////////////////////////////////////////////////////// +// class CTApparcTestAppUi : public CEikAppUi { @@ -350,7 +351,7 @@ iAppView = CTApparcTestAppView::NewL(ClientRect()); // Constructs the static object for tests - CTApparcTestNegativePrioStaticB* testCoeStaticB = new(ELeave)CTApparcTestNegativePrioStaticB(); + CTApparcTestNegativePrioStaticB* testCoeStaticB = CTApparcTestNegativePrioStaticB::NewL(); CTApparcTestStatic* testCoeStatic = new (ELeave)CTApparcTestStatic(testCoeStaticB->iFile); CTApparcTestNegativePrioStaticA* testCoeStaticA = new(ELeave)CTApparcTestNegativePrioStaticA(testCoeStaticB->iFile); @@ -429,11 +430,11 @@ testCoeStatic->iFile.Write(KTestFail); } -//////////////////////////////////////////////////////////////////////// +// // // CTApparcTestDocument // -//////////////////////////////////////////////////////////////////////// +// class CTApparcTestDocument : public CEikDocument { @@ -456,11 +457,11 @@ return new(ELeave) CTApparcTestAppUi; } -//////////////////////////////////////////////////////////////////////// +// // // CTApparcTestApplication // -//////////////////////////////////////////////////////////////////////// +// class CTApparcTestApplication : public CEikApplication { @@ -492,11 +493,6 @@ return EikStart::RunApplication(NewApplication); } - - -// -// inline functions -// // inline function for CTApparcTestStatic inline CTApparcTestStatic::CTApparcTestStatic(RFile& aFile) @@ -524,6 +520,24 @@ inline CTApparcTestNegativePrioStaticB::CTApparcTestNegativePrioStaticB() : CCoeStatic(KUidTestStaticNegativePrioB,ENegativePriortyStaticA - 1) { + } + +inline CTApparcTestNegativePrioStaticB* CTApparcTestNegativePrioStaticB::Self() + { + return STATIC_CAST(CTApparcTestNegativePrioStaticB*,CCoeEnv::Static(KUidTestStaticNegativePrioB)); + } + +CTApparcTestNegativePrioStaticB* CTApparcTestNegativePrioStaticB::NewL() + { + CTApparcTestNegativePrioStaticB* self = new(ELeave)CTApparcTestNegativePrioStaticB(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +void CTApparcTestNegativePrioStaticB::ConstructL() + { User::LeaveIfError(iFs.Connect()); TInt err = iFs.MkDirAll(KApparcTestDir); @@ -532,11 +546,6 @@ iFile.Open(iFs,KApparcTestResultsFileName,EFileWrite | EFileShareAny); } -inline CTApparcTestNegativePrioStaticB* CTApparcTestNegativePrioStaticB::Self() - { - return STATIC_CAST(CTApparcTestNegativePrioStaticB*,CCoeEnv::Static(KUidTestStaticNegativePrioB)); - } - // inline functions for CTApparcTestPosPrioStaticA inline CTApparcTestPosPrioStaticA::CTApparcTestPosPrioStaticA(RFile& aFile) : CCoeStatic(KUidTestStaticPosPriA,EDefaultDestructionPriority),iFile(aFile) @@ -591,3 +600,6 @@ { return STATIC_CAST(CTApparcTestPrioTwoStaticC*,CCoeEnv::Static(KUidTestStaticPriTwoC)); } + + +