diff options
author | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2016-10-17 13:26:09 +0100 |
---|---|---|
committer | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2016-10-17 13:31:16 +0100 |
commit | 128f0192aeb75682f2ed7ff643b4587c7f86f5dc (patch) | |
tree | e46909a28dac01a3ef0136c9da0a6643e16c3427 | |
parent | 44222fc2300cd43bb52e5c1ac7050e27fc4c6b6e (diff) |
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 <konstantin.ananyev@intel.com>
-rw-r--r-- | test/gtest/test_tle_udp_stream.h | 26 |
1 files changed, 25 insertions, 1 deletions
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 <tle_udp_impl.h> #include <tle_event.h> +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); |