sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_validswplist.cpp
changeset 41 c87e5f80c17d
parent 0 4e1aa6a622a0
child 61 8cb079868133
--- a/sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_validswplist.cpp	Fri Jun 11 14:56:08 2010 +0300
+++ b/sysstatemgmt/systemstatemgr/test/tssm/src/tssm_step_validswplist.cpp	Thu Jul 01 11:20:10 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -19,6 +19,7 @@
  @internalComponent - Internal Symbian test code
 */
 
+#include <e32property.h>
 #include "ssmserverpanic.h"
 #include "ssmswppolicyframe.h"
 #include "ssmswppolicyresolver.h"
@@ -33,6 +34,8 @@
 
 
 const TInt KTestInvalidPanicCategory = -988;
+// property uids should be real uids (use these temporarily for test purposes)
+const TUint key={0x01};
 _LIT(KSsmSwpPolicyServerName, "TestSsmSwpPolicyServer");
 
 //----------------------------------------------------------------------------------------------------------------
@@ -65,7 +68,7 @@
 	User::SetJustInTime(EFalse);
 	thread.Resume();
 	User::WaitForRequest(status);
-
+	
 	// always expecting a state transition engine panic
 	TExitCategoryName category = thread.ExitCategory();
 	if (category.Compare(KPanicSysStateMgr) != 0)
@@ -101,9 +104,6 @@
 	CleanupStack::PushL(sched);
 	CActiveScheduler::Install(sched);
 
-	// property uids should be real uids (use these temporarily for test purposes)
-	const TUint key={0x01};
-
 	// Create a swp policy resolver and register our property
 	CSsmSwpPolicyResolver* resolver = CSsmSwpPolicyResolver::NewL();
 	CleanupStack::PushL(resolver);
@@ -129,6 +129,7 @@
 
 	//Request transition according to the reason action, which will define the invalid list
 	const TSsmSwp swp(key, aSsmValidSwpListTest->Function());
+	
 	handler->SubmitRequestL(swp);
 
 	sched->Start();
@@ -200,10 +201,12 @@
 
 	__UHEAP_MARK;
 
+	TInt err = RProperty::Define(RProcess().SecureId(), key, RProperty::EInt);
+	TEST(err == KErrNone || err == KErrAlreadyExists);
 	INFO_PRINTF1(_L("Checking cmd list without a Publish System Swp command"));
 	TInt exitReason(0);
 	SetFunction(ESwpCmdWithoutPublishSwp);
-	TRAPD(err, exitReason = StartSwpInvalidListInThreadL(this));
+	TRAP(err, exitReason = StartSwpInvalidListInThreadL(this));
 	TEST(err == KErrNone);
 	INFO_PRINTF2(_L("    -- StartSwpInvalidListInThreadL method completed with '%d'."), err);
 	TEST(exitReason == ESwpTransitionEngineError16);
@@ -243,12 +246,13 @@
 	TEST(err == KErrNone);
 	INFO_PRINTF2(_L("    -- StartSwpInvalidListInThreadL method completed with '%d'."), err);
 	const TInt threadExitReason = iThread.ExitReason();
+	TBuf<16> threadExitCategory = iThread.ExitCategory();
 	// This is the exit reason for the ssmswppolicyserver
 	TEST(threadExitReason == KSsmTestAppRvError);
 	// this is the exit reason for the engine.
 	TEST(exitReason == ESwpTransitionEngineError20);
 	iThread.Close();
-	INFO_PRINTF3(_L("    -- received panic '%d', expected was '%d'."), threadExitReason, KSsmTestAppRvError);
+	INFO_PRINTF4(_L("    -- received panic '%d', category '%S', expected was '%d'."), threadExitReason, &threadExitCategory, KSsmTestAppRvError);
 
 	INFO_PRINTF1(_L("Checking cmd list with too many Multiple Wait command and and no deferred commands - Validation should be OK - Panic originates in HandleCleReturnValue returning an error"));
 	exitReason=0;
@@ -267,7 +271,9 @@
 	INFO_PRINTF2(_L("    -- StartSwpInvalidListInThreadL method completed with '%d'."), err);
 	TEST(exitReason == ESwpTransitionEngineError20);
 	INFO_PRINTF3(_L("    -- received panic '%d', expected was '%d'."), exitReason, ESwpTransitionEngineError20);
-
+	
+	err = RProperty::Delete(RProcess().SecureId(), key);
+	TEST(err == KErrNone);
 	__UHEAP_MARKEND;
 
 	// this test raises panics due to negative testing - close them to clear the screen.