MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / test_variable_state

Function test_variable_state

tests/src/engine/test_console_objects.cpp:37–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35using namespace donut::engine;
36
37void 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
65void test_console_variables()
66{

Callers 1

mainFunction · 0.85

Calls 2

IsInitalizedMethod · 0.80
CanSetValueMethod · 0.80

Tested by

no test coverage detected