windowing/windowserver/tauto/TMemLeakMode.cpp
changeset 110 7f25ef56562d
parent 98 bf7481649c98
child 111 29ddb8a72f0e
equal deleted inserted replaced
98:bf7481649c98 110:7f25ef56562d
     1 // Copyright (c) 2007-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 // Enable Wserv memory leak checks
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @test
       
    21  @internalComponent - Internal Symbian test code
       
    22 */
       
    23 
       
    24 #include "TMemLeakMode.h"
       
    25 #include <w32debug.h>
       
    26 
       
    27 //
       
    28 //
       
    29 CTMemLeakCheckEnable::CTMemLeakCheckEnable(CTestStep* aStep) : CTWsGraphicsBase(aStep)
       
    30 	{
       
    31 	INFO_PRINTF1(_L("Enabling memory leak checks"));
       
    32 	}
       
    33 
       
    34 void CTMemLeakCheckEnable::ConstructL()
       
    35 	{
       
    36 	iIsWsTestMode = !iTest->IsFullRomL();
       
    37 	if (iIsWsTestMode)
       
    38 		{
       
    39 		TheClient->iWs.DebugInfo(EWsDebugSetCheckHeapOnDisconnectMode,EWsCheckHeapOnDisconnectModeAlways);
       
    40 		}
       
    41 	}
       
    42 
       
    43 void CTMemLeakCheckEnable::RunTestCaseL(TInt )
       
    44 	{
       
    45 	if (!iIsWsTestMode)
       
    46 		{
       
    47 #if defined(__WINS__)
       
    48 		WARN_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
       
    49 #else
       
    50 		INFO_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
       
    51 #endif
       
    52 		}
       
    53 	TestComplete();
       
    54 	}
       
    55 	
       
    56 __WS_CONSTRUCT_STEP__(MemLeakCheckEnable)
       
    57 
       
    58 //
       
    59 //
       
    60 
       
    61 CTMemLeakCheckOneShot::CTMemLeakCheckOneShot(CTestStep* aStep) : CTWsGraphicsBase(aStep)
       
    62 	{
       
    63 	INFO_PRINTF1(_L("Triggering one shot memory leak check"));
       
    64 	}
       
    65 
       
    66 void CTMemLeakCheckOneShot::ConstructL()
       
    67 	{
       
    68 	iIsWsTestMode = !iTest->IsFullRomL();
       
    69 	if (iIsWsTestMode)
       
    70 		{
       
    71 		TheClient->iWs.DebugInfo(EWsDebugSetCheckHeapOnDisconnectMode,EWsCheckHeapOnDisconnectModeOnce);
       
    72 		}
       
    73 	}
       
    74 
       
    75 void CTMemLeakCheckOneShot::RunTestCaseL(TInt )
       
    76 	{
       
    77 	if (!iIsWsTestMode)
       
    78 		{
       
    79 #if defined(__WINS__)
       
    80 		WARN_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
       
    81 #else
       
    82 		INFO_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
       
    83 #endif
       
    84 		}
       
    85 	TestComplete();
       
    86 	}
       
    87 
       
    88 __WS_CONSTRUCT_STEP__(MemLeakCheckOneShot)