app/test: rework command registration
[dpdk.git] / app / test / test_eal_flags.c
index d9c0d93..6202f05 100644 (file)
@@ -698,8 +698,8 @@ test_invalid_n_flag(void)
        const char *argv1[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n"};
        /* bad numeric value */
        const char *argv2[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n", "e" };
-       /* out-of-range value */
-       const char *argv3[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n", "9" };
+       /* zero is invalid */
+       const char *argv3[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n", "0" };
        /* sanity test - check with good value */
        const char *argv4[] = { prgname, prefix, no_huge, no_shconf, "-c", "1", "-n", "2" };
        /* sanity test - check with no -n flag */
@@ -1441,8 +1441,4 @@ test_eal_flags(void)
        return ret;
 }
 
-static struct test_command eal_flags_cmd = {
-       .command = "eal_flags_autotest",
-       .callback = test_eal_flags,
-};
-REGISTER_TEST_COMMAND(eal_flags_cmd);
+REGISTER_TEST_COMMAND(eal_flags_autotest, test_eal_flags);