]>
Commit | Line | Data |
---|---|---|
fe8ab488 A |
1 | #include "perf_index.h" |
2 | #include "fail.h" | |
3 | #include "test_file_helper.h" | |
4 | #include <stdio.h> | |
5 | #include <sys/param.h> | |
6 | #include <unistd.h> | |
7 | ||
8 | char tempdir[MAXPATHLEN]; | |
9 | ||
10 | DECL_SETUP { | |
0a7de745 | 11 | char* retval; |
fe8ab488 | 12 | |
0a7de745 | 13 | retval = setup_tempdir(tempdir); |
fe8ab488 | 14 | |
0a7de745 | 15 | VERIFY(retval, "tempdir setup failed"); |
fe8ab488 | 16 | |
0a7de745 | 17 | printf("tempdir: %s\n", tempdir); |
fe8ab488 | 18 | |
0a7de745 | 19 | return test_file_write_setup(tempdir, num_threads, length); |
fe8ab488 A |
20 | } |
21 | ||
22 | DECL_TEST { | |
0a7de745 | 23 | return test_file_write(tempdir, thread_id, num_threads, length, 0L); |
fe8ab488 A |
24 | } |
25 | ||
26 | DECL_CLEANUP { | |
0a7de745 | 27 | int retval; |
fe8ab488 | 28 | |
0a7de745 A |
29 | retval = test_file_write_cleanup(tempdir, num_threads, length); |
30 | VERIFY(retval == PERFINDEX_SUCCESS, "test_file_read_cleanup failed"); | |
fe8ab488 | 31 | |
0a7de745 A |
32 | retval = cleanup_tempdir(tempdir); |
33 | VERIFY(retval == 0, "cleanup_tempdir failed"); | |
fe8ab488 | 34 | |
0a7de745 | 35 | return PERFINDEX_SUCCESS; |
fe8ab488 | 36 | } |