184 const uint32_t value_a = (1 << 5) | (1 << 6);
185 const uint32_t value_b = (1 << 3) | (1 << 5) | (1 << 9);
188 flags_true.
set(value_b,
true);
189 ASSERT_EQ(value_a | value_b, uint32_t(flags_true));
192 flags_false.
set(value_b,
false);
193 ASSERT_EQ(value_a & ~value_b, uint32_t(flags_false));
201TEST(FlagsTest, ReplaceOverlapping)
203 const uint32_t value_a = (1 << 4) | (1 << 5) | (1 << 6);
204 const uint32_t value_b = (1 << 3) | (1 << 5) | (1 << 9);
205 const uint32_t
mask = (1 << 4) | (1 << 5) | (1 << 9) | (1 << 10);
210 const uint32_t result = (1 << 5) | (1 << 6) | (1 << 9);
213 ASSERT_EQ(result, uint32_t(
flags));