test: add test for IN_SET() with bitfield specifier

This commit is contained in:
Yu Watanabe
2022-10-26 03:32:05 +09:00
parent e967926b09
commit dec283e0a9

View File

@@ -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) {