os/graphics/windowing/windowserver/test/tdynamicres/src/wsdynamicresclassic.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-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 // TDISPLAYCONFIGURATION.CPP
    15 // Test class for TDisplayConfiguration
    16 // 
    17 //
    18 
    19 #include "wsdynamicresclassic.h"
    20 #include <test/extendtef.h>
    21 #include "teflogextensions.h"
    22 
    23 struct TLoggerStub
    24 {
    25 	TLoggerStub(CTestExecuteLogger& aLogger)
    26 	:	iLogger(&aLogger)	{}
    27 	CTestExecuteLogger* iLogger;
    28 	CTestExecuteLogger& operator()()const
    29 		{
    30 		return *iLogger;
    31 		}
    32 };
    33 
    34 // This handles any non-member uses of the extended ASSERT_XXX macros
    35 void TefUnitFailLeaveL()
    36 	{
    37 	
    38 	User::Leave(KErrTEFUnitFail);
    39 	}
    40 
    41 // Create a suite of all the tests
    42 CTestSuite* CWsDynamicResClassic::CreateSuiteL(const TDesC& aName)
    43 	{
    44 	SUB_SUITE_OPT(CWsDynamicResClassic,NULL);
    45 
    46 		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0100L);
    47 
    48 	END_SUITE;	
    49 	}
    50 
    51 // Published Tests
    52 
    53 /**
    54 @SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0100L
    55 @SYMTestCaseDesc		GetInterface in classic
    56 @SYMREQ					
    57 @SYMPREQ				PREQ2102
    58 @SYMTestType			CT
    59 @SYMTestPriority		
    60 @SYMTestPurpose			GetInterface should always return NULL in classic
    61 @SYMTestActions			
    62 	Create an RWsSession
    63 	Create a CWsScreenDevice
    64 	Call GetInterface with various GUIDS.
    65 @SYMTestExpectedResults	
    66 	Should always return NULL
    67 **/
    68 void CWsDynamicResClassic::GRAPHICS_WSERV_DYNAMICRES_0100L()
    69 	{
    70 	RWsSession session;
    71 	session.Connect();
    72 
    73 	CWsScreenDevice* screenDevice = NULL;
    74 
    75 	TRAPD(err, screenDevice = new (ELeave) CWsScreenDevice(session));
    76 	PRINT_ON_ERROR2_L(err, _L("Failed to create screen device: %d"), err);
    77 	if (screenDevice)
    78 		{
    79 		ASSERT_EQUALS_X(screenDevice->Construct(0), KErrNone);
    80 	
    81 		void* interface = screenDevice->GetInterface(12344321);
    82 		ASSERT_NULL (interface);
    83 		interface = screenDevice->GetInterface(0);
    84 		ASSERT_NULL (interface);
    85 		}
    86 
    87 	delete screenDevice;
    88 	session.Close();
    89 	}
    90