commonservices/sysutil/test/tef/te_sysutiltestsuite/src/te_sysutilsgetprinformation.cpp
equal
deleted
inserted
replaced
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
26 /** |
26 /** |
27 Destructor |
27 Destructor |
28 */ |
28 */ |
29 CSysUtilsGetPRInformationStep::~CSysUtilsGetPRInformationStep() |
29 CSysUtilsGetPRInformationStep::~CSysUtilsGetPRInformationStep() |
30 { |
30 { |
|
31 SetTestPath(EFalse); |
31 } |
32 } |
32 |
33 |
33 /** |
34 /** |
34 Constructor |
35 Constructor |
35 */ |
36 */ |
60 _LIT16(KDummy,"xxxxx"); |
61 _LIT16(KDummy,"xxxxx"); |
61 |
62 |
62 TBuf16<KSysUtilVersionTextLength> version; |
63 TBuf16<KSysUtilVersionTextLength> version; |
63 version.Insert(0,KDummy); |
64 version.Insert(0,KDummy); |
64 |
65 |
65 TInt fileErr = CheckIsFileExist( _L("Z:\\resource\\versions\\purpose.txt")); |
66 TInt fileErr = CheckIsFileExist( _L("C:\\versions\\purpose.txt")); |
66 |
|
67 if(fileErr == KErrNone) |
67 if(fileErr == KErrNone) |
68 { |
68 { |
69 err = DeletePSProperties(); |
69 err = DeletePSProperties(); |
70 if(err != KErrNone) |
70 if(err != KErrNone) |
71 { |
71 { |
73 SetTestStepResult(EAbort); |
73 SetTestStepResult(EAbort); |
74 return TestStepResult(); |
74 return TestStepResult(); |
75 } |
75 } |
76 INFO_PRINTF1(_L("Deleted P&S properties successfully.")); |
76 INFO_PRINTF1(_L("Deleted P&S properties successfully.")); |
77 |
77 |
78 err = SetTestPath(EFalse); |
78 err = SetTestPath(ETrue); |
79 if( err != KErrNone ) |
79 if( err != KErrNone ) |
80 { |
80 { |
81 ERR_PRINTF2(_L("Could not turn test path off. Error = %d"), err); |
81 ERR_PRINTF2(_L("Could not turn test path off. Error = %d"), err); |
82 SetTestStepResult(EAbort); |
82 SetTestStepResult(EAbort); |
83 return TestStepResult(); |
83 return TestStepResult(); |
110 err = testBuf.Find(KNewLinePattern); |
110 err = testBuf.Find(KNewLinePattern); |
111 } |
111 } |
112 if (version.Compare(testBuf)!=0) |
112 if (version.Compare(testBuf)!=0) |
113 { |
113 { |
114 ERR_PRINTF1(_L("PR Information formatted incorrectly")); |
114 ERR_PRINTF1(_L("PR Information formatted incorrectly")); |
115 INFO_PRINTF1(testBuf); |
115 INFO_PRINTF1(_L("From ini file: ")); |
|
116 INFO_PRINTF1(testBuf); |
|
117 INFO_PRINTF1(_L("From txt file: ")); |
|
118 INFO_PRINTF1(version); |
|
119 INFO_PRINTF2(_L("Comparison returned value %d"), version.Compare(testBuf)); |
116 SetTestStepResult(EFail); |
120 SetTestStepResult(EFail); |
117 } |
121 } |
118 else |
122 else |
119 { |
123 { |
120 INFO_PRINTF1(_L("PR Information formatted correctly")); |
124 INFO_PRINTF1(_L("PR Information formatted correctly")); |
128 else |
132 else |
129 { |
133 { |
130 ERR_PRINTF1(_L("purpose.txt is missing, should be included to base packets")); |
134 ERR_PRINTF1(_L("purpose.txt is missing, should be included to base packets")); |
131 SetTestStepResult(EFail); |
135 SetTestStepResult(EFail); |
132 } |
136 } |
|
137 |
|
138 err = SetTestPath(EFalse); |
133 |
139 |
134 return TestStepResult(); |
140 return TestStepResult(); |
135 } |
141 } |
136 |
142 |