mbuf: decrease reference counter when detaching
[dpdk.git] / app / test / test_mbuf.c
index 98ff93a..8460db7 100644 (file)
@@ -511,10 +511,14 @@ test_attach_from_different_pool(void)
        rte_pktmbuf_detach(clone);
        if (c_data != rte_pktmbuf_mtod(clone, char *))
                GOTO_FAIL("clone was not detached properly\n");
+       if (rte_mbuf_refcnt_read(m) != 2)
+               GOTO_FAIL("invalid refcnt in m\n");
 
        rte_pktmbuf_detach(clone2);
        if (c_data2 != rte_pktmbuf_mtod(clone2, char *))
                GOTO_FAIL("clone2 was not detached properly\n");
+       if (rte_mbuf_refcnt_read(m) != 1)
+               GOTO_FAIL("invalid refcnt in m\n");
 
        /* free the clones and the initial mbuf */
        rte_pktmbuf_free(clone2);