sysstatemgmt/systemstatemgr/test/tsus/src/tsus_ssmsuscli.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code 
       
    20 */
       
    21 
       
    22 
       
    23 #include "tsus_ssmsuscli.h"
       
    24 #include "susutilclisrv.h"
       
    25 
       
    26 TInt RSsmSusCliTest::Connect(const TDesC& aServerName, TBool aHeapCheck)
       
    27 	{
       
    28 	return Connect(aServerName, Version(), -1, aHeapCheck);
       
    29 	}
       
    30 
       
    31 TInt RSsmSusCliTest::Connect(const TDesC& aServerName, TVersion aVersion, TInt aAsyncMessageSlots, TBool aHeapCheck)
       
    32 	{
       
    33 	TInt ret = DoConnect(aServerName, aVersion, aAsyncMessageSlots);
       
    34 	if(aHeapCheck && (ret == KErrNone))
       
    35 	{
       
    36 		ret = HeapMark();
       
    37 	}
       
    38 	return ret;
       
    39 	} //lint !e1746 Suppress parameter 'aVersion' could be made const reference
       
    40 
       
    41 TInt RSsmSusCliTest::SendAnyrequest()
       
    42 	{
       
    43 	return SendReceive(KSusUtilServFirstUsedOpCode);
       
    44 	}
       
    45 
       
    46 TInt RSsmSusCliTest::Shutdown()
       
    47 	{
       
    48 	return SendReceive(EEndOfSusUtilOpCodes);
       
    49 	}
       
    50 
       
    51 void RSsmSusCliTest::Close(TBool aCheckHeap)
       
    52 	{
       
    53 	if(aCheckHeap)
       
    54 		{
       
    55 		TInt ret = CompressPluginArray();
       
    56 		__ASSERT_DEBUG(ret == KErrNone, User::Panic(_L("RSsmSusCliTest"), ret));
       
    57 		ret = HeapMarkEnd();
       
    58 		__ASSERT_DEBUG(ret == KErrNone, User::Panic(_L("RSsmSusCliTest"), ret));
       
    59 		}
       
    60 	RSsmSusCli::Close();
       
    61 	}
       
    62 
       
    63 TInt RSsmSusCliTest::HeapMark()
       
    64 	{
       
    65 	TInt ret = KErrNone;
       
    66 	if(Handle())
       
    67 		{
       
    68 		ret = SendReceive(EDebugMarkHeap);
       
    69 		}
       
    70 	return ret;
       
    71 	} 
       
    72 
       
    73 TInt RSsmSusCliTest::HeapMarkEnd()
       
    74 	{
       
    75 	TInt ret = KErrNone;
       
    76 	if(Handle())
       
    77 		{
       
    78 		ret = SendReceive(EDebugMarkHeapEnd);
       
    79 		}
       
    80 	return ret;
       
    81 	} 
       
    82 
       
    83 TInt RSsmSusCliTest::CompressPluginArray()
       
    84 	{
       
    85 	TInt ret = KErrNone;
       
    86 	if(Handle())
       
    87 		{
       
    88 		ret = SendReceive(EDebugCompressPluginArray);
       
    89 		}
       
    90 	return ret;
       
    91 	}