소스 검색

bandwidth: Fix test in no-cpu case

Samuel Thibault 5 년 전
부모
커밋
c13973f404
1개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  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;
 }