|
2 | 2 | #include <scratchcpp/block.h> |
3 | 3 | #include <scratchcpp/sprite.h> |
4 | 4 | #include <scratchcpp/rect.h> |
| 5 | +#include <scratchcpp/virtualmachine.h> |
5 | 6 | #include <scratch/monitor_p.h> |
6 | 7 | #include <monitorhandlermock.h> |
7 | 8 | #include <randomgeneratormock.h> |
@@ -91,17 +92,22 @@ TEST(MonitorTest, Sprite) |
91 | 92 | TEST(MonitorTest, UpdateValue) |
92 | 93 | { |
93 | 94 | Monitor monitor("", ""); |
94 | | - monitor.updateValue(5); |
| 95 | + VirtualMachine vm1, vm2; |
| 96 | + monitor.updateValue(nullptr); |
| 97 | + monitor.updateValue(&vm1); |
95 | 98 |
|
96 | 99 | MonitorHandlerMock handler; |
97 | 100 | EXPECT_CALL(handler, init); |
98 | 101 | monitor.setInterface(&handler); |
99 | 102 |
|
100 | | - EXPECT_CALL(handler, onValueChanged(Value(6.5))); |
101 | | - monitor.updateValue(6.5); |
| 103 | + EXPECT_CALL(handler, onValueChanged(&vm1)); |
| 104 | + monitor.updateValue(&vm1); |
102 | 105 |
|
103 | | - EXPECT_CALL(handler, onValueChanged(Value("test"))); |
104 | | - monitor.updateValue("test"); |
| 106 | + EXPECT_CALL(handler, onValueChanged(nullptr)); |
| 107 | + monitor.updateValue(nullptr); |
| 108 | + |
| 109 | + EXPECT_CALL(handler, onValueChanged(&vm2)); |
| 110 | + monitor.updateValue(&vm2); |
105 | 111 | } |
106 | 112 |
|
107 | 113 | TEST(MonitorTest, Width) |
|
0 commit comments