calling 'setTimeout' on bad self (cpp class not export)
This commit is contained in:
parent
2d1cae72c5
commit
9ccb0ccb0c
|
@ -419,6 +419,11 @@ struct LuaSensor final : public StoredValueSensor {
|
||||||
return m_isRedundant;
|
return m_isRedundant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do we need method defined exactly on LuaSensor for Luaa to be happy?
|
||||||
|
void setTimeout(int timeoutMs) override {
|
||||||
|
StoredValueSensor::setTimeout(timeoutMs);
|
||||||
|
}
|
||||||
|
|
||||||
void setRedundant(bool value) {
|
void setRedundant(bool value) {
|
||||||
m_isRedundant = value;
|
m_isRedundant = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ public:
|
||||||
|
|
||||||
void showInfo(const char*) const override { }
|
void showInfo(const char*) const override { }
|
||||||
|
|
||||||
void setTimeout(int timeoutMs) {
|
virtual void setTimeout(int timeoutMs) {
|
||||||
m_timeoutPeriod = MS2NT(timeoutMs);
|
m_timeoutPeriod = MS2NT(timeoutMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,15 @@ TEST(LuaBasic, ExpectNumOrNilReturnsNothing) {
|
||||||
)"), unexpected);
|
)"), unexpected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(LuaSensor, Timeout) {
|
||||||
|
EXPECT_FLOAT_EQ(0.0f, testLuaReturnsNumberOrNil(R"(
|
||||||
|
function testFunc()
|
||||||
|
cltSensor = Sensor.new("clt")
|
||||||
|
cltSensor:setTimeout(3000)
|
||||||
|
end
|
||||||
|
)").value_or(0));
|
||||||
|
}
|
||||||
|
|
||||||
TEST(SystemLua, ScriptLoads) {
|
TEST(SystemLua, ScriptLoads) {
|
||||||
startLua();
|
startLua();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue