platform: Change GetStateEffecterStates API error personality
APIs should return negative errno instead of PLDM completion codes.
Change-Id: Ic7017ecc02f3d969aa8fd5c6b1fa89dced484ab1
Signed-off-by: Tal Yacobi <talycb8@gmail.com>
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/tests/dsp/platform.cpp b/tests/dsp/platform.cpp
index 682a922..6e58d4d 100644
--- a/tests/dsp/platform.cpp
+++ b/tests/dsp/platform.cpp
@@ -5,6 +5,7 @@
#include <libpldm/pldm_types.h>
#include <array>
+#include <cerrno>
#include <cstdint>
#include <cstring>
#include <vector>
@@ -4904,7 +4905,7 @@
rc = decode_get_state_effecter_states_req(
request, requestMsg.size() - hdrSize - 1, &ret_effecter_id);
- EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+ EXPECT_EQ(rc, -EOVERFLOW);
}
#endif
@@ -4916,7 +4917,7 @@
auto rc = encode_get_state_effecter_states_req(
0, 0, nullptr, PLDM_GET_STATE_EFFECTER_STATES_REQ_BYTES);
- EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+ EXPECT_EQ(rc, -EINVAL);
}
#endif
@@ -4929,7 +4930,7 @@
auto rc = decode_get_state_effecter_states_req(
nullptr, requestMsg.size() - hdrSize, nullptr);
- EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+ EXPECT_EQ(rc, -EINVAL);
}
#endif
@@ -4996,7 +4997,7 @@
responseMsg.size() - hdrSize + PLDM_GET_EFFECTER_STATE_FIELD_SIZE,
&ret_resp_fields);
- EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+ EXPECT_EQ(rc, -EBADMSG);
}
#endif
@@ -5011,7 +5012,7 @@
};
auto rc = decode_get_state_effecter_states_resp(nullptr, 0, &resp);
- EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+ EXPECT_EQ(rc, -EINVAL);
}
#endif
@@ -5028,6 +5029,6 @@
auto rc = decode_get_state_effecter_states_resp(
response, responseMsg.size() - hdrSize, nullptr);
- EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+ EXPECT_EQ(rc, -EINVAL);
}
#endif