本文整理汇总了C++中EFI_STANDARD_TEST_LIBRARY_PROTOCOL类的典型用法代码示例。如果您正苦于以下问题:C++ EFI_STANDARD_TEST_LIBRARY_PROTOCOL类的具体用法?C++ EFI_STANDARD_TEST_LIBRARY_PROTOCOL怎么用?C++ EFI_STANDARD_TEST_LIBRARY_PROTOCOL使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EFI_STANDARD_TEST_LIBRARY_PROTOCOL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BBTestLengthParameterAutoTest
//
// TDS
//
EFI_STATUS
BBTestLengthParameterAutoTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL *DriverSupportedEfiVersion;
EFI_TEST_ASSERTION AssertionType;
UINT32 EfiVersionProtocolLength;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"BS.HandleProtocol - Handle standard test library",
L"%a:%d:Status - %r",
__FILE__,
(UINTN)__LINE__,
Status
);
return Status;
}
DriverSupportedEfiVersion = (EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL *)ClientInterface;
EfiVersionProtocolLength =sizeof( EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL);
if(DriverSupportedEfiVersion->Length ==EfiVersionProtocolLength){
AssertionType = EFI_TEST_ASSERTION_PASSED;
}else{
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gDriverSupportedEfiVersionTestAssertionGuid001,
L"EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL.Length,compare with length of EfiVersionProtocol",
L"%a:%d: Length = %d, EfiVersionProtocolLength = %d, Expected=%r",
__FILE__,
(UINTN)__LINE__,
DriverSupportedEfiVersion->Length,
EfiVersionProtocolLength,
EFI_SUCCESS
);
return EFI_SUCCESS;
}
示例2: BBTestGetVersionConformanceTest
//
// TDS 4.3
//
EFI_STATUS
BBTestGetVersionConformanceTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_TEST_ASSERTION AssertionType;
EFI_EBC_PROTOCOL *EbcInterface;
//
// Verify whether it is one of IHV interfaces
//
if (! IsIhvInterface (ClientInterface, SupportHandle)) {
return EFI_UNSUPPORTED;
}
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if ( EFI_ERROR(Status) ) {
return Status;
}
//
// Get the EFI_EBC_PROTOCOL Protocol interface to be tested
//
EbcInterface = (EFI_EBC_PROTOCOL *)ClientInterface;
//
// 4.3.2.1 Call GetVersion() with Invalid Parameters
//
Status = EbcInterface->GetVersion(EbcInterface, NULL);
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gEbcBBTestConformanceAssertionGuid003,
L"EFI_EBC_PROTOCOL.GetVersion - Call GetVersion() with Invalid Parameters",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return EFI_SUCCESS;
}
示例3: BBTestGetVersionBasicTest
//
// TDS 3.4
//
EFI_STATUS
BBTestGetVersionBasicTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_TEST_ASSERTION AssertionType;
EFI_EBC_PROTOCOL *EbcInterface;
UINT64 Version;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
return Status;
}
//
// Get the EFI_EBC_PROTOCOL Protocol interface to be tested
//
EbcInterface = (EFI_EBC_PROTOCOL *)ClientInterface;
//
// 3.4.2.1 GetVersion() Basic Functionality
//
Status = EbcInterface->GetVersion (EbcInterface, &Version);
if (Status == EFI_SUCCESS) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gEbcBBTestFunctionAssertionGuid006,
L"EFI_EBC_PROTOCOL.GetVersion - Call GetVersion to get ebc interpreter version",
L"%a:%d:Status - %r, Version - 0x%lx",
__FILE__,
__LINE__,
Status,
Version
);
return EFI_SUCCESS;
}
示例4: BBTestMxCsrTest
/**
* @brief For Check the value of MX CSR test
* @param This a pointer of EFI_BB_TEST_PROTOCOL
* @param ClientInterface A pointer to the interface array under test
* @param TestLevel Test "thoroughness" control
* @param SupportHandle A handle containing protocols required
* @return EFI_SUCCESS
*/
EFI_STATUS
BBTestMxCsrTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_TEST_ASSERTION AssertionType;
UINT32 MxCsr;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR (Status)) {
return Status;
}
//
// record assertion for the returned MX CSR.
//
Status = GetMxCsr(&MxCsr);
if (MxCsr == MX_CSR_VALUE) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gBasicTestAssertionGuid002,
L"EFI_EXE_MODE - Get MX CSR",
L"%a:%d:MX CSR got %x",
__FILE__,
__LINE__,
MxCsr
);
//
//done successfully.
//
return EFI_SUCCESS;
}
示例5: DevicePathUtilitiesGetNextDevicePathInstanceConformanceTest
//
// TDS 3.4.5
//
EFI_STATUS
DevicePathUtilitiesGetNextDevicePathInstanceConformanceTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_DEVICE_PATH_UTILITIES_PROTOCOL *DevicePathUtilities;
EFI_TEST_ASSERTION AssertionType;
EFI_DEVICE_PATH_PROTOCOL *pDevicePath1;
EFI_DEVICE_PATH_PROTOCOL *pDevicePath2;
UINTN DevicePathInstanceSize;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR (Status)) {
return Status;
}
DevicePathUtilities = (EFI_DEVICE_PATH_UTILITIES_PROTOCOL *) ClientInterface;
//
// TDS 3.4.5.2.1
//
pDevicePath1 = NULL;
pDevicePath2 = DevicePathUtilities->GetNextDevicePathInstance (&pDevicePath1, &DevicePathInstanceSize);
if (pDevicePath2 == NULL) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gDevicePathUtilitiesBBTestFunctionAssertionGuid064,
L"EFI_DEVICE_PATH_UTILITIES_PROTOCOL - GetNextDevicePathInstance should not succeed with DevicePathInstance set to be NULL",
L"%a:%d:Status - %r",
__FILE__,
(UINTN)__LINE__
);
return EFI_SUCCESS;
}
示例6: BBTestUnloadImageConformanceTest
//
// TDS 4.2
//
EFI_STATUS
BBTestUnloadImageConformanceTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_TEST_ASSERTION AssertionType;
EFI_EBC_PROTOCOL *EbcInterface;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
return Status;
}
//
// Get the EFI_EBC_PROTOCOL Protocol interface to be tested
//
EbcInterface = (EFI_EBC_PROTOCOL *)ClientInterface;
//
// 4.2.2.1 Call UnloadImage() with Invalid Parameters
//
Status = EbcInterface->UnloadImage (EbcInterface, (EFI_HANDLE)((UINTN)gDummyImageHandle+1));
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gEbcBBTestConformanceAssertionGuid002,
L"EFI_EBC_PROTOCOL.UnloadImage - Call UnloadImage() with Invalid Parameters",
L"%a:%d:Status - %r",
__FILE__,
(UINTN)__LINE__,
Status
);
return EFI_SUCCESS;
}
示例7: BBTestGetTimeConsistencyTest
//
// TDS 3.1
//
EFI_STATUS
BBTestGetTimeConsistencyTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_TEST_ASSERTION AssertionType;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
return Status;
}
//
// 3.1.2.1 GetTime should not succeed when Time is NULL
//
// BUG:2744
Status = gtRT->GetTime (
NULL,
NULL
);
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gTimeServicesBBTestConformanceAssertionGuid001,
L"RT.GetTime - Time is NULL",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return EFI_SUCCESS;
}
示例8: DevicePathUtilitiesCreateDeviceNodeConformanceTest
//
// TDS 3.4.1
//
EFI_STATUS
DevicePathUtilitiesCreateDeviceNodeConformanceTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_DEVICE_PATH_UTILITIES_PROTOCOL *DevicePathUtilities;
EFI_TEST_ASSERTION AssertionType;
EFI_DEVICE_PATH_PROTOCOL *pDevicePath;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR (Status)) {
return Status;
}
DevicePathUtilities = (EFI_DEVICE_PATH_UTILITIES_PROTOCOL *) ClientInterface;
//
// TDS 3.4.1.2.1
//
pDevicePath = DevicePathUtilities->CreateDeviceNode (PCINodeType, PCINodeSubType, InvalidNodeLength);
if (pDevicePath == NULL) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gDevicePathUtilitiesBBTestFunctionAssertionGuid052,
L"EFI_DEVICE_PATH_UTILITIES_PROTOCOL - CreatDeviceNode should not succeed with invalid NodeLength set",
L"%a:%d:Status - %r",
__FILE__,
(UINTN)__LINE__
);
return EFI_SUCCESS;
}
示例9: DevicePathUtilitiesDuplicateDevicePathConformanceTest
EFI_STATUS
DevicePathUtilitiesDuplicateDevicePathConformanceTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_DEVICE_PATH_UTILITIES_PROTOCOL *DevicePathUtilities;
EFI_TEST_ASSERTION AssertionType;
EFI_DEVICE_PATH_PROTOCOL *pDevicePath;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR (Status)) {
return Status;
}
DevicePathUtilities = (EFI_DEVICE_PATH_UTILITIES_PROTOCOL *) ClientInterface;
pDevicePath = DevicePathUtilities->DuplicateDevicePath(NULL);
if (pDevicePath == NULL) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gDevicePathUtilitiesBBTestFunctionAssertionGuid071,
L"EFI_DEVICE_PATH_UTILITIES_PROTOCOL - DuplicateDevicePath() should return NULL if DevicePath is NULL",
L"%a:%d",
__FILE__,
(UINTN)__LINE__
);
return EFI_SUCCESS;
}
示例10: BBTestDevicePathNodeConformanceAutoTest
//
// TDS 3.1
//
EFI_STATUS
BBTestDevicePathNodeConformanceAutoTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_TEST_ASSERTION AssertionType;
UINT16 Type;
UINT16 SubType;
UINT16 Length;
MEMMAP_DEVICE_PATH *MemMap;
IPv4_DEVICE_PATH *IPv4;
IPv6_DEVICE_PATH *IPv6;
ATAPI_DEVICE_PATH *Atapi;
UART_DEVICE_PATH *Uart;
VENDOR_DEVICE_PATH *Vendor;
HARDDRIVE_DEVICE_PATH *Hd;
CHAR16 *DevStr;
//
// Verify whether it is one of IHV interfaces
//
if (! IsIhvInterface (ClientInterface, SupportHandle)) {
return EFI_UNSUPPORTED;
}
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"BS.HandleProtocol - Handle standard test library",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return Status;
}
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)ClientInterface;
DevStr = DevicePathToStr (DevicePath);
StandardLib->RecordMessage (
StandardLib,
EFI_VERBOSE_LEVEL_QUIET,
L"\nVerifying device path: %s\n",
DevStr
);
gtBS->FreePool (DevStr);
while (!IsDevicePathEnd (DevicePath)) {
Type = (UINT16)DevicePathType (DevicePath);
SubType = (UINT16)DevicePathSubType (DevicePath);
Length = (UINT16)DevicePathNodeLength (DevicePath);
//
// Assertion Point 3.1.2.2
// Check End of Hardware Device Path: End This Device Path
//
if ((Type == 0x7F || Type == 0xFF) && (SubType == 0x01)) {
if (Length == 4) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gDevicePathBBTestFunctionAssertionGuid001,
L"EFI_DEVICE_PATH_PROTOCOL - End of Hardware Device Path - End This Device Path",
L"%a:%d:Type - %d, Subtype - %d, Length - %d",
__FILE__,
__LINE__,
Type,
SubType,
Length
);
}
//
// Assertion Point 3.1.2.3
// Check Hardware Device Path: PCI Device Path
//.........这里部分代码省略.........
示例11: BBTestSetTimeConsistencyTest
//
// TDS 3.2
//
EFI_STATUS
BBTestSetTimeConsistencyTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_TEST_ASSERTION AssertionType;
EFI_TIME Time;
EFI_TIME OldTime;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
return Status;
}
//
// 3.2.2.1 SetTime should not succeed when a time field is out of range
//
Status = gtRT->GetTime (
&OldTime,
NULL
);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"RT.SetTime - GetTime",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
} else {
Time = OldTime;
Time.Year = 1997;
Status = gtRT->SetTime (
&Time
);
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gTimeServicesBBTestConformanceAssertionGuid002,
L"RT.SetTime - Time.Year is 1997",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
Time = OldTime;
Time.Year = 2100;
Status = gtRT->SetTime (
&Time
);
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gTimeServicesBBTestConformanceAssertionGuid003,
L"RT.SetTime - Time.Year is 2100",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
Time = OldTime;
Time.Year = (UINT16)-1;
Status = gtRT->SetTime (
&Time
);
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
//.........这里部分代码省略.........
示例12: BBTestResetTargetConformanceAutoTest
//
// TDS 4.4
//
EFI_STATUS
BBTestResetTargetConformanceAutoTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_SCSI_PASS_THRU_PROTOCOL *ScsiPassThru;
EFI_TEST_ASSERTION AssertionType;
UINT32 Target;
UINT64 Lun;
UINT32 NewTarget;
UINT64 NewLun;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"BS.HandleProtocol - Handle standard test library",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return Status;
}
ScsiPassThru = (EFI_SCSI_PASS_THRU_PROTOCOL *)ClientInterface;
//
// Assertion Point 4.4.2.1
// Call ResetTarget() with invalid Target and invalid Lun.
//
Status = GetScsiDevice (ScsiPassThru, &NewTarget, &NewLun);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"Can't Get any Scsi Device",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return EFI_UNSUPPORTED;
}
//
// Check point 1, call GetNextDevice with invalid Target.
//
Target = 0xEEEEEEEE;
Lun = NewLun;
Status = ScsiPassThru->ResetTarget (ScsiPassThru, Target, Lun);
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gScsiPassThruBBTestConformanceAssertionGuid011,
L"EFI_SCSI_PASS_THRU_PROTOCOL.ResetTarget - call ResetTarget with invalid Target.",
L"%a:%d:Status - %r, Target - %d, Lun - %ld",
__FILE__,
__LINE__,
Status,
Target,
Lun
);
//
// Check point 2, call GetNextDevice with invalid Lun.
//
Target = NewTarget;
Lun = 0xEEEEEEEE;
Status = ScsiPassThru->ResetTarget (ScsiPassThru, Target, Lun);
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
//.........这里部分代码省略.........
示例13: BBTestGetNextDeviceConformanceAutoTest
//
// TDS 4.1
//
EFI_STATUS
BBTestGetNextDeviceConformanceAutoTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_SCSI_PASS_THRU_PROTOCOL *ScsiPassThru;
EFI_TEST_ASSERTION AssertionType;
UINT32 Target;
UINT64 Lun;
UINT32 NewTarget;
UINT64 NewLun;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"BS.HandleProtocol - Handle standard test library",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return Status;
}
ScsiPassThru = (EFI_SCSI_PASS_THRU_PROTOCOL *)ClientInterface;
//
// Assertion Point 4.1.2.1
// Call GetNextDevice() with invalid parameter.
//
NewTarget = 0xFFFFFFFF;
//
// Get First Device Target and Lun.
//
Status = ScsiPassThru->GetNextDevice (ScsiPassThru, &NewTarget, &NewLun);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"EFI_SCSI_PASS_THRU_PROTOCOL.GetNextDevice",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return EFI_UNSUPPORTED;
}
//
// Check point 1, call GetNextDevice with invalid Target.
//
Target = 0xEEEEEEEE;
Lun = NewLun;
Status = ScsiPassThru->GetNextDevice (ScsiPassThru, &Target, &Lun);
if (Status == EFI_INVALID_PARAMETER) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gScsiPassThruBBTestConformanceAssertionGuid002,
L"EFI_SCSI_PASS_THRU_PROTOCOL.GetNextDevice - call GetNextDevice with invalid Target.",
L"%a:%d:Status - %r, Target - %d, Lun - %ld",
__FILE__,
__LINE__,
Status,
Target,
Lun
);
//
// Check point 2, call GetNextDevice with invalid Lun.
//
Target = NewTarget;
Lun = 0xEEEEEEEE;
//.........这里部分代码省略.........
示例14: BBTestFatToStrFunctionAutoTest
//
// TDS 4.1.5
//
EFI_STATUS
BBTestFatToStrFunctionAutoTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_UNICODE_COLLATION_PROTOCOL *UnicodeCollation;
UINTN Index;
UINTN FatSize;
EFI_TEST_ASSERTION AssertionType;
//
// Test Data
//
CHAR8 *TestData[] ={
"filename.c",
"longfilename.c",
"\x10\x11\x20\x22\x50\x51\x61\x62",
};
CHAR16 Result[MAX_SIZE_OF_STRING + 1];
//
// Verify whether it is one of IHV interfaces
//
if (! IsIhvInterface (ClientInterface, SupportHandle)) {
return EFI_UNSUPPORTED;
}
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"BS.HandleProtocol - Handle standard test library",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return Status;
}
UnicodeCollation = (EFI_UNICODE_COLLATION_PROTOCOL *)ClientInterface;
for (Index = 0; Index < sizeof (TestData) / sizeof (CHAR8*); Index++) {
//
// For each test data, test the FatToStr functionality.
//
//
// FatSize reflect length of TestData[Index] correctly
//
FatSize = GetStrLen8 (TestData[Index]);
UnicodeCollation->FatToStr (
UnicodeCollation,
FatSize,
TestData[Index],
Result
);
if (CheckFatToStr (TestData[Index], FatSize, Result) == TRUE) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gUnicodeCollationFunctionTestAssertionGuid007,
L"EFI_UNICODE_COLLATION_PROTOCOL.FatToStr - Verification of FatToStr interface",
L"%a:%d: Fat='%s', FatToStr='%s', FatSize=%d, StrSize=%d",
__FILE__,
__LINE__,
TestData[Index],
Result,
FatSize,
GetStrLen16 (Result)
//.........这里部分代码省略.........
示例15: BBTestGetDeviceTypeFunctionAutoTest
//
// TDS 3.1.1
//
EFI_STATUS
BBTestGetDeviceTypeFunctionAutoTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_SCSI_IO_PROTOCOL *ScsiIo;
EFI_TEST_ASSERTION AssertionType;
UINT8 DeviceType;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if ( EFI_ERROR(Status) ) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"BS.HandleProtocol - Handle standard test library",
L"%a:%d:Status - %r",
__FILE__,
(UINTN)__LINE__,
Status
);
return Status;
}
ScsiIo = (EFI_SCSI_IO_PROTOCOL *)ClientInterface;
//
// Assertion Point 3.1.1.2.1
// GetDeviceType should return EFI_SUCCESS with SCSI device correctly installed
//
Status = ScsiIo->GetDeviceType (ScsiIo, &DeviceType);
if (Status == EFI_SUCCESS) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gScsiIoBBTestFunctionAssertionGuid001,
L"EFI_SCSI_IO_PROTOCOL.GetDeviceType - Invoke GetDeviceType() and verify interface correctness within test case",
L"%a:%d:Status - %r",
__FILE__,
(UINTN)__LINE__,
Status
);
return EFI_SUCCESS;
}