tests: Correctly parse number of host cpus > 255

test_cpu_affinity needs the number of host CPUs. Since it is possible
for the host to have more than 255 CPUs; increase the size of the
datatype used for parsing the string to accomodate this.

Signed-off-by: dom.song <dom.song@amperecomputing.com>
This commit is contained in:
dom.song 2023-07-06 16:41:05 +08:00 committed by Bo Chen
parent dbce6cb1ce
commit 99d42bb05e

View File

@ -2439,7 +2439,7 @@ mod common_parallel {
assert!(
String::from_utf8_lossy(&host_cpus_count.stdout)
.trim()
.parse::<u8>()
.parse::<u16>()
.unwrap_or(0)
>= 4
);