sysstatemgmt/systemstatereferenceplugins/test/tunitcustcmd/src/tcmd_step_coopsysselftest.cpp
equal
deleted
inserted
replaced
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2009 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". |
20 */ |
20 */ |
21 |
21 |
22 #include "tcmd_step_coopsysselftest.h" |
22 #include "tcmd_step_coopsysselftest.h" |
23 #include "ssmcustomcmdfactory.h" |
23 #include "ssmcustomcmdfactory.h" |
24 #include "cmdcoopsysselftest.h" |
24 #include "cmdcoopsysselftest.h" |
25 #include <e32property.h> |
|
26 |
|
27 const TUint32 KStateAdaptationPluginPropertyKey = 0x2000D76A; |
|
28 const TUid KPropertyCategory={0x2000D75B}; |
|
29 |
25 |
30 CCustomCmdTestCoopSysSelfTest::~CCustomCmdTestCoopSysSelfTest() |
26 CCustomCmdTestCoopSysSelfTest::~CCustomCmdTestCoopSysSelfTest() |
31 { |
27 { |
32 } |
28 } |
33 |
29 |
41 New Test CaseID DEVSRVS-SSREFPLUGINS-CUSTCMD-0005 |
37 New Test CaseID DEVSRVS-SSREFPLUGINS-CUSTCMD-0005 |
42 */ |
38 */ |
43 |
39 |
44 void CCustomCmdTestCoopSysSelfTest::TestCustomCmdCoopSysSelfTestL() |
40 void CCustomCmdTestCoopSysSelfTest::TestCustomCmdCoopSysSelfTestL() |
45 { |
41 { |
46 // Setting the P and S key will route the request to the reference plugins instead of the actual plugins |
|
47 TInt err = RProperty::Define(KPropertyCategory, KStateAdaptationPluginPropertyKey, RProperty::EInt); |
|
48 TEST(KErrNone == err || KErrAlreadyExists == err); |
|
49 err = RProperty::Set(KPropertyCategory, KStateAdaptationPluginPropertyKey, 1); |
|
50 TEST(KErrNone == err); |
|
51 _LIT(KTESTLOG, "TestCustomCmdCoopSysSelfTestL"); |
42 _LIT(KTESTLOG, "TestCustomCmdCoopSysSelfTestL"); |
52 INFO_PRINTF1(KTESTLOG); |
43 INFO_PRINTF1(KTESTLOG); |
53 |
44 |
54 MSsmCustomCommand* customCmdCoopSysSelfTest = SsmCustomCmdFactory::CmdCoopSysSelfTestNewL(); |
45 MSsmCustomCommand* customCmdCoopSysSelfTest = SsmCustomCmdFactory::CmdCoopSysSelfTestNewL(); |
55 |
46 |
87 //Close the command |
78 //Close the command |
88 customCmdCoopSysSelfTest->Close(); |
79 customCmdCoopSysSelfTest->Close(); |
89 |
80 |
90 //Releasing the comand will delete itself. |
81 //Releasing the comand will delete itself. |
91 customCmdCoopSysSelfTest->Release(); |
82 customCmdCoopSysSelfTest->Release(); |
92 err = RProperty::Delete(KPropertyCategory, KStateAdaptationPluginPropertyKey); |
|
93 TEST(KErrNone == err); |
|
94 } |
83 } |
95 |
84 |
96 TVerdict CCustomCmdTestCoopSysSelfTest::doTestStepL() |
85 TVerdict CCustomCmdTestCoopSysSelfTest::doTestStepL() |
97 { |
86 { |
98 __UHEAP_MARK; |
87 __UHEAP_MARK; |