mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-20 00:32:37 +01:00
unfinished
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user