From 128f0192aeb75682f2ed7ff643b4587c7f86f5dc Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Mon, 17 Oct 2016 13:26:09 +0100 Subject: test/gtest: fix stream open test-cases fail Update gtest code to spify lookup callback routinies at context creation. fixes 2fea8d3d522d31cb ("don't allow to open stream for unsupported family"). Change-Id: Idf89be22d60ee7e2707efab5f4c6abb0220f47a9 Signed-off-by: Konstantin Ananyev --- test/gtest/test_tle_udp_stream.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/test/gtest/test_tle_udp_stream.h b/test/gtest/test_tle_udp_stream.h index a5d166b..d0256c3 100644 --- a/test/gtest/test_tle_udp_stream.h +++ b/test/gtest/test_tle_udp_stream.h @@ -24,6 +24,26 @@ #include #include +int +dummy_lookup4(void *opaque, const struct in_addr *addr, + struct tle_udp_dest *res) +{ + RTE_SET_USED(opaque); + RTE_SET_USED(addr); + RTE_SET_USED(res); + return -ENOENT; +} + +int +dummy_lookup6(void *opaque, const struct in6_addr *addr, + struct tle_udp_dest *res) +{ + RTE_SET_USED(opaque); + RTE_SET_USED(addr); + RTE_SET_USED(res); + return -ENOENT; +} + struct tle_udp_ctx_param ctx_prm_tmpl = { .socket_id = SOCKET_ID_ANY, .max_streams = 0x10, @@ -50,12 +70,16 @@ public: char const *ipv4_laddr = "192.168.0.1"; char const *ipv4_raddr = "192.168.0.2"; char const *ipv6 = "fe80::21e:67ff:fec2:2568"; + struct tle_udp_ctx_param cprm; ctx = nullptr; dev = nullptr; stream = nullptr; /* Setup Context */ - ctx = setup_ctx(&ctx_prm_tmpl); + cprm = ctx_prm_tmpl; + cprm.lookup4 = dummy_lookup4; + cprm.lookup6 = dummy_lookup6; + ctx = setup_ctx(&cprm); /* Setup Dev */ memset(&dev_prm, 0, sizeof(dev_prm)); setup_dev_prm(&dev_prm, ipv4_laddr, ipv6); -- cgit 1.2.3-korg