1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TMemLeakMode.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,88 @@
1.4 +// Copyright (c) 2007-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 +// Enable Wserv memory leak checks
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @test
1.24 + @internalComponent - Internal Symbian test code
1.25 +*/
1.26 +
1.27 +#include "TMemLeakMode.h"
1.28 +#include <w32debug.h>
1.29 +
1.30 +//
1.31 +//
1.32 +CTMemLeakCheckEnable::CTMemLeakCheckEnable(CTestStep* aStep) : CTWsGraphicsBase(aStep)
1.33 + {
1.34 + INFO_PRINTF1(_L("Enabling memory leak checks"));
1.35 + }
1.36 +
1.37 +void CTMemLeakCheckEnable::ConstructL()
1.38 + {
1.39 + iIsWsTestMode = !iTest->IsFullRomL();
1.40 + if (iIsWsTestMode)
1.41 + {
1.42 + TheClient->iWs.DebugInfo(EWsDebugSetCheckHeapOnDisconnectMode,EWsCheckHeapOnDisconnectModeAlways);
1.43 + }
1.44 + }
1.45 +
1.46 +void CTMemLeakCheckEnable::RunTestCaseL(TInt )
1.47 + {
1.48 + if (!iIsWsTestMode)
1.49 + {
1.50 +#if defined(__WINS__)
1.51 + WARN_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
1.52 +#else
1.53 + INFO_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
1.54 +#endif
1.55 + }
1.56 + TestComplete();
1.57 + }
1.58 +
1.59 +__WS_CONSTRUCT_STEP__(MemLeakCheckEnable)
1.60 +
1.61 +//
1.62 +//
1.63 +
1.64 +CTMemLeakCheckOneShot::CTMemLeakCheckOneShot(CTestStep* aStep) : CTWsGraphicsBase(aStep)
1.65 + {
1.66 + INFO_PRINTF1(_L("Triggering one shot memory leak check"));
1.67 + }
1.68 +
1.69 +void CTMemLeakCheckOneShot::ConstructL()
1.70 + {
1.71 + iIsWsTestMode = !iTest->IsFullRomL();
1.72 + if (iIsWsTestMode)
1.73 + {
1.74 + TheClient->iWs.DebugInfo(EWsDebugSetCheckHeapOnDisconnectMode,EWsCheckHeapOnDisconnectModeOnce);
1.75 + }
1.76 + }
1.77 +
1.78 +void CTMemLeakCheckOneShot::RunTestCaseL(TInt )
1.79 + {
1.80 + if (!iIsWsTestMode)
1.81 + {
1.82 +#if defined(__WINS__)
1.83 + WARN_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
1.84 +#else
1.85 + INFO_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
1.86 +#endif
1.87 + }
1.88 + TestComplete();
1.89 + }
1.90 +
1.91 +__WS_CONSTRUCT_STEP__(MemLeakCheckOneShot)