]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/perf_index/perfindex-file_read.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tools / tests / perf_index / perfindex-file_read.c
CommitLineData
fe8ab488
A
1#include "perf_index.h"
2#include "fail.h"
3#include "test_file_helper.h"
4#include <sys/param.h>
5#include <stdio.h>
6
7char tempdir[MAXPATHLEN];
8
9DECL_SETUP {
0a7de745 10 char* retval;
fe8ab488 11
0a7de745 12 retval = setup_tempdir(tempdir);
fe8ab488 13
0a7de745 14 VERIFY(retval, "tempdir setup failed");
fe8ab488 15
0a7de745 16 printf("tempdir: %s\n", tempdir);
fe8ab488 17
0a7de745 18 return test_file_read_setup(tempdir, num_threads, length, 0L);
fe8ab488
A
19}
20
21DECL_TEST {
0a7de745 22 return test_file_read(tempdir, thread_id, num_threads, length, 0L);
fe8ab488
A
23}
24
25DECL_CLEANUP {
0a7de745 26 int retval;
fe8ab488 27
0a7de745
A
28 retval = test_file_read_cleanup(tempdir, num_threads, length);
29 VERIFY(retval == PERFINDEX_SUCCESS, "test_file_read_cleanup failed");
fe8ab488 30
0a7de745
A
31 retval = cleanup_tempdir(tempdir);
32 VERIFY(retval == 0, "cleanup_tempdir failed");
fe8ab488 33
0a7de745 34 return PERFINDEX_SUCCESS;
fe8ab488 35}