Explorar o código

bandwidth: Fix test in no-cpu case

Samuel Thibault %!s(int64=5) %!d(string=hai) anos
pai
achega
c13973f404
Modificáronse 1 ficheiros con 3 adicións e 6 borrados
  1. 3 6
      tests/microbenchs/bandwidth.c

+ 3 - 6
tests/microbenchs/bandwidth.c

@@ -186,6 +186,9 @@ int main(int argc, char **argv)
 	total_ncpus = starpu_cpu_worker_get_count();
 	starpu_shutdown();
 
+	if (total_ncpus == 0)
+		return STARPU_TEST_SKIPPED;
+
 	result = malloc(total_ncpus * sizeof(result[0]));
 	buffers = malloc(total_ncpus * sizeof(*buffers));
 	for (n = 0; n < total_ncpus; n++)
@@ -223,10 +226,4 @@ int main(int argc, char **argv)
 		free(buffers[n]);
 
 	return EXIT_SUCCESS;
-
-enodev:
-	fprintf(stderr, "WARNING: No one can execute this task\n");
-	free(result);
-	starpu_shutdown();
-	return STARPU_TEST_SKIPPED;
 }