From f9b8a3e6323ef2f4ee5255b16044d966d73a7446 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 27 Jul 2018 19:47:47 +0200 Subject: 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 --- conf.d/controller/lua.d/mapi_tests.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conf.d/controller/lua.d/mapi_tests.lua') 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) -- cgit 1.2.3-korg