File: test_cmdline.c

package info (click to toggle)
dpdk 25.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 127,892 kB
  • sloc: ansic: 2,358,479; python: 16,426; sh: 4,474; makefile: 1,713; awk: 70
file content (63 lines) | stat: -rw-r--r-- 1,611 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2010-2014 Intel Corporation
 */

#include <stdio.h>

#include "test.h"
#include "test_cmdline.h"

static int
test_cmdline(void)
{
	printf("Testind parsing ethernet addresses...\n");
	if (test_parse_etheraddr_valid() < 0)
		return -1;
	if (test_parse_etheraddr_invalid_data() < 0)
		return -1;
	if (test_parse_etheraddr_invalid_param() < 0)
		return -1;
	printf("Testind parsing port lists...\n");
	if (test_parse_portlist_valid() < 0)
		return -1;
	if (test_parse_portlist_invalid_data() < 0)
		return -1;
	if (test_parse_portlist_invalid_param() < 0)
		return -1;
	printf("Testind parsing numbers...\n");
	if (test_parse_num_valid() < 0)
		return -1;
	if (test_parse_num_invalid_data() < 0)
		return -1;
	if (test_parse_num_invalid_param() < 0)
		return -1;
	printf("Testing parsing IP addresses...\n");
	if (test_parse_ipaddr_valid() < 0)
		return -1;
	if (test_parse_ipaddr_invalid_data() < 0)
		return -1;
	if (test_parse_ipaddr_invalid_param() < 0)
		return -1;
	printf("Testing parsing strings...\n");
	if (test_parse_string_valid() < 0)
		return -1;
	if (test_parse_string_invalid_data() < 0)
		return -1;
	if (test_parse_string_invalid_param() < 0)
		return -1;
	printf("Testing circular buffer...\n");
	if (test_cirbuf_char() < 0)
		return -1;
	if (test_cirbuf_string() < 0)
		return -1;
	if (test_cirbuf_align() < 0)
		return -1;
	if (test_cirbuf_invalid_param() < 0)
		return -1;
	printf("Testing library functions...\n");
	if (test_cmdline_lib() < 0)
		return -1;
	return 0;
}

REGISTER_FAST_TEST(cmdline_autotest, true, true, test_cmdline);