diff mbox series

[v2,9/11] validation: pktio: don't pass invalid handle to index conversion

Message ID 1517407211-19105-10-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v2,1/11] linux-gen: packet: use inlined flow hash and ts set | expand

Commit Message

Github ODP bot Jan. 31, 2018, 2 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Fast path functions cannot be expected to always check against
invalid handles. Also a handle that has been closed (or destroyed)
must not be passed to any API function.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** Email created from pull request 437 (psavol:master-packet-optim)
 ** https://github.com/Linaro/odp/pull/437
 ** Patch: https://github.com/Linaro/odp/pull/437.patch
 ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd
 ** Merge commit sha: 3c2134ecc18e4fd52cd526b5c067815ca73864cc
 **/
 test/validation/api/pktio/pktio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c
index a23641036..b20272ffc 100644
--- a/test/validation/api/pktio/pktio.c
+++ b/test/validation/api/pktio/pktio.c
@@ -1183,7 +1183,7 @@  void pktio_test_lookup(void)
 
 void pktio_test_index(void)
 {
-	odp_pktio_t pktio, pktio_inval = ODP_PKTIO_INVALID;
+	odp_pktio_t pktio;
 	odp_pktio_param_t pktio_param;
 	int ndx;
 
@@ -1195,10 +1195,8 @@  void pktio_test_index(void)
 
 	ndx = odp_pktio_index(pktio);
 	CU_ASSERT(ndx >= 0);
-	CU_ASSERT(odp_pktio_index(pktio_inval) < 0);
 
 	CU_ASSERT(odp_pktio_close(pktio) == 0);
-	CU_ASSERT(odp_pktio_index(pktio) < 0);
 }
 
 static void pktio_test_print(void)