1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/smassstorage/scsiprot/t_ms_main.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,65 @@
1.4 +// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @publishedAll
1.22 + @interim
1.23 +*/
1.24 +
1.25 +#ifndef __TMSMAIN_H__
1.26 +#define __TMSMAIN_H__
1.27 +
1.28 +#include <f32file.h>
1.29 +#include <e32test.h>
1.30 +#include <e32math.h>
1.31 +
1.32 +enum TTestType{ENotifierNone,ENotifierHang,ENotifierRepeat,ENotifierWithRepeat};
1.33 +
1.34 +GLREF_D RTest test;
1.35 +
1.36 +//forward declaration for all scsi protocol tests
1.37 +GLDEF_C void t_scsi_prot();
1.38 +
1.39 +
1.40 +GLDEF_C void TestIfEqual( TInt aValue, TInt aExpected, TInt aLine, char aFileName[]);
1.41 +#define TEST_FOR_VALUE( r, expected ) TestIfEqual( r, expected, __LINE__, __FILE__)
1.42 +
1.43 +#define TEST_SENSE_CODE( aSensePtr, aExpKey, aExtAddCode ) \
1.44 + { \
1.45 + TRequestSenseData senseDataErr (aSensePtr); \
1.46 + TEST_FOR_VALUE (senseDataErr.Key(), aExpKey); \
1.47 + TEST_FOR_VALUE (senseDataErr.AdditionalCode(), aExtAddCode);\
1.48 + }
1.49 +
1.50 +
1.51 +#define TEST_SENSE_CODE_IF_SUPPORTED( aSensePtr, aExpKey, aExtAddCode ) \
1.52 + TRequestSenseData senseDataErr (aSensePtr); \
1.53 + TBool doit = ETrue; \
1.54 + if((senseDataErr.Key() == TSenseInfo::EIllegalRequest) && \
1.55 + (senseDataErr.AdditionalCode() == TSenseInfo::EInvalidCmdCode)) \
1.56 + { \
1.57 + RDebug::Print(_L("Prevent Media Removal command not supported by this build\n")); \
1.58 + doit = EFalse; \
1.59 + } \
1.60 + else \
1.61 + { \
1.62 + TEST_FOR_VALUE (senseDataErr.Key(), aExpKey); \
1.63 + TEST_FOR_VALUE (senseDataErr.AdditionalCode(), aExtAddCode); \
1.64 + } \
1.65 + if(doit)
1.66 +
1.67 +
1.68 +#endif //__TMSMAIN_H__