os/security/cryptoservices/filebasedcertificateandkeystores/test/tfiletokens/CServerOOMTestRunner.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 #include "CServerOOMTestRunner.h"
    20 #include "t_output.h"
    21 
    22 _LIT(KTFileTokens, "t_filetokens");
    23 
    24 CServerOOMTestRunner::CServerOOMTestRunner(Output& aOut) :
    25 	COOMTestRunnerBase(aOut)
    26 	{
    27 	}
    28 
    29 CServerOOMTestRunner::~CServerOOMTestRunner()
    30 	{
    31 	iClient.Close();
    32 	}
    33 
    34 void CServerOOMTestRunner::StartOOMTestL()
    35 	{
    36 	User::LeaveIfError(iClient.Connect(EFileKeyStore));
    37 	SendRequest(EStartOOMTest);
    38 	}
    39 
    40 void CServerOOMTestRunner::IncHeapFailPoint()
    41 	{
    42 	SendRequest(EIncHeapFailPoint);
    43 	}
    44 
    45 void CServerOOMTestRunner::ResetHeapFail()
    46 	{
    47 	SendRequest(EResetHeapFail);
    48 	}
    49 
    50 TInt CServerOOMTestRunner::AllocCount()
    51 	{
    52 	return SendRequest(EAllocCount);
    53 	}
    54 
    55 void CServerOOMTestRunner::EndOOMTestL()
    56 	{
    57 	iClient.Close();
    58 	}
    59 
    60 TInt CServerOOMTestRunner::SendRequest(TFSTokenMessages aFunction)
    61 	{
    62 	TInt r = iClient.SendRequest(aFunction, TIpcArgs());
    63 	__ASSERT_ALWAYS(r >= 0, User::Panic(KTFileTokens, 1));
    64 	return r;
    65 	}