xref: /dpdk/app/test/test_cmdline.c (revision e0a8442ccd15bafbb7eb150c35331c8e3b828c53)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 
5 #include <stdio.h>
6 
7 #include "test.h"
8 #include "test_cmdline.h"
9 
10 static int
test_cmdline(void)11 test_cmdline(void)
12 {
13 	printf("Testind parsing ethernet addresses...\n");
14 	if (test_parse_etheraddr_valid() < 0)
15 		return -1;
16 	if (test_parse_etheraddr_invalid_data() < 0)
17 		return -1;
18 	if (test_parse_etheraddr_invalid_param() < 0)
19 		return -1;
20 	printf("Testind parsing port lists...\n");
21 	if (test_parse_portlist_valid() < 0)
22 		return -1;
23 	if (test_parse_portlist_invalid_data() < 0)
24 		return -1;
25 	if (test_parse_portlist_invalid_param() < 0)
26 		return -1;
27 	printf("Testind parsing numbers...\n");
28 	if (test_parse_num_valid() < 0)
29 		return -1;
30 	if (test_parse_num_invalid_data() < 0)
31 		return -1;
32 	if (test_parse_num_invalid_param() < 0)
33 		return -1;
34 	printf("Testing parsing IP addresses...\n");
35 	if (test_parse_ipaddr_valid() < 0)
36 		return -1;
37 	if (test_parse_ipaddr_invalid_data() < 0)
38 		return -1;
39 	if (test_parse_ipaddr_invalid_param() < 0)
40 		return -1;
41 	printf("Testing parsing strings...\n");
42 	if (test_parse_string_valid() < 0)
43 		return -1;
44 	if (test_parse_string_invalid_data() < 0)
45 		return -1;
46 	if (test_parse_string_invalid_param() < 0)
47 		return -1;
48 	printf("Testing circular buffer...\n");
49 	if (test_cirbuf_char() < 0)
50 		return -1;
51 	if (test_cirbuf_string() < 0)
52 		return -1;
53 	if (test_cirbuf_align() < 0)
54 		return -1;
55 	if (test_cirbuf_invalid_param() < 0)
56 		return -1;
57 	printf("Testing library functions...\n");
58 	if (test_cmdline_lib() < 0)
59 		return -1;
60 	return 0;
61 }
62 
63 REGISTER_FAST_TEST(cmdline_autotest, true, true, test_cmdline);
64