sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // TDISPLAYCONFIGURATION.CPP sl@0: // Test class for TDisplayConfiguration sl@0: // sl@0: // sl@0: sl@0: #include "wsdynamicresclassic.h" sl@0: #include sl@0: #include "teflogextensions.h" sl@0: sl@0: struct TLoggerStub sl@0: { sl@0: TLoggerStub(CTestExecuteLogger& aLogger) sl@0: : iLogger(&aLogger) {} sl@0: CTestExecuteLogger* iLogger; sl@0: CTestExecuteLogger& operator()()const sl@0: { sl@0: return *iLogger; sl@0: } sl@0: }; sl@0: sl@0: // This handles any non-member uses of the extended ASSERT_XXX macros sl@0: void TefUnitFailLeaveL() sl@0: { sl@0: sl@0: User::Leave(KErrTEFUnitFail); sl@0: } sl@0: sl@0: // Create a suite of all the tests sl@0: CTestSuite* CWsDynamicResClassic::CreateSuiteL(const TDesC& aName) sl@0: { sl@0: SUB_SUITE_OPT(CWsDynamicResClassic,NULL); sl@0: sl@0: ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0100L); sl@0: sl@0: END_SUITE; sl@0: } sl@0: sl@0: // Published Tests sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS_WSERV_DYNAMICRES_0100L sl@0: @SYMTestCaseDesc GetInterface in classic sl@0: @SYMREQ sl@0: @SYMPREQ PREQ2102 sl@0: @SYMTestType CT sl@0: @SYMTestPriority sl@0: @SYMTestPurpose GetInterface should always return NULL in classic sl@0: @SYMTestActions sl@0: Create an RWsSession sl@0: Create a CWsScreenDevice sl@0: Call GetInterface with various GUIDS. sl@0: @SYMTestExpectedResults sl@0: Should always return NULL sl@0: **/ sl@0: void CWsDynamicResClassic::GRAPHICS_WSERV_DYNAMICRES_0100L() sl@0: { sl@0: RWsSession session; sl@0: session.Connect(); sl@0: sl@0: CWsScreenDevice* screenDevice = NULL; sl@0: sl@0: TRAPD(err, screenDevice = new (ELeave) CWsScreenDevice(session)); sl@0: PRINT_ON_ERROR2_L(err, _L("Failed to create screen device: %d"), err); sl@0: if (screenDevice) sl@0: { sl@0: ASSERT_EQUALS_X(screenDevice->Construct(0), KErrNone); sl@0: sl@0: void* interface = screenDevice->GetInterface(12344321); sl@0: ASSERT_NULL (interface); sl@0: interface = screenDevice->GetInterface(0); sl@0: ASSERT_NULL (interface); sl@0: } sl@0: sl@0: delete screenDevice; sl@0: session.Close(); sl@0: } sl@0: