mobilemessaging/smsmtm/clientmtm/test/src/smcmstepquerycapabilities.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2005-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 // KUidMtmQuerySupportedBody, KUidMtmQueryCanSendMsg, KUidMtmQueryCanReceiveMsg, 
       
    15 // KUidMtmQueryMaxRecipientCount, KUidMsvMtmQueryEditorUid, KUidMsvQuerySupportsBioMsg and 
       
    16 // KUidMsvQuerySupportsScheduling should be supported, others should return KErrNotSupported.
       
    17 // 
       
    18 //
       
    19 
       
    20 /**
       
    21  @SYMTestCaseID MSG-SMSCLIENTMTM-0243-3
       
    22  @SYMTestType UT
       
    23  @SYMTestPriority High
       
    24  @SYMPREQ unknown
       
    25  @SYMTestCaseDesc Query the capabilities of the SMS service (test ported from T_SMCM1)
       
    26  @SYMTestActions  Query different capabilities of the SMS service
       
    27  @SYMTestExpectedResults capabilities KUidMtmQueryMaxBodySize, KUidMtmQueryMaxTotalMsgSize, 
       
    28 */
       
    29 
       
    30 
       
    31 #include "smcmstepquerycapabilities.h"
       
    32 
       
    33 #include <mtmuids.h>
       
    34 
       
    35 const TUid KUidSmcmTestNonSense = { 0x00011111 };
       
    36 
       
    37 CSMCMStepQueryCapabilities::CSMCMStepQueryCapabilities( )
       
    38 	{
       
    39 	SetTestStepName( KSMCMStepQueryCapabilities );	
       
    40 	}
       
    41 	
       
    42 CSMCMStepQueryCapabilities::~CSMCMStepQueryCapabilities( )
       
    43 	{
       
    44 	
       
    45 	}
       
    46 	
       
    47 TVerdict CSMCMStepQueryCapabilities::doTestStepL( )
       
    48 	{
       
    49 	INFO_PRINTF1( _L( "CSMCMStepQueryCapabilities::doTestStepL( )" ) );
       
    50 	
       
    51 	SetTestStepResult( EPass );
       
    52 		
       
    53     TInt response;
       
    54 	TUint32 errorMask = 0;
       
    55 
       
    56 	if( iSmsClientMtm->QueryCapability( KUidMtmQueryMaxBodySize, response ) != KErrNone )
       
    57 		{
       
    58 		SetTestStepResult( EFail );
       
    59 		errorMask |= 0x1;
       
    60 		}
       
    61 		
       
    62 	if( iSmsClientMtm->QueryCapability( KUidMtmQueryMaxTotalMsgSize, response ) != KErrNone )
       
    63 		{
       
    64 		SetTestStepResult( EFail );
       
    65 		errorMask |= 0x2;
       
    66 		}
       
    67 		
       
    68 	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySupportedBody, response ) != KErrNone )
       
    69 		{
       
    70 		SetTestStepResult( EFail );
       
    71 		errorMask |= 0x4;
       
    72 		}
       
    73 	if( response != KMtm7BitBody + KMtm8BitBody + KMtm16BitBody )
       
    74 		{
       
    75 		SetTestStepResult( EFail );
       
    76 		errorMask |= 0x4;
       
    77 		}
       
    78 
       
    79 	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySupportAttachments, response ) != KErrNotSupported )
       
    80 		{
       
    81 		SetTestStepResult( EFail ); 
       
    82 		errorMask |= 0x8;
       
    83 		}
       
    84 	if( !response )
       
    85 		{
       
    86 		SetTestStepResult( EFail );
       
    87 		errorMask |= 0x8;
       
    88 		}
       
    89 
       
    90 	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySupportSubject, response ) != KErrNotSupported )
       
    91 		{
       
    92 		SetTestStepResult( EFail );
       
    93 		errorMask |= 0x10;
       
    94 		}
       
    95 	if( !response )
       
    96 		{
       
    97 		SetTestStepResult( EFail );
       
    98 		errorMask |= 0x10;
       
    99 		}
       
   100 
       
   101 	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySupportsFolder, response ) != KErrNotSupported )
       
   102 		{
       
   103 		SetTestStepResult( EFail );
       
   104 		errorMask |= 0x20;
       
   105 		}
       
   106 	if( !response )
       
   107 		{
       
   108 		SetTestStepResult( EFail );
       
   109 		errorMask |= 0x20;
       
   110 		}
       
   111 
       
   112 	if( iSmsClientMtm->QueryCapability( KUidMtmQueryOffLineAllowed, response ) != KErrNotSupported )
       
   113 		{
       
   114 		SetTestStepResult( EFail );
       
   115 		errorMask |= 0x40;
       
   116 		}
       
   117 	if( !response )
       
   118 		{
       
   119 		SetTestStepResult( EFail );
       
   120 		errorMask |= 0x40;
       
   121 		}
       
   122 
       
   123 	if( iSmsClientMtm->QueryCapability( KUidMtmQueryCanSendMsg, response ) != KErrNone )
       
   124 		{
       
   125 		SetTestStepResult( EFail );
       
   126 		errorMask |= 0x80;
       
   127 		}
       
   128 	if( !response )
       
   129 		{
       
   130 		SetTestStepResult( EFail );
       
   131 		errorMask |= 0x80;
       
   132 		}
       
   133 
       
   134 	if( iSmsClientMtm->QueryCapability( KUidMtmQueryCanReceiveMsg, response ) != KErrNone )
       
   135 		{
       
   136 		SetTestStepResult( EFail );
       
   137 		errorMask |= 0x100;
       
   138 		}
       
   139 	if( !response )
       
   140 		{
       
   141 		SetTestStepResult( EFail );
       
   142 		errorMask |= 0x100;
       
   143 		}
       
   144 
       
   145 	if( iSmsClientMtm->QueryCapability( KUidMtmQueryMaxRecipientCount, response ) != KErrNone )
       
   146 		{
       
   147 		SetTestStepResult( EFail );
       
   148 		errorMask |= 0x200;
       
   149 		}
       
   150 	if( response != -1 )
       
   151 		{
       
   152 		SetTestStepResult( EFail );
       
   153 		errorMask |= 0x200;
       
   154 		}
       
   155 
       
   156 	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySendAsRequiresRenderedImage, response ) != KErrNotSupported )
       
   157 		{
       
   158 		SetTestStepResult( EFail );
       
   159 		errorMask |= 0x400;
       
   160 		}
       
   161 	if(!response)
       
   162 		{
       
   163 		SetTestStepResult( EFail );
       
   164 		errorMask |= 0x400;
       
   165 		}
       
   166 
       
   167 	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySendAsRenderingUid, response ) != KErrNotSupported )
       
   168 		{
       
   169 		SetTestStepResult( EFail );
       
   170 		errorMask |= 0x800;
       
   171 		}
       
   172 	if( !response )
       
   173 		{
       
   174 		SetTestStepResult( EFail );
       
   175 		errorMask |= 0x800;
       
   176 		}
       
   177 
       
   178 	if( iSmsClientMtm->QueryCapability( KUidMsvMtmQueryEditorUid, response ) != KErrNone )
       
   179 		{
       
   180 		SetTestStepResult( EFail );
       
   181 		errorMask |= 0x1000;
       
   182 		}
       
   183 	if( response != 268441151 ) // 0x1000163f in hex form
       
   184 		{
       
   185 		SetTestStepResult( EFail );
       
   186 		errorMask |= 0x1000;
       
   187 		}
       
   188 
       
   189 	if( iSmsClientMtm->QueryCapability( KUidMsvQuerySupportsBioMsg, response ) != KErrNone )
       
   190 		{
       
   191 		SetTestStepResult( EFail );
       
   192 		errorMask |= 0x2000;
       
   193 		}
       
   194 	if( !response )
       
   195 		{
       
   196 		SetTestStepResult( EFail );
       
   197 		errorMask |= 0x2000;
       
   198 		}
       
   199 
       
   200 	if( iSmsClientMtm->QueryCapability( KUidMsvQuerySupportsScheduling, response ) != KErrNone )
       
   201 		{
       
   202 		SetTestStepResult( EFail );
       
   203 		errorMask |= 0x4000;
       
   204 		}
       
   205 	if( !response )
       
   206 		{
       
   207 		SetTestStepResult( EFail );
       
   208 		errorMask |= 0x4000;
       
   209 		}
       
   210 
       
   211 	if( iSmsClientMtm->QueryCapability( KUidSmcmTestNonSense, response ) != KErrNotSupported )
       
   212 		{
       
   213 		SetTestStepResult( EFail );
       
   214 		errorMask |= 0x8000;
       
   215 		}
       
   216 	if( !response )	
       
   217 		{
       
   218 		SetTestStepResult( EFail );
       
   219 		errorMask |= 0x8000;
       
   220 		}
       
   221 
       
   222 	if ( errorMask != 0 )
       
   223 		{
       
   224 		ERR_PRINTF2( _L( "SMCMStepQuery Failed. ErrorMask = %x" ),errorMask);
       
   225 		INFO_PRINTF1( _L( "Bit 1:KUidMtmQueryMaxBodySize" ));
       
   226 		INFO_PRINTF1( _L( "Bit 2:KUidMtmQueryMaxTotalMsgSize" ));
       
   227 		INFO_PRINTF1( _L( "Bit 3:KUidMtmQuerySupportedBody" ));
       
   228 		INFO_PRINTF1( _L( "Bit 4:KUidMtmQuerySupportAttachments" ));
       
   229 		INFO_PRINTF1( _L( "Bit 5:KUidMtmQuerySupportSubject" ));
       
   230 		INFO_PRINTF1( _L( "Bit 6:KUidMtmQuerySupportsFolder" ));
       
   231 		INFO_PRINTF1( _L( "Bit 7:KUidMtmQueryOffLineAllowed" ));
       
   232 		INFO_PRINTF1( _L( "Bit 8:KUidMtmQueryCanSendMsg" ));
       
   233 		INFO_PRINTF1( _L( "Bit 9:KUidMtmQueryCanReceiveMsg" ));
       
   234 		INFO_PRINTF1( _L( "Bit 10:KUidMtmQueryMaxRecipientCount" ));
       
   235 		INFO_PRINTF1( _L( "Bit 11:KUidMtmQuerySendAsRequiresRenderedImage" ));
       
   236 		INFO_PRINTF1( _L( "Bit 12:KUidMtmQuerySendAsRenderingUid" ));
       
   237 		INFO_PRINTF1( _L( "Bit 13:KUidMsvMtmQueryEditorUid" ));
       
   238 		INFO_PRINTF1( _L( "Bit 14:KUidMsvQuerySupportsBioMsg" ));
       
   239 		INFO_PRINTF1( _L( "Bit 15:KUidMsvQuerySupportsScheduling" ));
       
   240 		INFO_PRINTF1( _L( "Bit 16:KUidSmcmTestNonSense" ));
       
   241 		}
       
   242 
       
   243 	return TestStepResult( );
       
   244 	
       
   245 	}