sl@0
|
1 |
// Copyright (c) 2007-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 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "tdirectgdinoadapter.h"
|
sl@0
|
17 |
#include <graphics/sgimage.h>
|
sl@0
|
18 |
#include <graphics/directgdidriver.h>
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
CTNoAdapter::CTNoAdapter()
|
sl@0
|
22 |
{
|
sl@0
|
23 |
SetTestStepName(KTDirectGdiNoAdapter);
|
sl@0
|
24 |
}
|
sl@0
|
25 |
|
sl@0
|
26 |
CTNoAdapter::~CTNoAdapter()
|
sl@0
|
27 |
{
|
sl@0
|
28 |
}
|
sl@0
|
29 |
|
sl@0
|
30 |
/**
|
sl@0
|
31 |
@SYMTestCaseID
|
sl@0
|
32 |
GRAPHICS-DIRECTGDI-NOADAPTER-0001
|
sl@0
|
33 |
|
sl@0
|
34 |
@SYMPREQ
|
sl@0
|
35 |
PREQ39
|
sl@0
|
36 |
|
sl@0
|
37 |
@SYMREQ
|
sl@0
|
38 |
REQ9229
|
sl@0
|
39 |
|
sl@0
|
40 |
@SYMTestCaseDesc
|
sl@0
|
41 |
Test drivers return errors when attemptiong to load adaptation when it isn't present.
|
sl@0
|
42 |
|
sl@0
|
43 |
@SYMTestStatus
|
sl@0
|
44 |
Implemented
|
sl@0
|
45 |
|
sl@0
|
46 |
@SYMTestPriority
|
sl@0
|
47 |
High
|
sl@0
|
48 |
|
sl@0
|
49 |
@SYMTestActions
|
sl@0
|
50 |
1. Attempt to open SgDriver
|
sl@0
|
51 |
2. Attempt to open DirectGDI Driver
|
sl@0
|
52 |
|
sl@0
|
53 |
@SYMTestExpectedResults
|
sl@0
|
54 |
1. SgDriver returns KErrNotSupported as the adaptation layer is not present.
|
sl@0
|
55 |
2. DirectGDI Driver returns KErrNotSupoorted as the adaptation layer is not present.
|
sl@0
|
56 |
*/
|
sl@0
|
57 |
void CTNoAdapter::TestNoAdapter()
|
sl@0
|
58 |
{
|
sl@0
|
59 |
SetTestStepID(_L("GRAPHICS-DIRECTGDI-NOADAPTER-0001"));
|
sl@0
|
60 |
_LIT(KTestName, "Test Calls to Open Drivers Return Error");
|
sl@0
|
61 |
INFO_PRINTF1(KTestName);
|
sl@0
|
62 |
|
sl@0
|
63 |
TEST(KErrNotSupported == SgDriver::Open());
|
sl@0
|
64 |
TEST(KErrNotSupported == CDirectGdiDriver::Open());
|
sl@0
|
65 |
TRAPD(err,RecordTestResultL());
|
sl@0
|
66 |
if (err!=KErrNone)
|
sl@0
|
67 |
INFO_PRINTF1(_L("Failed to record test result"));
|
sl@0
|
68 |
}
|
sl@0
|
69 |
|
sl@0
|
70 |
/**
|
sl@0
|
71 |
Override of base class pure virtual
|
sl@0
|
72 |
Our implementation only gets called if the base class doTestStepPreambleL() did
|
sl@0
|
73 |
not leave. That being the case, the current test result value will be EPass.
|
sl@0
|
74 |
@leave Gets system wide error code
|
sl@0
|
75 |
@return TVerdict code
|
sl@0
|
76 |
*/
|
sl@0
|
77 |
TVerdict CTNoAdapter::doTestStepL()
|
sl@0
|
78 |
{
|
sl@0
|
79 |
#ifndef __WINS__
|
sl@0
|
80 |
TestNoAdapter();
|
sl@0
|
81 |
#else
|
sl@0
|
82 |
INFO_PRINTF1(_L("These tests only run on hardware!"));
|
sl@0
|
83 |
#endif
|
sl@0
|
84 |
return TestStepResult();
|
sl@0
|
85 |
}
|
sl@0
|
86 |
|
sl@0
|
87 |
|