瀏覽代碼

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