os/kernelhwsrv/kerneltest/f32test/smassstorage/scsiprot/t_ms_main.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 1994-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 the License "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  @publishedAll
    19  @interim
    20 */
    21 
    22 #ifndef __TMSMAIN_H__
    23 #define __TMSMAIN_H__
    24 
    25 #include <f32file.h>
    26 #include <e32test.h>
    27 #include <e32math.h>
    28 
    29 enum TTestType{ENotifierNone,ENotifierHang,ENotifierRepeat,ENotifierWithRepeat};
    30 
    31 GLREF_D RTest test;
    32 
    33 //forward declaration for all scsi protocol tests
    34 GLDEF_C void t_scsi_prot();
    35 
    36 
    37 GLDEF_C void TestIfEqual( TInt aValue, TInt aExpected, TInt aLine, char aFileName[]);
    38 #define TEST_FOR_VALUE( r, expected ) TestIfEqual( r, expected, __LINE__, __FILE__)
    39 
    40 #define TEST_SENSE_CODE( aSensePtr, aExpKey, aExtAddCode ) 		\
    41 	{															\
    42 	TRequestSenseData senseDataErr (aSensePtr);					\
    43 	TEST_FOR_VALUE (senseDataErr.Key(), 			aExpKey);	\
    44 	TEST_FOR_VALUE (senseDataErr.AdditionalCode(), 	aExtAddCode);\
    45 	}
    46 
    47 
    48 #define TEST_SENSE_CODE_IF_SUPPORTED( aSensePtr, aExpKey, aExtAddCode ) 			\
    49 	TRequestSenseData senseDataErr (aSensePtr);										\
    50 	TBool doit = ETrue;																\
    51 	if((senseDataErr.Key() == TSenseInfo::EIllegalRequest) &&						\
    52 	   (senseDataErr.AdditionalCode() == TSenseInfo::EInvalidCmdCode))				\
    53 		{																			\
    54 		RDebug::Print(_L("Prevent Media Removal command not supported by this build\n"));	\
    55 		doit = EFalse;																\
    56 		}																			\
    57 	else																			\
    58 		{																			\
    59 		TEST_FOR_VALUE (senseDataErr.Key(), 			aExpKey);					\
    60 		TEST_FOR_VALUE (senseDataErr.AdditionalCode(), 	aExtAddCode);				\
    61 		}																			\
    62 	if(doit)
    63 
    64 
    65 #endif //__TMSMAIN_H__