1 /* Copyright 2017 Colin T.A. Gray
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include "test_common.hpp"
20 using testing::Return;
22 class ActionLayer : public TestFixture {};
24 // TEST_F(ActionLayer, LayerStateDBG) {
25 // layer_state_set(0);
28 // TEST_F(ActionLayer, LayerStateSet) {
29 // layer_state_set(0);
30 // EXPECT_EQ(layer_state, 0);
31 // layer_state_set(0b001100);
32 // EXPECT_EQ(layer_state, 0b001100);
35 // TEST_F(ActionLayer, LayerStateIs) {
36 // layer_state_set(0);
37 // EXPECT_EQ(layer_state_is(0), true);
38 // EXPECT_EQ(layer_state_is(1), true);
39 // layer_state_set(1);
40 // EXPECT_EQ(layer_state_is(0), true);
41 // EXPECT_EQ(layer_state_is(1), true);
42 // layer_state_set(2);
43 // EXPECT_EQ(layer_state_is(0), false);
44 // EXPECT_EQ(layer_state_is(1), false);
45 // EXPECT_EQ(layer_state_is(2), true);
48 TEST_F(ActionLayer, LayerStateCmp) {
52 EXPECT_EQ(layer_state_cmp(prev_layer, 0), true);
53 EXPECT_EQ(layer_state_cmp(prev_layer, 1), false);
56 EXPECT_EQ(layer_state_cmp(prev_layer, 0), true);
57 EXPECT_EQ(layer_state_cmp(prev_layer, 1), false);
60 EXPECT_EQ(layer_state_cmp(prev_layer, 0), false);
61 EXPECT_EQ(layer_state_cmp(prev_layer, 1), true);
62 EXPECT_EQ(layer_state_cmp(prev_layer, 2), false);
65 // TEST_F(ActionLayer, LayerClear) {
67 // EXPECT_EQ(layer_state, 0);
70 // TEST_F(ActionLayer, LayerMove) {
72 // EXPECT_EQ(layer_state, 1);
74 // EXPECT_EQ(layer_state, 0b1000);
77 // TEST_F(ActionLayer, LayerOn) {
82 // EXPECT_EQ(layer_state, 0b1010);
85 // TEST_F(ActionLayer, LayerOff) {
91 // EXPECT_EQ(layer_state, 0b1000);