summaryrefslogtreecommitdiffstats
path: root/conf.d/controller/lua.d/mapi_tests.lua
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-07-27 19:47:47 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-08-02 16:50:49 +0200
commitf9b8a3e6323ef2f4ee5255b16044d966d73a7446 (patch)
treecee5dae52215b5be8cd7d7283fc9cac7267f120d /conf.d/controller/lua.d/mapi_tests.lua
parent9de89469c4aaba827617a8775c656a4a9e7ac973 (diff)
Asserting the reception of event group:
Change the way to assert the reception of a group of event. To be able to know the attended event count it is better to define it directly when you pass the table of event group. The event name as the key and the number of event that you are waiting for. Also returning the total of received events instead of 1 then it could be asserted to the expected total count. Fix: segfault when manipulating data history values: There was a segfault and random unexpected behavior when attempting to access old event's data. Only the last one was available and trying to access older values lead to memory access violation as the JSON representing the old data has been released since. So it completely mess up the memory and causes unexpected situations. This is simply fix by deep copying the data into another memory space which could be safely accessed afterwards. Changes the way to receive events from monitor api: The old method isn't accurate because it tolds monitor to trace all api request and all push_after event from that api. But we only want event from the api not the others messages coming from the binder which aren't event. Change-Id: Id5aa4a0c79d2adba050ef03d58c45a3db72ec2a2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'conf.d/controller/lua.d/mapi_tests.lua')
-rw-r--r--conf.d/controller/lua.d/mapi_tests.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/conf.d/controller/lua.d/mapi_tests.lua b/conf.d/controller/lua.d/mapi_tests.lua
index abd65cb..ced9ea0 100644
--- a/conf.d/controller/lua.d/mapi_tests.lua
+++ b/conf.d/controller/lua.d/mapi_tests.lua
@@ -29,5 +29,5 @@ _AFT.describe("Test_turning_on", function()
_AFT.assertVerb("low-can", "get", {})
- _AFT.assertEvtGrpReceived({evt1, evt2})
+ _AFT.assertEvtGrpReceived({[evt1] = 1, [evt2] = 1})
end)