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