app/test: rework command registration
[dpdk.git] / app / test / test_table.c
index 970d15c..1faa0a6 100644 (file)
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
-#ifndef RTE_LIBRTE_TABLE
-
-#include "test.h"
-
-int
-test_table(void)
-{
-       return 0;
-}
-
-#else
-
 #include <rte_byteorder.h>
 #include <rte_hexdump.h>
 #include <rte_string_fns.h>
@@ -102,15 +89,10 @@ app_init_mbuf_pools(void)
        printf("Getting/Creating the mempool ...\n");
        pool = rte_mempool_lookup("mempool");
        if (!pool) {
-               pool = rte_mempool_create(
+               pool = rte_pktmbuf_pool_create(
                        "mempool",
                        POOL_SIZE,
-                       POOL_BUFFER_SIZE,
-                       POOL_CACHE_SIZE,
-                       sizeof(struct rte_pktmbuf_pool_private),
-                       rte_pktmbuf_pool_init, NULL,
-                       rte_pktmbuf_init, NULL,
-                       0,
+                       POOL_CACHE_SIZE, 0, POOL_BUFFER_SIZE,
                        0);
                if (pool == NULL)
                        rte_panic("Cannot create mbuf pool\n");
@@ -156,7 +138,7 @@ app_init_rings(void)
 
 }
 
-int
+static int
 test_table(void)
 {
        int status, failures;
@@ -210,11 +192,11 @@ test_table(void)
 
 #ifdef RTE_LIBRTE_ACL
        printf("\n\n\n\n************ACL tests************\n");
-       if (test_table_ACL() < 0)
+       if (test_table_acl() < 0)
                return -1;
 #endif
 
        return 0;
 }
 
-#endif
+REGISTER_TEST_COMMAND(table_autotest, test_table);