<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sdbusplus/test/vtable, branch master</title>
<subtitle>OpenBMC systemd DBUS binding API sources</subtitle>
<id>https://git.raptorcs.com/git/sdbusplus/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/sdbusplus/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/'/>
<updated>2020-01-15T06:57:52+00:00</updated>
<entry>
<title>Fix vtable CI error</title>
<updated>2020-01-15T06:57:52+00:00</updated>
<author>
<name>Lei YU</name>
<email>mine260309@gmail.com</email>
</author>
<published>2019-12-13T06:48:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=d35c85239a85a101e866a7bd60aff4f40bf77401'/>
<id>urn:sha1:d35c85239a85a101e866a7bd60aff4f40bf77401</id>
<content type='text'>
The CI reports failure in VtableTest.SameContent, where the case is
comparing the binary of example vtables constructed from sdbusplus and
macros defined in systemd.

The root cause has two parts.

Part I:
When systemd is updated, the members in struct
sd_bus_vtable is updated, e.g.
* From v239 to v242, sd_bus_vtable.x.start is updated from
      struct {
              size_t element_size;
      } start;
  to:
      struct {
              size_t element_size;
              uint64_t features;
      } start;
  and sd_bus_vtable.x.method is updated from
      struct {
              const char *member;
              const char *signature;
              const char *result;
              sd_bus_message_handler_t handler;
              size_t offset;
      } method;
  to:
      struct {
              const char *member;
              const char *signature;
              const char *result;
              sd_bus_message_handler_t handler;
              size_t offset;
              const char *names;
      } method;
* From v242 to v243, sd_bus_vtable.x.start is updated to
      struct {
              size_t element_size;
              uint64_t features;
              const unsigned *vtable_format_reference;
      } start;

The code in vtable.hpp only assign the members in v239, the new
members are intialized with 0, so it differs from the vtable
constructed from macros defined by systemd.

The fix is to use macros from systemd in vtable.hpp as well,
which is suggested by systemd:

&gt; Please do not initialize this structure directly, use the
&gt; macros below instead

Part II:
The `const char *names` in struct method and signal introduced
between systemd v239 and v242 is a pointer to const strings.

By default they are "empty" strings, but there is no guarantee
that the compiler will use the same pointer for the same string.

So the test case can not assume the binaries are the same for
two vtables even they are constructed with the same parameters.

Update the test case to use real `const char*` and handler/get/set
functions and check each member of the struct instead of comparing the
binary data by memcmp.

Tested: Verify the CI passes.

Change-Id: I9e94ff16075dd3f12d73e96438c0d864203bdcf4
Signed-off-by: Lei YU &lt;mine260309@gmail.com&gt;
</content>
</entry>
<entry>
<title>update .clang-format header inclusion order</title>
<updated>2018-08-31T19:44:45+00:00</updated>
<author>
<name>Patrick Venture</name>
<email>venture@google.com</email>
</author>
<published>2018-08-31T16:19:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=95269dbc8c38fb41ac50639eafa8d8c3e57ec748'/>
<id>urn:sha1:95269dbc8c38fb41ac50639eafa8d8c3e57ec748</id>
<content type='text'>
Added the header inclusion order to the .clang-format file generated
these changes.

Change-Id: Ia31b21d7ea451cac0309828006bc17c27cbd5bd5
Signed-off-by: Patrick Venture &lt;venture@google.com&gt;
</content>
</entry>
<entry>
<title>Update repo to conform to openbmc code standard</title>
<updated>2018-02-05T19:04:50+00:00</updated>
<author>
<name>Andrew Geissler</name>
<email>geissonator@yahoo.com</email>
</author>
<published>2018-01-18T15:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=072da3ea39e5f2e215947c8fce347f918f075dc3'/>
<id>urn:sha1:072da3ea39e5f2e215947c8fce347f918f075dc3</id>
<content type='text'>
Change-Id: If1d6b1f04514367cc544c2507a845b3e9d6d3435
Signed-off-by: Andrew Geissler &lt;geissonator@yahoo.com&gt;
</content>
</entry>
<entry>
<title>test: convert vtable to gtest</title>
<updated>2017-05-02T02:57:41+00:00</updated>
<author>
<name>Patrick Williams</name>
<email>patrick@stwcx.xyz</email>
</author>
<published>2017-04-28T20:54:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=a14167b59b5c1ec9d9d1e68ea0b09b584d3cd374'/>
<id>urn:sha1:a14167b59b5c1ec9d9d1e68ea0b09b584d3cd374</id>
<content type='text'>
Change-Id: Ic54957df1c8d08c5461b262628fd1cc5c27217d7
Signed-off-by: Patrick Williams &lt;patrick@stwcx.xyz&gt;
</content>
</entry>
<entry>
<title>Add vtable support</title>
<updated>2016-09-28T01:31:00+00:00</updated>
<author>
<name>Patrick Williams</name>
<email>patrick@stwcx.xyz</email>
</author>
<published>2016-09-28T01:30:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=9d3ec7fb91cc20a428e4eb72b133e91d5f57370a'/>
<id>urn:sha1:9d3ec7fb91cc20a428e4eb72b133e91d5f57370a</id>
<content type='text'>
The sd-bus interfaces for creating a VTABLE require C-only syntax, which
prevents them from being used in C++ code.  Create constexpr wrappers
that emit VTABLE entries so that a VTABLE can be created in C++ code.

Change-Id: I22892de1e87448ab9dce48034c9f030bc5bab9af
Signed-off-by: Patrick Williams &lt;patrick@stwcx.xyz&gt;
</content>
</entry>
</feed>
