| 35 | using namespace donut::engine; |
| 36 | |
| 37 | void test_variable_state() |
| 38 | { |
| 39 | using namespace console; |
| 40 | |
| 41 | VariableState stateA; |
| 42 | CHECK(stateA.IsInitalized() == false); |
| 43 | |
| 44 | stateA.read_only = true; |
| 45 | stateA.cheat = false; |
| 46 | stateA.type = VariableType::TYPE_STRING; |
| 47 | stateA.setby = VariableState::CONSOLE; |
| 48 | CHECK(stateA.IsInitalized() == true); |
| 49 | CHECK(stateA.CanSetValue() == false); |
| 50 | |
| 51 | VariableState stateB(VariableType::TYPE_STRING, VariableState::CONSOLE); |
| 52 | CHECK(stateB.IsInitalized() == true); |
| 53 | CHECK(stateB.CanSetValue() == true); |
| 54 | CHECK(stateB.setby == console::VariableState::CONSOLE); |
| 55 | |
| 56 | stateB.setby = VariableState::CODE; |
| 57 | stateB.cheat = true; |
| 58 | CHECK(stateB.CanSetValue(VariableState::CONSOLE) == false); |
| 59 | |
| 60 | VariableState stateC = stateB; |
| 61 | CHECK(stateC != stateA); |
| 62 | CHECK(stateC == stateB); |
| 63 | } |
| 64 | |
| 65 | void test_console_variables() |
| 66 | { |
no test coverage detected