Lines Matching +full:auto +full:- +full:range
16 constexpr auto hdrSize = sizeof(pldm_msg_hdr);
25 auto rc = pack_pldm_header(hdr_ptr, &msg); in TEST()
41 // Instance ID out of range in TEST()
47 // PLDM type out of range in TEST()
60 // Message type is REQUEST and lower range of the field values in TEST()
66 auto rc = pack_pldm_header(&hdr, &msg); in TEST()
74 // Message type is REQUEST and upper range of the field values in TEST()
104 // Message type is PLDM_RESPONSE and lower range of the field values in TEST()
110 auto rc = pack_pldm_header(&hdr, &msg); in TEST()
118 // Message type is PLDM_RESPONSE and upper range of the field values in TEST()
137 auto rc = unpack_pldm_header(nullptr, &hdr); in TEST()
146 // Unpack PLDM request message and lower range of field values in TEST()
148 auto rc = unpack_pldm_header(&msg, &hdr); in TEST()
155 // Unpack PLDM async request message and lower range of field values in TEST()
161 // Unpack PLDM request message and upper range of field values in TEST()
179 // Unpack PLDM response message and lower range of field values in TEST()
180 auto rc = unpack_pldm_header(&msg, &hdr); in TEST()
187 // Unpack PLDM response message and upper range of field values in TEST()
205 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
206 auto request = reinterpret_cast<pldm_msg*>(requestMsg.data()); in TEST()
208 auto rc = encode_get_commands_req(0, pldmType, version, request); in TEST()
210 EXPECT_EQ(0, memcmp(request->payload, &pldmType, sizeof(pldmType))); in TEST()
211 EXPECT_EQ(0, memcmp(request->payload + sizeof(pldmType), &version, in TEST()
227 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
228 auto request = reinterpret_cast<pldm_msg*>(requestMsg.data()); in TEST()
229 auto rc = decode_get_commands_req(request, requestMsg.size() - hdrSize, in TEST()
242 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
243 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
249 auto rc = in TEST()
252 uint8_t* payload_ptr = response->payload; in TEST()
266 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
267 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
273 auto rc = encode_get_types_resp(0, PLDM_SUCCESS, types.data(), response); in TEST()
275 uint8_t* payload_ptr = response->payload; in TEST()
294 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
295 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
297 auto rc = decode_get_types_resp(response, responseMsg.size() - hdrSize, in TEST()
318 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
319 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
321 auto rc = decode_get_types_resp(response, responseMsg.size() - hdrSize - 1, in TEST()
338 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
339 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
341 auto rc = decode_get_commands_resp(response, responseMsg.size() - hdrSize, in TEST()
362 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
363 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
365 auto rc = in TEST()
366 decode_get_commands_resp(response, responseMsg.size() - hdrSize - 1, in TEST()
376 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
377 auto request = reinterpret_cast<pldm_msg*>(requestMsg.data()); in TEST()
382 auto rc = in TEST()
386 0, memcmp(request->payload, &transferHandle, sizeof(transferHandle))); in TEST()
387 EXPECT_EQ(0, memcmp(request->payload + sizeof(transferHandle), &opFlag, in TEST()
390 memcmp(request->payload + sizeof(transferHandle) + sizeof(opFlag), in TEST()
400 auto rc = in TEST()
413 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
414 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
417 auto rc = encode_get_version_resp(0, PLDM_SUCCESS, 0, PLDM_START_AND_END, in TEST()
421 EXPECT_EQ(completionCode, response->payload[0]); in TEST()
422 EXPECT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]), in TEST()
424 EXPECT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]) + in TEST()
427 EXPECT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]) + in TEST()
449 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
450 auto request = reinterpret_cast<pldm_msg*>(requestMsg.data()); in TEST()
452 auto rc = decode_get_version_req(request, requestMsg.size() - hdrSize, in TEST()
483 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
484 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
486 auto rc = decode_get_version_resp(response, responseMsg.size() - hdrSize, in TEST()
503 auto rc = encode_get_tid_req(0, &request); in TEST()
512 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
513 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
516 auto rc = encode_get_tid_resp(0, PLDM_SUCCESS, tid, response); in TEST()
518 uint8_t* payload = response->payload; in TEST()
532 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
533 auto response = reinterpret_cast<pldm_msg*>(responseMsg.data()); in TEST()
535 auto rc = decode_get_tid_resp(response, responseMsg.size() - hdrSize, in TEST()
558 msg->payload, PLDM_MULTIPART_RECEIVE_REQ_BYTES); in TEST()
624 msg->payload, PLDM_MULTIPART_RECEIVE_REQ_BYTES); in TEST()
656 msg->payload, PLDM_MULTIPART_RECEIVE_REQ_BYTES); in TEST()
691 msg->payload, PLDM_MULTIPART_RECEIVE_REQ_BYTES); in TEST()
738 auto rc = encode_pldm_base_multipart_receive_req( in TEST()
743 0, memcmp(requestPtr->payload, requestMsg.data(), sizeof(requestMsg))); in TEST()
764 EXPECT_EQ(rc, -EINVAL); in TEST()
768 EXPECT_EQ(rc, -EINVAL); in TEST()
788 EXPECT_EQ(rc, -EOVERFLOW); in TEST()
812 rc = pldm_msgbuf_init_errno(buf, 0, responseMsg->payload, payload_length); in TEST()
862 rc = pldm_msgbuf_init_errno(buf, 0, responseMsg->payload, payload_length); in TEST()
881 EXPECT_EQ(rc, -EINVAL); in TEST()
886 EXPECT_EQ(rc, -EINVAL); in TEST()
910 rc = pldm_msgbuf_init_errno(buf, 0, responseMsg->payload, payload_length); in TEST()
929 EXPECT_EQ(rc, -EOVERFLOW); in TEST()
959 rc = pldm_msgbuf_init_errno(buf, 0, responseMsg->payload, payload_length); in TEST()
976 * pldm_msgbuf_complete_consumed() returns -EBADMSG as in TEST()
980 EXPECT_EQ(rc, -EBADMSG); in TEST()
1006 rc = pldm_msgbuf_init_errno(buf, 0, responseMsg->payload, payload_length); in TEST()
1025 * pldm_msgbuf_extract_p() returns -EOVERFLOW as in TEST()
1029 EXPECT_EQ(rc, -EOVERFLOW); in TEST()
1085 EXPECT_EQ(0, memcmp(responsePtr->payload, responseMsg.data(), in TEST()
1121 EXPECT_EQ(0, memcmp(responsePtr->payload, responseMsg.data(), in TEST()
1152 EXPECT_EQ(0, memcmp(responsePtr->payload, responseMsg.data(), in TEST()
1184 EXPECT_EQ(rc, -EINVAL); in TEST()
1189 EXPECT_EQ(rc, -EINVAL); in TEST()
1193 EXPECT_EQ(rc, -EINVAL); in TEST()
1199 EXPECT_EQ(rc, -EINVAL); in TEST()
1225 EXPECT_EQ(rc, -EOVERFLOW); in TEST()
1233 auto rc = in TEST()
1238 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
1239 auto p = reinterpret_cast<uint8_t*>(&responseMsg); in TEST()
1255 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
1256 auto request = reinterpret_cast<pldm_msg*>(requestMsg.data()); in TEST()
1258 auto rc = encode_set_tid_req(instanceId, tid, request); in TEST()
1261 EXPECT_EQ(request->hdr.command, PLDM_SET_TID); in TEST()
1262 EXPECT_EQ(request->hdr.type, PLDM_BASE); in TEST()
1263 EXPECT_EQ(request->hdr.request, 1); in TEST()
1264 EXPECT_EQ(request->hdr.datagram, 0); in TEST()
1265 EXPECT_EQ(request->hdr.instance_id, instanceId); in TEST()
1266 EXPECT_EQ(0, memcmp(request->payload, &tid, sizeof(tid))); in TEST()
1273 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) in TEST()
1274 auto request = reinterpret_cast<pldm_msg*>(requestMsg.data()); in TEST()
1276 auto rc = encode_set_tid_req(0, tid, nullptr); in TEST()
1296 auto rc = decode_set_tid_req( in TEST()
1297 request, requestMsg.size() - sizeof(pldm_msg_hdr), &tidOut); in TEST()
1310 auto rc = decode_set_tid_req( in TEST()
1311 nullptr, requestMsg.size() - sizeof(pldm_msg_hdr), &tid); in TEST()
1313 EXPECT_EQ(rc, -EINVAL); in TEST()
1323 auto rc = decode_set_tid_req( in TEST()
1324 request, requestMsg.size() - sizeof(pldm_msg_hdr), nullptr); in TEST()
1326 EXPECT_EQ(rc, -EINVAL); in TEST()
1336 auto rc = decode_set_tid_req(request, -1, nullptr); in TEST()
1338 EXPECT_EQ(rc, -EINVAL); in TEST()
1518 auto rc = encode_pldm_base_negotiate_transfer_params_req( in TEST()
1523 0, memcmp(requestPtr->payload, requestMsg.data(), sizeof(requestMsg))); in TEST()
1544 EXPECT_EQ(rc, -EINVAL); in TEST()
1548 EXPECT_EQ(rc, -EINVAL); in TEST()
1568 EXPECT_EQ(rc, -EOVERFLOW); in TEST()
1589 rc = pldm_msgbuf_init_errno(buf, 0, responseMsg->payload, payload_length); in TEST()
1631 rc = pldm_msgbuf_init_errno(buf, 0, responseMsg->payload, payload_length); in TEST()
1647 EXPECT_EQ(rc, -EINVAL); in TEST()
1652 EXPECT_EQ(rc, -EINVAL); in TEST()
1674 rc = pldm_msgbuf_init_errno(buf, 0, responseMsg->payload, payload_length); in TEST()
1690 EXPECT_EQ(rc, -EOVERFLOW); in TEST()
1769 EXPECT_EQ(rc, -EINVAL); in TEST()
1772 EXPECT_EQ(rc, -EINVAL); in TEST()
1774 // Incorrect payload length - too short in TEST()
1776 request, payload_len - 1, &decoded_req); in TEST()
1777 EXPECT_EQ(rc, -EOVERFLOW); in TEST()
1779 // Incorrect payload length - too long in TEST()
1782 EXPECT_EQ(rc, -EBADMSG); in TEST()
1813 EXPECT_EQ(response->hdr.request, PLDM_RESPONSE); in TEST()
1814 EXPECT_EQ(response->hdr.instance_id, instance_id); in TEST()
1815 EXPECT_EQ(response->hdr.type, PLDM_BASE); in TEST()
1816 EXPECT_EQ(response->hdr.command, PLDM_NEGOTIATE_TRANSFER_PARAMETERS); in TEST()
1859 EXPECT_EQ(rc, -EINVAL); in TEST()
1864 EXPECT_EQ(rc, -EINVAL); in TEST()
1867 payload_len = PLDM_BASE_NEGOTIATE_TRANSFER_PARAMETERS_RESP_BYTES - 1; in TEST()
1870 EXPECT_EQ(rc, -EOVERFLOW); in TEST()