diff --git a/mocks/sr.lua b/mocks/sr.lua index a7a667f..a513ec7 100644 --- a/mocks/sr.lua +++ b/mocks/sr.lua @@ -491,6 +491,7 @@ xavpMock = { end function t.get(xavp_name, index, mode) + if not mode then mode = 0 end xavp = t._get_xavp(xavp_name, index, mode) return xavp end diff --git a/tests/ngcp.lua b/tests/ngcp.lua index 69f5dfc..ab2cc0d 100644 --- a/tests/ngcp.lua +++ b/tests/ngcp.lua @@ -375,7 +375,7 @@ TestNGCP = {} --class end function TestNGCP:test_tostring() - assertEquals(tostring(self.ngcp), 'caller_contract_prefs:{dummy="caller"}\ncallee_contract_prefs:{dummy="callee"}\ncaller_peer_prefs:{dummy="caller"}\ncallee_peer_prefs:{dummy="callee"}\ncaller_dom_prefs:{dummy="caller"}\ncallee_dom_prefs:{dummy="callee"}\ncaller_usr_prefs:{dummy="caller"}\ncallee_usr_prefs:{dummy="callee"}\ncaller_real_prefs:{dummy="caller"}\ncallee_real_prefs:{dummy="callee"}\n') + assertEquals(tostring(self.ngcp), 'caller_contract_prefs:{dummy={"caller"}}\ncallee_contract_prefs:{dummy={"callee"}}\ncaller_peer_prefs:{dummy={"caller"}}\ncallee_peer_prefs:{dummy={"callee"}}\ncaller_dom_prefs:{dummy={"caller"}}\ncallee_dom_prefs:{dummy={"callee"}}\ncaller_usr_prefs:{dummy={"caller"}}\ncallee_usr_prefs:{dummy={"callee"}}\ncaller_real_prefs:{dummy={"caller"}}\ncallee_real_prefs:{dummy={"callee"}}\n') end -- class TestNGCP --EOF diff --git a/tests/ngcp_dp.lua b/tests/ngcp_dp.lua index fc8cbbe..1a86a53 100644 --- a/tests/ngcp_dp.lua +++ b/tests/ngcp_dp.lua @@ -194,7 +194,7 @@ TestNGCPDomainPrefs = {} --class local caller_xavp = NGCPDomainPrefs:xavp('caller') caller_xavp("other",1) caller_xavp("otherfoo","foo") - assertEquals(tostring(self.d), 'caller_dom_prefs:{other=1,otherfoo="foo",dummy="caller"}\ncallee_dom_prefs:{dummy="callee",testid=1,foo="foo"}\n') + assertEquals(tostring(self.d), 'caller_dom_prefs:{other={1},otherfoo={"foo"},dummy={"caller"}}\ncallee_dom_prefs:{dummy={"callee"},testid={1},foo={"foo"}}\n') end -- class TestNGCPDomainPrefs --EOF \ No newline at end of file diff --git a/tests/ngcp_pp.lua b/tests/ngcp_pp.lua index 269d3bf..7141375 100644 --- a/tests/ngcp_pp.lua +++ b/tests/ngcp_pp.lua @@ -209,7 +209,7 @@ TestNGCPPeerPrefs = {} --class local caller_xavp = NGCPPeerPrefs:xavp('caller') caller_xavp("other",1) caller_xavp("otherfoo","foo") - assertEquals(tostring(self.d), 'caller_peer_prefs:{other=1,otherfoo="foo",dummy="caller"}\ncallee_peer_prefs:{dummy="callee",testid=1,foo="foo"}\n') + assertEquals(tostring(self.d), 'caller_peer_prefs:{other={1},otherfoo={"foo"},dummy={"caller"}}\ncallee_peer_prefs:{dummy={"callee"},testid={1},foo={"foo"}}\n') end -- class TestNGCPPeerPrefs --EOF \ No newline at end of file diff --git a/tests/ngcp_rp.lua b/tests/ngcp_rp.lua index 0080d54..dbcc20f 100644 --- a/tests/ngcp_rp.lua +++ b/tests/ngcp_rp.lua @@ -260,7 +260,7 @@ TestNGCPRealPrefs = {} --class callee_xavp("foo","foo") caller_xavp("other",1) caller_xavp("otherfoo","foo") - assertEquals(tostring(self.real),'caller_real_prefs:{other=1,otherfoo="foo",dummy="caller"}\ncallee_real_prefs:{dummy="callee",testid=1,foo="foo"}\n') + assertEquals(tostring(self.real),'caller_real_prefs:{other={1},otherfoo={"foo"},dummy={"caller"}}\ncallee_real_prefs:{dummy={"callee"},testid={1},foo={"foo"}}\n') end -- class TestNGCPRealPrefs --EOF \ No newline at end of file diff --git a/tests/ngcp_up.lua b/tests/ngcp_up.lua index ed053bd..a425bee 100644 --- a/tests/ngcp_up.lua +++ b/tests/ngcp_up.lua @@ -213,7 +213,7 @@ TestNGCPUserPrefs = {} --class local caller_xavp = NGCPUserPrefs:xavp('caller') caller_xavp("other",1) caller_xavp("otherfoo","foo") - assertEquals(tostring(self.d),'caller_usr_prefs:{other=1,otherfoo="foo",dummy="caller"}\ncallee_usr_prefs:{dummy="callee",testid=1,foo="foo"}\n') + assertEquals(tostring(self.d), 'caller_usr_prefs:{other={1},otherfoo={"foo"},dummy={"caller"}}\ncallee_usr_prefs:{dummy={"callee"},testid={1},foo={"foo"}}\n') end -- class TestNGCPUserPrefs --EOF \ No newline at end of file diff --git a/tests/ngcp_xavp.lua b/tests/ngcp_xavp.lua index 957336a..e762090 100644 --- a/tests/ngcp_xavp.lua +++ b/tests/ngcp_xavp.lua @@ -135,7 +135,7 @@ TestNGCPXAvp = {} --class function TestNGCPXAvp:test_tostring() local xavp = NGCPXAvp:new("caller", "peer", {}) - assertEquals(tostring(xavp), '{dummy="caller"}') + assertEquals(tostring(xavp), '{dummy={"caller"}}') end function TestNGCPXAvp:test_keys()