]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/perf_index/perfindex-ram_file_create.c
xnu-3248.60.10.tar.gz
[apple/xnu.git] / tools / tests / perf_index / perfindex-ram_file_create.c
1 #include "perf_index.h"
2 #include "fail.h"
3 #include "test_file_helper.h"
4 #include "ramdisk.h"
5 #include <sys/param.h>
6 #include <stdio.h>
7
8 const char ramdisk_name[] = "StressRAMDisk";
9 char ramdisk_path[MAXPATHLEN];
10
11 DECL_SETUP {
12 int retval;
13
14 retval = setup_ram_volume(ramdisk_name, ramdisk_path);
15 VERIFY(retval == PERFINDEX_SUCCESS, "setup_ram_volume failed");
16
17 printf("ramdisk: %s\n", ramdisk_path);
18
19 return PERFINDEX_SUCCESS;
20 }
21
22 DECL_TEST {
23 return test_file_create(ramdisk_path, thread_id, num_threads, length);
24 }
25
26 DECL_CLEANUP {
27 int retval;
28
29 retval = cleanup_ram_volume(ramdisk_path);
30 VERIFY(retval == 0, "cleanup_ram_volume failed");
31
32 return PERFINDEX_SUCCESS;
33 }