summaryrefslogtreecommitdiffstats
path: root/test/message/append.cpp
Commit message (Collapse)AuthorAgeFilesLines
* std::variant: Remove uses of the variant_nsWilliam A. Kennington III2019-04-051-7/+6
| | | | | | | | | | | Now that we are using std::variant we should reference it directly instead of using our own namespace alias. Tested: Built and ran through unit tests. Change-Id: Ic3fd62ea74cf808b85ad7b7ffcce8c0a0bfb125d Signed-off-by: William A. Kennington III <wak@google.com>
* message: Fix variant api usageWilliam A. Kennington III2018-10-051-3/+5
| | | | | | | | | | | This makes our use of the mapbox variant consistent with std::variant. We need this cleanup for the conversion to std::variant. Tested: Ran unit tests to make sure they still pass. Change-Id: I990013eaaa2ec27f2fda71bfadd9a5369d50c187 Signed-off-by: William A. Kennington III <wak@google.com>
* clang-format: Fix pointer alignmentWilliam A. Kennington III2018-08-311-20/+19
| | | | | | | | | | Oenbmc documentation specifies a left alignment for pointers. Our current format tries to left align if neither alignment is strictly followed, but will allow right aligned files to exist. Lets make this more strict so that all of our files are consistent. Change-Id: I3a50043d28a9c25d0cf1ffb752800d05eb7615e1 Signed-off-by: William A. Kennington III <wak@google.com>
* clang-format: always break template declarationsPatrick Venture2018-08-311-1/+2
| | | | | | | To better match the defined openbmc style. Change-Id: I68cda43857768bae4c904c367942cb1f0efa3e0c Signed-off-by: Patrick Venture <venture@google.com>
* update .clang-format header inclusion orderPatrick Venture2018-08-311-3/+5
| | | | | | | | Added the header inclusion order to the .clang-format file generated these changes. Change-Id: Ia31b21d7ea451cac0309828006bc17c27cbd5bd5 Signed-off-by: Patrick Venture <venture@google.com>
* test/message/append: Use googletest and mocksWilliam A. Kennington III2018-07-091-604/+305
| | | | | | | | | | | | | | | | | | | | | The current test case depends on the system running a dbus daemon that our test case can register and run a service with. It runs in multiple threads and requires using raw sd_bus_message calls to determine if the appends worked correctly. When systemd 237 becomes the minimum version we could rely on message sealing and other new public members to deal with the daemon issues. However, it will be a while before we can make that the default version. Lets mock out the expectations for the underlying sd_bus_message calls to validate that we will build correct objects when using our message.append() calls. Tested: Converted the tests from the old test cases to this new format keeping very similar test functionality. Tests still pass. Change-Id: Iafc8662389fe60ca2d519abfe472c61292f3239a Signed-off-by: William A. Kennington III <wak@google.com>
* tests: Write our own assert()William A. Kennington III2018-06-271-91/+104
| | | | | | | | | | | | | | | | The cassert `assert()` function is only provided when NDEBUG is not defined. Otherwise `assert()` becomes a no-op breaking our test cases. Since we rely on the behavior of assert to validate the tests, we always want to provide one for the test implementation. This functionality will be useful once code coverage is added since that forces NDEBUG to be passed to the preprocessor. Tested: Test cases still work correctly if unmodified, and any changes that should cause the asserts to fail still fail as expected. Change-Id: I8d4132058308566310c58b7ae3e121eae55d37f5 Signed-off-by: William A. Kennington III <wak@google.com>
* tests: Fix memory leak from sd_bus callsWilliam A. Kennington III2018-06-271-1/+5
| | | | | | | | | | | | Some of the calls into sd_bus leak memory because they never unreference the bus or messages. Fix this so we can eventually enable leak checking from valgrind. Tested: Ran through valgrind and the errors went away. Change-Id: Icc3d5d0860b3852401219c1ca511a1bc26aa1c48 Signed-off-by: William A. Kennington III <wak@google.com>
* Allow reading and appending of more complex typesEd Tanous2018-03-071-0/+135
| | | | | | | | | | | | | | | | | | | | | This commit makes sdbusplus compatible with most containers that meet a few requirements. This includes: std::unordered_map std::array std::set boost::flat_set boost::flat_map Read requires a container to support emplace or emplace_back methods. Append requires a container to suport a const iterator Tested: The top level OpenBMC compiles properly, and the sdbusplus unit tests compile and pass, and unit tests have been updated with a few new types to ensure we see any breakages. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I5eb1cf7dc07bacc7aca62d87844794223ad4de80 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Update repo to conform to openbmc code standardAndrew Geissler2018-02-051-28/+19
| | | | | Change-Id: If1d6b1f04514367cc544c2507a845b3e9d6d3435 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* message-append: Add more string test casesPatrick Williams2017-02-151-4/+45
| | | | | | | Add cases uncovered by openbmc/openbmc#1025. Change-Id: I680b95b2127d50837dccd3ea1ff655fc1eb19ec9 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* message-append: support obj-path and signaturePatrick Williams2017-01-091-0/+27
| | | | | Change-Id: I44d5195eba14c17f38cf2bf2b09eb071d54f59d8 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* append/read: additional testcases for bool formsPatrick Williams2016-11-281-4/+8
| | | | | | | | Added test-cases for false r-value reference and l-values, in addition to existing false value. Change-Id: I36952f06d84f9da157a618fbe093a8ca63662ceb Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* message: fix parallel test issuePatrick Williams2016-11-041-1/+1
| | | | | | | | | Both message/append and message/read were using the same service name for testcases. Ensure they use different service names to allow parallel execution of test cases. Change-Id: I060c03f69db0484b863af7cb45578f183cdff331 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* message: compile warning in testcasesPatrick Williams2016-11-041-0/+2
| | | | | | | Thread functions (non-void) were missing a return. Change-Id: Ib7804d92f79b96428285058101e64dceea7ad66e Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* message: write testcase to confirm bool and doublePatrick Williams2016-10-201-0/+25
| | | | | Change-Id: I631046f3e6d46c299f5907ad811656be3d66ea60 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* variant support for append/readPatrick Williams2016-09-121-0/+83
| | | | | Change-Id: I682275405e3c4f7c798317a60ea070b3b1a0846c Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* std::tuple support for append/readPatrick Williams2016-09-121-0/+39
| | | | | Change-Id: If914032fa4f655af509ac58a5e0057968f71aa32 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* std::map support for append/readPatrick Williams2016-09-121-0/+59
| | | | | Change-Id: I3b5510b8ba400cf4d3f936f01708cb17aa009e62 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* std::vector support for append/readPatrick Williams2016-09-121-0/+42
| | | | | Change-Id: I1820ee2213feb37fab10a491b1099032fd48c18d Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* bus::process: use message::messagePatrick Williams2016-09-121-1/+1
| | | | | Change-Id: I00f913695d0db75a07d1b0520f507ee7dc469129 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Add verification to append testcasesPatrick Williams2016-09-121-1/+86
| | | | | Change-Id: Ida08a84e5a7844ed1afd80d3319d2dfc8b77c5e1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Migrate bus to message bindingsPatrick Williams2016-09-121-18/+18
| | | | | Change-Id: I29a03b146d5c050a13b4bab690d450612797f2ce Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Add bus bindingsPatrick Williams2016-09-121-29/+22
| | | | | | | | | Add C++ bindings for the sd_bus_(bus) class interfaces. This binding creates a unique_ptr wrapper around sd_bus*, using the appropriate sd_bus deref calls when the unique_ptr leaves scope. Change-Id: I0bb3842e384217ac5606bb3bf350d7fc3babf1ad Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Add message append functionalityPatrick Williams2016-09-081-0/+140
Adds C++ binding to sd_bus_message_append* class functions. Uses type deduction to identify all of the parameters passed to the append function and, at compile-time, creates the appropriate dbus type string. Example: sdbusplus::message::append(m, "asdf"s); Is equal to: sd_bus_message_append_basic(m, 's', ("asdf"s).c_str()); Rather than use a naive sequence of ..._append_basic calls, the implementation will attempt to group multiple basic types into a single sd_bus_message_append call. Change-Id: I1341a0299573c61588fe225c07174b743cb3a282 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
OpenPOWER on IntegriCloud