messagingfw/msgtestfw/TestActions/Base/src/CMtfTestActionGetArrayCount.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2003-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 // __ACTION_INFO_BEGIN__ 
       
    15 // [Action Name]
       
    16 // GetArrayCount
       
    17 // [Action Parameters]
       
    18 // CMsvEntrySelection  selection      <input>: Reference to the entry selection.
       
    19 // TInt                result         <output-initiation>: Value of the Number of children.
       
    20 // [Action Description]
       
    21 // Returns the number of messages in a given selection.
       
    22 // [APIs Used]
       
    23 // none.
       
    24 // __ACTION_INFO_END__
       
    25 // 
       
    26 //
       
    27 
       
    28 /**
       
    29  @file
       
    30 */
       
    31 
       
    32 #include <msvstd.h>
       
    33 
       
    34 #include "CMtfTestActionGetArrayCount.h"
       
    35 #include "CMtfTestCase.h"
       
    36 #include "CMtfTestActionParameters.h"
       
    37 
       
    38 
       
    39 CMtfTestAction* CMtfTestActionGetArrayCount::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    40 	{
       
    41 	CMtfTestActionGetArrayCount* self = new (ELeave) CMtfTestActionGetArrayCount(aTestCase);
       
    42 	CleanupStack::PushL(self);
       
    43 	self->ConstructL(aActionParameters);
       
    44 	CleanupStack::Pop();
       
    45 	return self;
       
    46 	}
       
    47 	
       
    48 
       
    49 CMtfTestActionGetArrayCount::CMtfTestActionGetArrayCount(CMtfTestCase& aTestCase)
       
    50 	: CMtfSynchronousTestAction(aTestCase)
       
    51 	{
       
    52 	}
       
    53 
       
    54 
       
    55 CMtfTestActionGetArrayCount::~CMtfTestActionGetArrayCount()
       
    56 	{
       
    57 	}
       
    58 
       
    59 
       
    60 void CMtfTestActionGetArrayCount::ExecuteActionL()
       
    61 	{
       
    62     TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionGetArrayCount);
       
    63 	CMsvEntrySelection* paramSelection = ObtainParameterReferenceL<CMsvEntrySelection>(TestCase(),ActionParameters().Parameter(0));
       
    64 	TInt totalChildren = paramSelection->Count();
       
    65 	StoreParameterL<TInt>(TestCase(),totalChildren,ActionParameters().Parameter(1));
       
    66 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionGetArrayCount);
       
    67 	TestCase().ActionCompletedL(*this);
       
    68 	}