2 * SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) 2022 Michael Jeanson <mjeanson@efficios.com>
11 #include "compat-smp.h"
14 struct parse_test_data
{
19 static struct parse_test_data parse_test_data
[] = {
27 { "18446744073709551615", -1 },
28 { "0-2147483647", -1 },
29 { "0-18446744073709551615", -1 },
45 { "2147483647\n", -1 },
46 { "18446744073709551615\n", -1 },
47 { "0-2147483647\n", -1 },
48 { "0-18446744073709551615\n", -1 },
55 { "0,4-6,127\n", 127 },
59 static int parse_test_data_len
= sizeof(parse_test_data
) / sizeof(parse_test_data
[0]);
65 plan_tests(parse_test_data_len
);
67 diag("Testing smp helpers");
69 for (i
= 0; i
< parse_test_data_len
; i
++) {
70 ret
= get_max_cpuid_from_mask(parse_test_data
[i
].buf
,
71 strlen(parse_test_data
[i
].buf
));
72 ok(ret
== parse_test_data
[i
].expected
,
73 "get_max_cpuid_from_mask '%s', expected: '%d', result: '%d'",
74 parse_test_data
[i
].buf
, parse_test_data
[i
].expected
, ret
);
84 plan_skip_all("Linux specific tests.");