Flutter Linux Embedder
key_mapping_test.cc File Reference
#include "key_mapping.h"
#include <gmodule.h>
#include <algorithm>
#include <vector>
#include "gtest/gtest.h"

Go to the source code of this file.

Functions

bool operator== (const LayoutGoal &a, const LayoutGoal &b)
 
 TEST (KeyMappingTest, HasExpectedValues)
 

Function Documentation

◆ operator==()

bool operator== ( const LayoutGoal a,
const LayoutGoal b 
)

Definition at line 12 of file key_mapping_test.cc.

12  {
13  return a.keycode == b.keycode && a.logical_key == b.logical_key &&
14  a.mandatory == b.mandatory;
15 }

References LayoutGoal::keycode, LayoutGoal::logical_key, and LayoutGoal::mandatory.

◆ TEST()

TEST ( KeyMappingTest  ,
HasExpectedValues   
)

Definition at line 19 of file key_mapping_test.cc.

19  {
20  // Has Space
21  EXPECT_NE(std::find(layout_goals.begin(), layout_goals.end(),
22  LayoutGoal{0x41, 0x20, false}),
23  layout_goals.end());
24  // Has Digit0
25  EXPECT_NE(std::find(layout_goals.begin(), layout_goals.end(),
26  LayoutGoal{0x13, 0x30, true}),
27  layout_goals.end());
28  // Has KeyA
29  EXPECT_NE(std::find(layout_goals.begin(), layout_goals.end(),
30  LayoutGoal{0x26, 0x61, true}),
31  layout_goals.end());
32  // Has Equal
33  EXPECT_NE(std::find(layout_goals.begin(), layout_goals.end(),
34  LayoutGoal{0x15, 0x3d, false}),
35  layout_goals.end());
36  // Has IntlBackslash
37  EXPECT_NE(std::find(layout_goals.begin(), layout_goals.end(),
38  LayoutGoal{0x5e, 0x200000020, false}),
39  layout_goals.end());
40 }

References layout_goals.

LayoutGoal::mandatory
bool mandatory
Definition: key_mapping.h:49
layout_goals
const std::vector< LayoutGoal > layout_goals
Definition: key_mapping.g.cc:462
LayoutGoal
Definition: key_mapping.h:40
LayoutGoal::keycode
uint16_t keycode
Definition: key_mapping.h:42
LayoutGoal::logical_key
uint64_t logical_key
Definition: key_mapping.h:45