common/tools/ats/smoketest/graphics/wserv/src/T_DataWsGraphicMsgBuf.cpp
author victorp@symbian.org
Wed, 03 Feb 2010 16:06:24 +0000
changeset 872 17498133d9ad
parent 833 6ffc235847d0
permissions -rw-r--r--
adding EPL headers to smoke test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
/*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 833
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 833
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
* Contributors:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
* Description:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
#include "T_DataWsGraphicMsgBuf.h"
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
/*@{*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
//Parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
_LIT(KExpected,					"expected");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
_LIT(KInputTypeId,				"inputTypeId");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
_LIT(KInputText,				"inputText");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
_LIT(KInputUseText8,			"inputUseText8");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
_LIT(KInputMsgLen,				"inputMsgLen");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
_LIT(KInputMsgPosition,			"inputMsgPosition");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
_LIT(KInputFormat,				"inputFormat");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
//Commands
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
_LIT(KCmdnew,					"new");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
_LIT(KCmdClose,					"Close");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
_LIT(KCmdCleanupClosePushL,		"CleanupClosePushL");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
_LIT(KCmdAppend,				"Append");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
_LIT(KCmdRemove,				"Remove");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
_LIT(KCmdCount,					"Count");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
_LIT(KCmdTypeId,				"TypeId");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
_LIT(KCmdData,					"Data");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
_LIT(KCmdGetFixedMsg,			"GetFixedMsg");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
_LIT(KCmdPckg,					"Pckg");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
/*@}*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
//////////////////////////////////////////////////////////////////////
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
// Construction/Destruction
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
//////////////////////////////////////////////////////////////////////
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
CT_DataWsGraphicMsgBuf* CT_DataWsGraphicMsgBuf::NewL()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
    {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
    CT_DataWsGraphicMsgBuf*    ret=new (ELeave) CT_DataWsGraphicMsgBuf();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
    CleanupStack::PushL(ret);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
    ret->ConstructL();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
    CleanupStack::Pop(ret);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
    return ret;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
    }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
CT_DataWsGraphicMsgBuf::CT_DataWsGraphicMsgBuf()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
:    CDataWrapperBase()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
,    iWsGraphicMsgBuf(NULL)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
    {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
    }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
void CT_DataWsGraphicMsgBuf::ConstructL()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
    {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
    }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
CT_DataWsGraphicMsgBuf::~CT_DataWsGraphicMsgBuf()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
    {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
    DestroyData();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
    }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
void CT_DataWsGraphicMsgBuf::SetObjectL(TAny* aAny)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
    {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
    DestroyData();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
    iWsGraphicMsgBuf = static_cast<RWsGraphicMsgBuf*> (aAny);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
    }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
void CT_DataWsGraphicMsgBuf::DisownObjectL()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
	iWsGraphicMsgBuf = NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
void CT_DataWsGraphicMsgBuf::DestroyData()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
    {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
    delete iWsGraphicMsgBuf;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
    iWsGraphicMsgBuf=NULL;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
    }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
/**
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
* Process a command read from the ini file
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
* @param aCommand			the command to process
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
* @param aSection			the entry in the ini file requiring the command to be processed
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
* @param aAsyncErrorIndex	index of command. used for async calls
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
* @return ETrue if the command is processed
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
TBool CT_DataWsGraphicMsgBuf::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
    {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
    TBool    ret = ETrue;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
    if ( aCommand==KCmdnew )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
        DoCmdnew();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
    else if ( aCommand==KCmdClose )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
        DoCmdClose();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
    else if ( aCommand==KCmdCleanupClosePushL )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
        DoCmdCleanupClosePushL();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
    else if ( aCommand==KCmdAppend )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
        DoCmdAppendL(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
    else if ( aCommand==KCmdRemove )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
        DoCmdRemove(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
    else if ( aCommand==KCmdCount )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
        DoCmdCount(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
    else if ( aCommand==KCmdTypeId )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
        DoCmdTypeId(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
    else if ( aCommand==KCmdData )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
        DoCmdDataL(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
    else if( aCommand==KCmdGetFixedMsg)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
		DoCmdGetFixedMsg(aSection);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
    else if ( aCommand==KCmdPckg )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
        DoCmdPckg();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
    else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
        {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
        ret=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
        }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
    return ret;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
    }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
void CT_DataWsGraphicMsgBuf::DoCmdnew()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
    {
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
	DestroyData();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
	TRAPD(err,	iWsGraphicMsgBuf =	new	(ELeave) RWsGraphicMsgBuf());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
	if(err	!= KErrNone)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
		ERR_PRINTF2(_L("**** RWsGraphicMsgBuf	Constructor	failed	with error %d"), err);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
		SetError(err);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
	INFO_PRINTF1(_L("RWsGraphicMsgBuf::RWsGraphicMsgBuf"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
void CT_DataWsGraphicMsgBuf::DoCmdClose()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
	iWsGraphicMsgBuf->Close();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
	INFO_PRINTF1(_L("RWsGraphicMsgBuf::Close"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
    }
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
void CT_DataWsGraphicMsgBuf::DoCmdCleanupClosePushL()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
	iWsGraphicMsgBuf->CleanupClosePushL();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
	CleanupStack::PopAndDestroy(iWsGraphicMsgBuf);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
	INFO_PRINTF1(_L("RWsGraphicMsgBuf::CleanupClosePushL"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
void CT_DataWsGraphicMsgBuf::DoCmdAppendL(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
    {		
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
	TInt	err=KErrNone;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
	TInt	inputTypeId=0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
	if(	GetIntFromConfig(aSection, KInputTypeId(), inputTypeId))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
		TUid	uid = TUid::Uid(inputTypeId);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
		TPtrC 	inputStr;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
		if( !GetStringFromConfig(aSection, KInputText(), inputStr) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
			ERR_PRINTF2(_L("Missing parameter %S"), &KInputText());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
		else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
			TBool useBuf8=EFalse;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
			GetBoolFromConfig(aSection, KInputUseText8(), useBuf8);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
			if ( useBuf8 )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
				TInt		inputMsgLen=0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
				HBufC8*		tempStr = HBufC8::NewLC(inputStr.Length());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
				tempStr->Des().Copy(inputStr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
				if(	GetIntFromConfig(aSection, KInputMsgLen(), inputMsgLen))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
					{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
					// Test iWsGraphicMsgBuf->Append(TUid aTypeId, TInt aLen, TPtr8 &aPtr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
					TPtr8		tempInputStr(tempStr->Des());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
					err = iWsGraphicMsgBuf->Append(uid, inputMsgLen, tempInputStr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
					INFO_PRINTF1(_L("RWsGraphicMsgBuf::Append  (TPtr8)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
					}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
				else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
					{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
					// Test iWsGraphicMsgBuf->Append(TUid aTypeId, const TDesC8 &aData);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
					err	= iWsGraphicMsgBuf->Append(uid,	*tempStr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
					INFO_PRINTF1(_L("RWsGraphicMsgBuf::Append  (TDesC8)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
					}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
				CleanupStack::PopAndDestroy(tempStr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
			else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
				//  Test iWsGraphicMsgBuf->Append(TUid aTypeId, const TDesC16 &aData);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
				err	= iWsGraphicMsgBuf->Append(uid,	inputStr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
				INFO_PRINTF1(_L("RWsGraphicMsgBuf::Append (TDesC16)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   222
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   223
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
		TWsGraphicFrameRate		frameRate;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
		err	= iWsGraphicMsgBuf->Append(frameRate);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
		INFO_PRINTF1(_L("RWsGraphicMsgBuf::Append	(TWsGraphicMsgFixedBase)"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
		
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
	if(err != KErrNone)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
		ERR_PRINTF2(_L("**** Append failed with error %d"),	err);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
		SetError(err);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   234
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   235
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
void CT_DataWsGraphicMsgBuf::DoCmdRemove(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   239
	TInt	inputMsgPosition=0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
	if(	GetIntFromConfig(aSection, KInputMsgPosition(), inputMsgPosition))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
		iWsGraphicMsgBuf->Remove(inputMsgPosition);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
		INFO_PRINTF1(_L("RWsGraphicMsgBuf::Remove"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   244
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
		ERR_PRINTF2(_L("Missing parameter %S"), &KInputMsgPosition());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
    	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
void CT_DataWsGraphicMsgBuf::DoCmdCount(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
	TInt	actual = iWsGraphicMsgBuf->Count();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
	INFO_PRINTF2(_L("RWsGraphicMsgBuf::Count = %d"), actual);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   256
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   257
	TInt	expected = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
	if(	GetIntFromConfig(aSection, KExpected(), expected))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   260
		if( actual != expected )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   261
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
			ERR_PRINTF1(_L("Count is not as expected!"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   266
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   268
		ERR_PRINTF2(_L("Missing parameter %S"), &KExpected());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   269
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
void CT_DataWsGraphicMsgBuf::DoCmdTypeId(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
	TInt	inputMsgPosition=0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
	if(	GetIntFromConfig(aSection, KInputMsgPosition(), inputMsgPosition))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
		TUid	actual = iWsGraphicMsgBuf->TypeId(inputMsgPosition);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
		INFO_PRINTF2(_L("RWsGraphicMsgBuf::TypeId = %d"), actual.iUid);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
		TInt	expected = 0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
		if(	GetIntFromConfig(aSection, KExpected(), expected))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
			TUid	expectedUid = TUid::Uid(expected);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
			if( actual != expectedUid )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   287
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   288
				ERR_PRINTF1(_L("TypeId is not as expected!"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   289
				SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   290
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   291
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   292
		else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   293
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   294
			ERR_PRINTF2(_L("Missing parameter %S"), &KExpected());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   295
			SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   296
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   297
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   298
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
		ERR_PRINTF2(_L("Missing parameter %S"), &KInputMsgPosition());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   304
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   305
void CT_DataWsGraphicMsgBuf::DoCmdDataL(const TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   306
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
	TInt     inputMsgPosition=0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
	if( !GetIntFromConfig(aSection, KInputMsgPosition(), inputMsgPosition) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   309
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   310
		ERR_PRINTF2(_L("Missing parameter %S"), &KInputMsgPosition());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   311
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   313
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   314
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   315
		TPtrC     format;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   316
		if( GetStringFromConfig(aSection, KInputFormat(), format) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   317
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   318
			//     Test modifiable Data
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   319
			TPtr8     actual=iWsGraphicMsgBuf->Data(inputMsgPosition);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   320
			HBufC*    buffer=HBufC::NewLC(actual.Length());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   321
			TPtr      bufferPtr=buffer->Des();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   322
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   323
			bufferPtr.Copy(actual);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   324
			INFO_PRINTF1(_L("RWsGraphicMsgBuf::Data ="));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   325
			INFO_PRINTF1(bufferPtr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   326
			bufferPtr.Format(format, &bufferPtr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   327
			actual.Copy(bufferPtr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   328
			CleanupStack::PopAndDestroy(buffer);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   329
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   330
		else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   331
			{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   332
			//     Test non-modifiable Data
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   333
			const RWsGraphicMsgBuf*	wsGraphicMsgBuf=iWsGraphicMsgBuf;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   334
			TPtrC8					actual=wsGraphicMsgBuf->Data(inputMsgPosition);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   335
			HBufC*					buffer=HBufC::NewLC(actual.Length());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   336
			TPtr					bufferPtr=buffer->Des();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   337
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   338
			bufferPtr.Copy(actual);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   339
			INFO_PRINTF1(_L("RWsGraphicMsgBuf::Data ="));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   340
			INFO_PRINTF1(bufferPtr);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   341
			TPtrC     expected;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   342
			if( !GetStringFromConfig(aSection, KExpected(), expected) )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   343
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   344
				ERR_PRINTF2(_L("Missing parameter %S"), &KInputMsgPosition());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   345
				SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   346
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   347
			 else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   348
				{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   349
				if( bufferPtr!=expected )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   350
					{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   351
					ERR_PRINTF1(_L("Data is not as expected!"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   352
					SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   353
					}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   354
				}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   355
				CleanupStack::PopAndDestroy(buffer);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   356
			}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   357
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   358
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   359
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   360
void CT_DataWsGraphicMsgBuf::DoCmdGetFixedMsg(const	TDesC& aSection)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   361
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   362
	TInt	inputMsgPosition=0;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   363
	if(	GetIntFromConfig(aSection, KInputMsgPosition(), inputMsgPosition))
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   364
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   365
		TWsGraphicFrameRate		frameRate;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   366
		iWsGraphicMsgBuf->GetFixedMsg(frameRate, inputMsgPosition);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   367
		INFO_PRINTF1(_L("RWsGraphicMsgBuf::GetFixedMsg"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   368
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   369
	else
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   370
		{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   371
		ERR_PRINTF2(_L("Missing parameter	%S"), &KInputMsgPosition());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   372
		SetBlockResult(EFail);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   373
		}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   374
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   375
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   376
void CT_DataWsGraphicMsgBuf::DoCmdPckg()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   377
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   378
	TBuf8<KMaxTestExecuteCommandLength>		msg;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   379
	msg = iWsGraphicMsgBuf->Pckg();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   380
	INFO_PRINTF1(_L("RWsGraphicMsgBuf::Pckg"));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   381
	}