mirror of
https://github.com/systemd/systemd.git
synced 2026-08-08 00:51:19 +00:00
test: add test for IN_SET() with bitfield specifier
This commit is contained in:
@@ -209,6 +209,16 @@ TEST(in_set) {
|
||||
assert_se(IN_SET(4, 1, 2, 3, 4));
|
||||
assert_se(!IN_SET(0, 1));
|
||||
assert_se(!IN_SET(0, 1, 2, 3, 4));
|
||||
|
||||
struct {
|
||||
unsigned x:3;
|
||||
} t = { 1 };
|
||||
|
||||
assert_se(IN_SET(t.x, 1));
|
||||
assert_se(IN_SET(t.x, 1, 2, 3, 4));
|
||||
assert_se(IN_SET(t.x, 2, 3, 4, 1));
|
||||
assert_se(!IN_SET(t.x, 0));
|
||||
assert_se(!IN_SET(t.x, 2, 3, 4));
|
||||
}
|
||||
|
||||
TEST(foreach_pointer) {
|
||||
|
||||
Reference in New Issue
Block a user