sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/trtc_adaptationplugin_step.cpp
--- a/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/trtc_adaptationplugin_step.cpp Thu Aug 19 11:09:10 2010 +0300
+++ b/sysstatemgmt/systemstateplugins/test/tunitadptplugin/src/trtc_adaptationplugin_step.cpp Tue Aug 31 16:29:05 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
@@ -20,14 +20,16 @@
*/
-
+#include <e32property.h>
#include <s32mem.h>
#include "trtc_adaptationplugin_step.h"
//
// Run the tests
//
-
+_LIT (KExeToDefineTestPS, "\\sys\\bin\\definetestps.exe");
+const TUint32 KRtcAdaptationPluginPropertyKey = 0x2000D76C;
+const TUid KPropertyCategory={0x2000D75B};
CTestRtcAdaptationPlugin::CTestRtcAdaptationPlugin()
:CAdaptationTestBase(KTCTestRtcAdaptationPlugin)
@@ -53,7 +55,7 @@
if(iSsmRtcAdaptation.Handle())
{
TEST(KErrNotSupported == status.Int());
- INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestValidateRtc completed with %d error : expected %d>"),status.Int(),KErrNone);
+ INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestValidateRtc completed with %d error : expected %d>"),status.Int(),KErrNotSupported);
}
else
{
@@ -74,7 +76,7 @@
if(iSsmRtcAdaptation.Handle())
{
TEST(KErrNotSupported == status.Int());
- INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestSetWakeupAlarm completed with %d error : expected %d>"),status.Int(),KErrNone);
+ INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestSetWakeupAlarm completed with %d error : expected %d>"),status.Int(),KErrNotSupported);
}
else
{
@@ -94,7 +96,7 @@
if(iSsmRtcAdaptation.Handle())
{
TEST(KErrNotSupported == status.Int());
- INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestUnsetWakeupAlarm completed with %d error : expected %d>"),status.Int(),KErrNone);
+ INFO_PRINTF3(_L("CTestRtcAdaptationPlugin::TestUnsetWakeupAlarm completed with %d error : expected %d>"),status.Int(),KErrNotSupported);
}
else
{
@@ -114,9 +116,29 @@
//from CAdaptationTestBase
TVerdict CTestRtcAdaptationPlugin::doTestStepL()
{
- TInt err = KErrNone;
-
__UHEAP_MARK;
+
+ RProcess processHandle;
+ CleanupClosePushL(processHandle);
+
+ //Start the test exe which defines startup related property keys
+
+ TInt err = processHandle.Create(KExeToDefineTestPS, KNullDesC);
+ INFO_PRINTF2(_L("Process creation returned : %d"), err);
+ User::LeaveIfError(err);
+ processHandle.Resume();
+
+ // wait for the newly created process to rendezvous
+ TRequestStatus status;
+ processHandle.Rendezvous(status);
+ User::WaitForRequest(status);
+ TInt retVal = status.Int();
+ INFO_PRINTF2(_L("iStatus.Int() returned : %d"), retVal);
+ TEST(KErrNone == retVal);
+ CleanupStack::PopAndDestroy();
+
+ err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 1);
+ TEST(KErrNone == err);
TRAP(err, TestValidateRtc());
TEST(err == KErrNone);
@@ -142,7 +164,8 @@
TestCancel();
//TestRelease(); // have to test this part too ...
-
+ err = RProperty::Set(KPropertyCategory, KRtcAdaptationPluginPropertyKey, 0);
+ TEST(KErrNone == err);
__UHEAP_MARKEND;
return TestStepResult();