sl@0: // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedAll sl@0: @interim sl@0: */ sl@0: sl@0: #ifndef __TMSMAIN_H__ sl@0: #define __TMSMAIN_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: enum TTestType{ENotifierNone,ENotifierHang,ENotifierRepeat,ENotifierWithRepeat}; sl@0: sl@0: GLREF_D RTest test; sl@0: sl@0: //forward declaration for all scsi protocol tests sl@0: GLDEF_C void t_scsi_prot(); sl@0: sl@0: sl@0: GLDEF_C void TestIfEqual( TInt aValue, TInt aExpected, TInt aLine, char aFileName[]); sl@0: #define TEST_FOR_VALUE( r, expected ) TestIfEqual( r, expected, __LINE__, __FILE__) sl@0: sl@0: #define TEST_SENSE_CODE( aSensePtr, aExpKey, aExtAddCode ) \ sl@0: { \ sl@0: TRequestSenseData senseDataErr (aSensePtr); \ sl@0: TEST_FOR_VALUE (senseDataErr.Key(), aExpKey); \ sl@0: TEST_FOR_VALUE (senseDataErr.AdditionalCode(), aExtAddCode);\ sl@0: } sl@0: sl@0: sl@0: #define TEST_SENSE_CODE_IF_SUPPORTED( aSensePtr, aExpKey, aExtAddCode ) \ sl@0: TRequestSenseData senseDataErr (aSensePtr); \ sl@0: TBool doit = ETrue; \ sl@0: if((senseDataErr.Key() == TSenseInfo::EIllegalRequest) && \ sl@0: (senseDataErr.AdditionalCode() == TSenseInfo::EInvalidCmdCode)) \ sl@0: { \ sl@0: RDebug::Print(_L("Prevent Media Removal command not supported by this build\n")); \ sl@0: doit = EFalse; \ sl@0: } \ sl@0: else \ sl@0: { \ sl@0: TEST_FOR_VALUE (senseDataErr.Key(), aExpKey); \ sl@0: TEST_FOR_VALUE (senseDataErr.AdditionalCode(), aExtAddCode); \ sl@0: } \ sl@0: if(doit) sl@0: sl@0: sl@0: #endif //__TMSMAIN_H__