commit | fcc15b86384d82ff28a6e1fc6f120f6bbdfb653e | [log] [tgz] |
---|---|---|
author | Andrew Jeffery <andrew@codeconstruct.com.au> | Tue Aug 12 06:12:24 2025 +0000 |
committer | Andrew Jeffery <andrew@codeconstruct.com.au> | Mon Aug 18 11:51:52 2025 +0930 |
tree | b57c3e6a8e31a5d7ac9c57e25e05481ff55dda13 | |
parent | 26c8eb2a2f22eaa237b5997dc9ccb354bd425161 [diff] |
tests: msgbuf: Ensure extraction succeeds before testing values Fix: ``` In file included from ../tests/msgbuf.cpp:6: In function ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = short int; T2 = int]’, inlined from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = short int; T2 = int; typename std::enable_if<((! std::is_integral<_Tp>::value) || (! std::is_pointer<_Dp>::value))>::type* <anonymous> = 0]’ at ../subprojects/googletest/googletest/include/gtest/gtest.h:1413:64, inlined from ‘virtual void msgbuf_extract_one_int16_Test::TestBody()’ at ../tests/msgbuf.cpp:229:5: ../subprojects/googletest/googletest/include/gtest/gtest.h:1394:3: error: ‘val’ may be used uninitialized [-Werror=maybe-uninitialized] 1394 | if (lhs == rhs) { | ^~ ../tests/msgbuf.cpp: In member function ‘virtual void msgbuf_extract_one_int16_Test::TestBody()’: ../tests/msgbuf.cpp:225:13: note: ‘val’ was declared here 225 | int16_t val; | ^~~ In function ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = unsigned int; T2 = int]’, inlined from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = unsigned int; T2 = int; typename std::enable_if<((! std::is_integral<_Tp>::value) || (! std::is_pointer<_Dp>::value))>::type* <anonymous> = 0]’ at ../subprojects/googletest/googletest/include/gtest/gtest.h:1413:64, inlined from ‘virtual void msgbuf_extract_one_uint32_Test::TestBody()’ at ../tests/msgbuf.cpp:268:5: ../subprojects/googletest/googletest/include/gtest/gtest.h:1394:3: error: ‘val’ may be used uninitialized [-Werror=maybe-uninitialized] 1394 | if (lhs == rhs) { | ^~ ../tests/msgbuf.cpp: In member function ‘virtual void msgbuf_extract_one_uint32_Test::TestBody()’: ../tests/msgbuf.cpp:264:14: note: ‘val’ was declared here 264 | uint32_t val; | ^~~ ``` Change-Id: I0aac7ba5958f3278e2079183a245c2258c0e92f4 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
This is a library which deals with the encoding and decoding of PLDM messages. It should be possible to use this library by projects other than OpenBMC, and hence certain constraints apply to it:
Source files are named according to the PLDM Type, for eg base.[h/c], fru.[h/c], etc.
Given a PLDM command "foo", the library will provide the following API: For the Requester function:
encode_foo_req() - encode a foo request decode_foo_resp() - decode a response to foo
For the Responder function:
decode_foo_req() - decode a foo request encode_foo_resp() - encode a response to foo
The library also provides API to pack and unpack PLDM headers.
libpldm
is configured and built using meson
. Python's pip
or pipx
can be used to install a recent version on your machine:
pipx install meson
Once meson
is installed:
meson setup build && meson compile -C build
meson test -C build
libpldm
Components of the library ABI[^1] (loosely, functions) are separated into three categories:
[^1]: "library API + compiler ABI = library ABI"
Applications depending on libpldm
should aim to only use functions from the stable category. However, this may not always be possible. What to do when required functions fall into the deprecated or testing categories is discussed in CONTRIBUTING.
libpldm is maintained with the expectation that users move between successive releases when upgrading. This constraint allows the library to reintroduce types and functions of the same name in subsequent releases in the knowledge that there are no remaining users of previous definitions. While strategies are employed to avoid breaking existing APIs unnecessarily, the library is still to reach maturity, and we must allow for improvements to be made in the design.