diff options
author | igo95862 <igo95862@yandex.ru> | 2022-06-10 19:51:04 +0200 |
---|---|---|
committer | igo95862 <igo95862@yandex.ru> | 2022-07-25 22:29:17 +0200 |
commit | 724e13b346990be85c4bc332c78f29ed7ce83121 (patch) | |
tree | f5a7be3faefaf94c563b8be7aaf3da5b7d23ab11 /src/fundamental | |
parent | localed: don't fail if we cannot copy an xattr (diff) | |
download | systemd-724e13b346990be85c4bc332c78f29ed7ce83121.tar.xz systemd-724e13b346990be85c4bc332c78f29ed7ce83121.zip |
test-bus-objects: Test GetManagedObjects interfaces are correct
Objects without ObjectManager should not have
`org.freedesktop.DBus.ObjectManager` interface.
Object with ObjectManager should do.
Also added ASSERT_SE_NONNEG and ASSERT_NONNEG macros.
Diffstat (limited to 'src/fundamental')
-rw-r--r-- | src/fundamental/macro-fundamental.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 7cc34b6f1a..e5f6dc7f8c 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -95,6 +95,20 @@ _expr_; \ }) +#define ASSERT_NONNEG(expr) \ + ({ \ + typeof(expr) _expr_ = (expr), _zero = 0; \ + assert(_expr_ >= _zero); \ + _expr_; \ + }) + +#define ASSERT_SE_NONNEG(expr) \ + ({ \ + typeof(expr) _expr_ = (expr), _zero = 0; \ + assert_se(_expr_ >= _zero); \ + _expr_; \ + }) + #define assert_cc(expr) static_assert(expr, #expr) |