|
1 // Copyright (c) 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 // Example CTestStep derived implementation |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "XML_flagsStep.h" |
|
23 #include "Te_XML_FTmgrSuiteDefs.h" |
|
24 |
|
25 CXML_flagsStep::~CXML_flagsStep() |
|
26 /** |
|
27 * Destructor |
|
28 */ |
|
29 { |
|
30 if ( iFeatMgrInitialized ) |
|
31 { |
|
32 FeatureManager::UnInitializeLib(); |
|
33 } |
|
34 |
|
35 } |
|
36 |
|
37 CXML_flagsStep::CXML_flagsStep() |
|
38 /** |
|
39 * Constructor |
|
40 */ |
|
41 { |
|
42 |
|
43 TRAPD(err,ConstructL()); |
|
44 if(err==KErrNone) |
|
45 { |
|
46 SetTestStepName(KXML_flagsStep); |
|
47 } |
|
48 |
|
49 } |
|
50 |
|
51 void CXML_flagsStep::ConstructL() |
|
52 { |
|
53 |
|
54 FeatureManager::InitializeLibL(); |
|
55 iFeatMgrInitialized = ETrue; |
|
56 |
|
57 } |
|
58 |
|
59 |
|
60 void CXML_flagsStep::ShowMenuL() |
|
61 { |
|
62 TInt Libxml2UID, Libxml2SAXParserUID, Libxml2DOMParserUID; |
|
63 |
|
64 if( !GetIntFromConfig(ConfigSection(),KTe_XML_flagsSuiteLibxml2UID, Libxml2UID) || |
|
65 !GetIntFromConfig(ConfigSection(),KTe_XML_flagsSuiteLibxml2SAXParserUID,Libxml2SAXParserUID) || |
|
66 !GetIntFromConfig(ConfigSection(),KTe_XML_flagsSuiteLibxml2Libxml2DOMParserUID,Libxml2DOMParserUID ) |
|
67 ) |
|
68 { |
|
69 User::Leave(KErrNotFound); |
|
70 } |
|
71 else |
|
72 { |
|
73 INFO_PRINTF4(_L("The flag1 is %d, The flag2 is %d, The flag3 is %d"), Libxml2UID, Libxml2SAXParserUID, Libxml2DOMParserUID); // Block end |
|
74 } |
|
75 |
|
76 |
|
77 |
|
78 if ( FeatureManager::FeatureSupported(Libxml2UID) == KFeatureSupported && FeatureManager::FeatureSupported(Libxml2SAXParserUID) == KFeatureSupported |
|
79 && FeatureManager::FeatureSupported(Libxml2DOMParserUID) == KFeatureSupported) |
|
80 { |
|
81 SetTestStepResult(EPass); |
|
82 INFO_PRINTF1(_L("\n libxml2, DOM , SAX present.")); |
|
83 } |
|
84 |
|
85 |
|
86 else if ( FeatureManager::FeatureSupported(Libxml2UID) == KFeatureUnsupported && FeatureManager::FeatureSupported(Libxml2SAXParserUID) == KFeatureUnsupported |
|
87 && FeatureManager::FeatureSupported(Libxml2DOMParserUID) == KFeatureUnsupported) |
|
88 { |
|
89 SetTestStepResult(EPass); |
|
90 INFO_PRINTF1(_L("\n libxml2, DOM , SAX not present.")); |
|
91 } |
|
92 |
|
93 else if ( FeatureManager::FeatureSupported(Libxml2UID) == KFeatureSupported && FeatureManager::FeatureSupported(Libxml2SAXParserUID) == KFeatureUnsupported |
|
94 && FeatureManager::FeatureSupported(Libxml2DOMParserUID) == KFeatureUnsupported) |
|
95 { |
|
96 SetTestStepResult(EPass); |
|
97 INFO_PRINTF1(_L("\n libxml2 present, DOM and SAX not present. ")); |
|
98 } |
|
99 |
|
100 else if ( FeatureManager::FeatureSupported(Libxml2UID) == KFeatureSupported && FeatureManager::FeatureSupported(Libxml2SAXParserUID) == KFeatureUnsupported |
|
101 && FeatureManager::FeatureSupported(Libxml2DOMParserUID) == KFeatureSupported) |
|
102 { |
|
103 SetTestStepResult(EPass); |
|
104 INFO_PRINTF1(_L("\n libxml2 and Dom present, SAX not present.")); |
|
105 } |
|
106 |
|
107 else if ( FeatureManager::FeatureSupported(Libxml2UID) == KFeatureSupported && FeatureManager::FeatureSupported(Libxml2SAXParserUID) == KFeatureSupported |
|
108 && FeatureManager::FeatureSupported(Libxml2DOMParserUID) == KFeatureUnsupported) |
|
109 { |
|
110 SetTestStepResult(EPass); |
|
111 INFO_PRINTF1(_L("\n libxml2 and SAX present, DOM not present ...")); |
|
112 } |
|
113 |
|
114 |
|
115 } |
|
116 |
|
117 |
|
118 |
|
119 TVerdict CXML_flagsStep::doTestStepL() |
|
120 { |
|
121 INFO_PRINTF1(_L("XML Variation Support test case(feature manager based) -- BASESRVCS-XML-CT-4927, PREQ2051")); |
|
122 SetTestStepResult(EFail); |
|
123 ShowMenuL(); |
|
124 return TestStepResult(); |
|
125 } |
|
126 |
|
127 |
|
128 |