platform: pldm_msgbuf for decode_get_pdr_resp()

The rework in this patch is the first use pldm_msgbuf on a message type
with variable-length data. The length of the data is embedded in the
message and is one of the elements that we must extract. As we need to
use the extracted length value we must first ensure that the value has
been successfully extracted. This requires we test against the return
value of `pldm_msgbuf_extract()` and _not_ batch the evaluation of
success like we have elsewhere.

Another side-effect is the rework affects mechanics of the "bad" test.
To accommodate that, the change to `recordDataLength` sets the message
up such that the length of the variable data embedded in the message is
1 byte longer than the supplied buffer into which the data should be
extracted.  This arrangement upholds the test expectation that
decode_get_pdr_resp() returns PLDM_ERROR_INVALID_LENGTH for the provided
message buffer.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I6916d28cdd1e27f180fb52725a836a365299ee9a
diff --git a/tests/libpldm_platform_test.cpp b/tests/libpldm_platform_test.cpp
index c493e3e..5a5f131 100644
--- a/tests/libpldm_platform_test.cpp
+++ b/tests/libpldm_platform_test.cpp
@@ -351,7 +351,7 @@
     uint8_t transferFlag = PLDM_END;
     constexpr uint16_t respCnt = 9;
     uint8_t transferCRC = 96;
-    size_t recordDataLength = 32;
+    size_t recordDataLength = respCnt - 1;
     std::array<uint8_t, hdrSize + PLDM_GET_PDR_MIN_RESP_BYTES + respCnt +
                             sizeof(transferCRC)>
         responseMsg{};