Example #1
0
TEST(FlagStatus, lock_clear) {
  FlagStatus flagStatus;

  flagStatus.lock_increase(ModifierFlag::COMMAND_L | ModifierFlag::FN | ModifierFlag::SHIFT_L);
  EXPECT_EQ(ModifierFlag::COMMAND_L | ModifierFlag::FN | ModifierFlag::SHIFT_L, flagStatus.makeFlags());

  flagStatus.lock_clear();
  EXPECT_EQ(Flags(0), flagStatus.makeFlags());
}
Example #2
0
TEST(FlagStatus, lock_clear) {
  FlagStatus flagStatus;

  {
    Vector_ModifierFlag v;
    v.push_back(ModifierFlag::COMMAND_L);
    v.push_back(ModifierFlag::FN);
    v.push_back(ModifierFlag::SHIFT_L);
    flagStatus.lock_increase(v);
    EXPECT_EQ(ModifierFlag::COMMAND_L | ModifierFlag::FN | ModifierFlag::SHIFT_L, flagStatus.makeFlags());
  }
  {
    flagStatus.increase(ModifierFlag::CAPSLOCK);
    EXPECT_EQ(ModifierFlag::CAPSLOCK | ModifierFlag::COMMAND_L | ModifierFlag::FN | ModifierFlag::SHIFT_L,
              flagStatus.makeFlags());
  }

  flagStatus.lock_clear();
  EXPECT_EQ(Flags(0), flagStatus.makeFlags());
}