1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tdynamicres/src/wsdynamicresclassic.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,90 @@
1.4 +// Copyright (c) 2008-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 +// TDISPLAYCONFIGURATION.CPP
1.18 +// Test class for TDisplayConfiguration
1.19 +//
1.20 +//
1.21 +
1.22 +#include "wsdynamicresclassic.h"
1.23 +#include <test/extendtef.h>
1.24 +#include "teflogextensions.h"
1.25 +
1.26 +struct TLoggerStub
1.27 +{
1.28 + TLoggerStub(CTestExecuteLogger& aLogger)
1.29 + : iLogger(&aLogger) {}
1.30 + CTestExecuteLogger* iLogger;
1.31 + CTestExecuteLogger& operator()()const
1.32 + {
1.33 + return *iLogger;
1.34 + }
1.35 +};
1.36 +
1.37 +// This handles any non-member uses of the extended ASSERT_XXX macros
1.38 +void TefUnitFailLeaveL()
1.39 + {
1.40 +
1.41 + User::Leave(KErrTEFUnitFail);
1.42 + }
1.43 +
1.44 +// Create a suite of all the tests
1.45 +CTestSuite* CWsDynamicResClassic::CreateSuiteL(const TDesC& aName)
1.46 + {
1.47 + SUB_SUITE_OPT(CWsDynamicResClassic,NULL);
1.48 +
1.49 + ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0100L);
1.50 +
1.51 + END_SUITE;
1.52 + }
1.53 +
1.54 +// Published Tests
1.55 +
1.56 +/**
1.57 +@SYMTestCaseID GRAPHICS_WSERV_DYNAMICRES_0100L
1.58 +@SYMTestCaseDesc GetInterface in classic
1.59 +@SYMREQ
1.60 +@SYMPREQ PREQ2102
1.61 +@SYMTestType CT
1.62 +@SYMTestPriority
1.63 +@SYMTestPurpose GetInterface should always return NULL in classic
1.64 +@SYMTestActions
1.65 + Create an RWsSession
1.66 + Create a CWsScreenDevice
1.67 + Call GetInterface with various GUIDS.
1.68 +@SYMTestExpectedResults
1.69 + Should always return NULL
1.70 +**/
1.71 +void CWsDynamicResClassic::GRAPHICS_WSERV_DYNAMICRES_0100L()
1.72 + {
1.73 + RWsSession session;
1.74 + session.Connect();
1.75 +
1.76 + CWsScreenDevice* screenDevice = NULL;
1.77 +
1.78 + TRAPD(err, screenDevice = new (ELeave) CWsScreenDevice(session));
1.79 + PRINT_ON_ERROR2_L(err, _L("Failed to create screen device: %d"), err);
1.80 + if (screenDevice)
1.81 + {
1.82 + ASSERT_EQUALS_X(screenDevice->Construct(0), KErrNone);
1.83 +
1.84 + void* interface = screenDevice->GetInterface(12344321);
1.85 + ASSERT_NULL (interface);
1.86 + interface = screenDevice->GetInterface(0);
1.87 + ASSERT_NULL (interface);
1.88 + }
1.89 +
1.90 + delete screenDevice;
1.91 + session.Close();
1.92 + }
1.93 +