unfinished

This commit is contained in:
Tester23
2025-04-12 16:49:19 +02:00
parent e4b4cd60b3
commit 5d90b3186b

View File

@@ -680,6 +680,48 @@ void Test_Berry_AddChangeHandler() {
SELFTEST_ASSERT_CHANNEL(1, 431);
SELFTEST_ASSERT_CHANNEL(2, 0);
CMD_ExecuteCommand("berry addChangeHandler(\"Channel5\", \">\", 5, def()\n"
"addChannel(2, 1) \n"
"end)", 0);
CMD_ExecuteCommand("setChannel 5 0", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 0);
CMD_ExecuteCommand("setChannel 5 2", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 0);
CMD_ExecuteCommand("setChannel 5 4", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 0);
CMD_ExecuteCommand("setChannel 5 6", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 1);
CMD_ExecuteCommand("setChannel 5 7", 0);
Berry_RunThreads(1);
// TODO - it's triggered now, not as I expected....
/*
SELFTEST_ASSERT_CHANNEL(2, 1);
CMD_ExecuteCommand("setChannel 5 8", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 1);
CMD_ExecuteCommand("setChannel 5 7", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 1);
CMD_ExecuteCommand("setChannel 5 6", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 1);
CMD_ExecuteCommand("setChannel 5 66", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 1);
// finally goes <= 5
CMD_ExecuteCommand("setChannel 5 4", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 1);
// now will fire
CMD_ExecuteCommand("setChannel 5 6", 0);
Berry_RunThreads(1);
SELFTEST_ASSERT_CHANNEL(2, 2);
*/
}
void Test_Berry_CommandRunner() {
int i;