author | victorp@symbian.org |
Wed, 03 Feb 2010 16:06:24 +0000 | |
changeset 872 | 17498133d9ad |
parent 833 | 6ffc235847d0 |
permissions | -rw-r--r-- |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
1 |
/* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
3 |
* All rights reserved. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
872 | 5 |
* under the terms of the License "Eclipse Public License v1.0" |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
872 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
8 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
11 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
12 |
* Contributors: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
13 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
14 |
* Description: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
15 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
16 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
17 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
18 |
#include "T_DataWsClientClass.h" |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
19 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
20 |
/*@{*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
21 |
//Commands |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
22 |
_LIT(KCmdWsHandle, "WsHandle"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
23 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
24 |
// Fields |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
25 |
_LIT(KFldExpected, "expected"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
26 |
_LIT(KFldExpectNot, "expectnot"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
27 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
28 |
/// Logging |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
29 |
_LIT(KLogNotExpectedValueInt, "'%S' is not as expected=%d, actual=%d"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
30 |
_LIT(KLogAsExpectedValueInt, "actual value as '%S'=%d"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
31 |
/*@}*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
32 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
33 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
34 |
/** |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
35 |
* Process a command read from the ini file |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
36 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
37 |
* @param aCommand the command to process |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
38 |
* @param aSection the entry in the ini file requiring the command to be processed |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
39 |
* @param aAsyncErrorIndex index of command. used for async calls |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
40 |
* |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
41 |
* @return ETrue if the command is processed |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
42 |
*/ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
43 |
TBool CT_DataWsClientClass::DoCommandL(CDataWrapperBase& aDataWrapper, const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
44 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
45 |
TBool ret = ETrue; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
46 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
47 |
if ( aCommand==KCmdWsHandle ) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
48 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
49 |
DoCmdWsHandle(aDataWrapper, aSection); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
50 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
51 |
else |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
52 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
53 |
ret=EFalse; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
54 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
55 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
56 |
return ret; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
57 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
58 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
59 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
60 |
void CT_DataWsClientClass::DoCmdWsHandle(CDataWrapperBase& aDataWrapper, const TDesC& aSection) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
61 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
62 |
// Execute command and log parameters |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
63 |
aDataWrapper.INFO_PRINTF1(_L("execute WsHandle()")); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
64 |
TInt actualResult = GetClientClass()->WsHandle(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
65 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
66 |
// Diaplay command return value, check if it matches the expected value |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
67 |
TInt expnotResult; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
68 |
if ( aDataWrapper.GetIntFromConfig(aSection, KFldExpectNot, expnotResult) ) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
69 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
70 |
if ( actualResult==expnotResult ) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
71 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
72 |
aDataWrapper.ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpectNot, expnotResult, actualResult); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
73 |
aDataWrapper.SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
74 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
75 |
else |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
76 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
77 |
aDataWrapper.INFO_PRINTF3(KLogAsExpectedValueInt, &KFldExpectNot, actualResult); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
78 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
79 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
80 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
81 |
TInt expectResult; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
82 |
if ( aDataWrapper.GetIntFromConfig(aSection, KFldExpected, expectResult) ) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
83 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
84 |
if ( actualResult!=expectResult ) |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
85 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
86 |
aDataWrapper.ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
87 |
aDataWrapper.SetBlockResult(EFail); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
88 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
89 |
else |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
90 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
91 |
aDataWrapper.INFO_PRINTF3(KLogAsExpectedValueInt, &KFldExpected, actualResult); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
92 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
93 |
} |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
94 |
} |