UnitTest/TestSpdmRequester/TestSpdmRequesterGetVersion.c
/**
  Test 10: receiving a VERSION message with a larger list of available versions than indicated.
  The presence of only two versions are indicated, but the VERSION message presents a list
  with 3 versions: 1.0, 1.1 and 1.2.
  Expected behavior: client returns a Status of RETURN_SUCCESS, but truncate the message
  to consider only the two first versions, as indicated in the message.
**/
Test 10: receiving a VERSION message with a larger list of available versions than indicated.
The presence of only two versions are indicated, but the VERSION message presents a list
with 3 versions: 1.0, 1.1 and 1.2.
Expected behavior: client returns a Status of RETURN_SUCCESS, but truncate the message
to consider only the two first versions, as indicated in the message.
Test 10 : receiving a VERSION message with a larger list of available versions than indicated . The presence of only two versions are indicated but the VERSION message presents a list with 3 versions : 1 . 0 1 . 1 and 1 . 2 . Expected behavior : client returns a Status of RETURN_SUCCESS but truncate the message to consider only the two first versions as indicated in the message .
void TestSpdmRequesterGetVersionCase10(void **state) {
  RETURN_STATUS        Status;
  SPDM_TEST_CONTEXT    *SpdmTestContext;
  SPDM_DEVICE_CONTEXT  *SpdmContext;
  SpdmTestContext = *state;
  SpdmContext = SpdmTestContext->SpdmContext;
  SpdmTestContext->CaseId = 0xA;
  Status = SpdmGetVersion (SpdmContext);
  assert_int_equal (Status, RETURN_SUCCESS);
  assert_int_equal (SpdmContext->ConnectionInfo.Version.SpdmVersionCount, 2);
}
void TestSpdmRequesterGetVersionCase10 ( void * * state ) { RETURN_STATUS Status ; SPDM_TEST_CONTEXT * SpdmTestContext ; SPDM_DEVICE_CONTEXT * SpdmContext ; SpdmTestContext = * state ; SpdmContext = SpdmTestContext -> SpdmContext ; SpdmTestContext -> CaseId = 0xA ; Status = SpdmGetVersion ( SpdmContext ) ; assert_int_equal ( Status , RETURN_SUCCESS ) ; assert_int_equal ( SpdmContext -> ConnectionInfo . Version . SpdmVersionCount , 2 ) ; }
Test 10: receiving a VERSION message with a larger list of available versions than indicated.
Test 10 : receiving a VERSION message with a larger list of available versions than indicated .