sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// TDISPLAYCONFIGURATION.CPP
|
sl@0
|
15 |
// Test class for TDisplayConfiguration
|
sl@0
|
16 |
//
|
sl@0
|
17 |
//
|
sl@0
|
18 |
|
sl@0
|
19 |
#include "wsdynamicresclassic.h"
|
sl@0
|
20 |
#include <test/extendtef.h>
|
sl@0
|
21 |
#include "teflogextensions.h"
|
sl@0
|
22 |
|
sl@0
|
23 |
struct TLoggerStub
|
sl@0
|
24 |
{
|
sl@0
|
25 |
TLoggerStub(CTestExecuteLogger& aLogger)
|
sl@0
|
26 |
: iLogger(&aLogger) {}
|
sl@0
|
27 |
CTestExecuteLogger* iLogger;
|
sl@0
|
28 |
CTestExecuteLogger& operator()()const
|
sl@0
|
29 |
{
|
sl@0
|
30 |
return *iLogger;
|
sl@0
|
31 |
}
|
sl@0
|
32 |
};
|
sl@0
|
33 |
|
sl@0
|
34 |
// This handles any non-member uses of the extended ASSERT_XXX macros
|
sl@0
|
35 |
void TefUnitFailLeaveL()
|
sl@0
|
36 |
{
|
sl@0
|
37 |
|
sl@0
|
38 |
User::Leave(KErrTEFUnitFail);
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
// Create a suite of all the tests
|
sl@0
|
42 |
CTestSuite* CWsDynamicResClassic::CreateSuiteL(const TDesC& aName)
|
sl@0
|
43 |
{
|
sl@0
|
44 |
SUB_SUITE_OPT(CWsDynamicResClassic,NULL);
|
sl@0
|
45 |
|
sl@0
|
46 |
ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0100L);
|
sl@0
|
47 |
|
sl@0
|
48 |
END_SUITE;
|
sl@0
|
49 |
}
|
sl@0
|
50 |
|
sl@0
|
51 |
// Published Tests
|
sl@0
|
52 |
|
sl@0
|
53 |
/**
|
sl@0
|
54 |
@SYMTestCaseID GRAPHICS_WSERV_DYNAMICRES_0100L
|
sl@0
|
55 |
@SYMTestCaseDesc GetInterface in classic
|
sl@0
|
56 |
@SYMREQ
|
sl@0
|
57 |
@SYMPREQ PREQ2102
|
sl@0
|
58 |
@SYMTestType CT
|
sl@0
|
59 |
@SYMTestPriority
|
sl@0
|
60 |
@SYMTestPurpose GetInterface should always return NULL in classic
|
sl@0
|
61 |
@SYMTestActions
|
sl@0
|
62 |
Create an RWsSession
|
sl@0
|
63 |
Create a CWsScreenDevice
|
sl@0
|
64 |
Call GetInterface with various GUIDS.
|
sl@0
|
65 |
@SYMTestExpectedResults
|
sl@0
|
66 |
Should always return NULL
|
sl@0
|
67 |
**/
|
sl@0
|
68 |
void CWsDynamicResClassic::GRAPHICS_WSERV_DYNAMICRES_0100L()
|
sl@0
|
69 |
{
|
sl@0
|
70 |
RWsSession session;
|
sl@0
|
71 |
session.Connect();
|
sl@0
|
72 |
|
sl@0
|
73 |
CWsScreenDevice* screenDevice = NULL;
|
sl@0
|
74 |
|
sl@0
|
75 |
TRAPD(err, screenDevice = new (ELeave) CWsScreenDevice(session));
|
sl@0
|
76 |
PRINT_ON_ERROR2_L(err, _L("Failed to create screen device: %d"), err);
|
sl@0
|
77 |
if (screenDevice)
|
sl@0
|
78 |
{
|
sl@0
|
79 |
ASSERT_EQUALS_X(screenDevice->Construct(0), KErrNone);
|
sl@0
|
80 |
|
sl@0
|
81 |
void* interface = screenDevice->GetInterface(12344321);
|
sl@0
|
82 |
ASSERT_NULL (interface);
|
sl@0
|
83 |
interface = screenDevice->GetInterface(0);
|
sl@0
|
84 |
ASSERT_NULL (interface);
|
sl@0
|
85 |
}
|
sl@0
|
86 |
|
sl@0
|
87 |
delete screenDevice;
|
sl@0
|
88 |
session.Close();
|
sl@0
|
89 |
}
|
sl@0
|
90 |
|