xref: /xnu-8796.121.2/tools/tests/perf_index/perfindex-file_create.c (revision c54f35ca767986246321eb901baf8f5ff7923f6a)
1*c54f35caSApple OSS Distributions #include "perf_index.h"
2*c54f35caSApple OSS Distributions #include "fail.h"
3*c54f35caSApple OSS Distributions #include "test_file_helper.h"
4*c54f35caSApple OSS Distributions #include <stdio.h>
5*c54f35caSApple OSS Distributions #include <sys/param.h>
6*c54f35caSApple OSS Distributions #include <unistd.h>
7*c54f35caSApple OSS Distributions 
8*c54f35caSApple OSS Distributions char tempdir[MAXPATHLEN];
9*c54f35caSApple OSS Distributions 
10*c54f35caSApple OSS Distributions DECL_SETUP {
11*c54f35caSApple OSS Distributions 	char* retval;
12*c54f35caSApple OSS Distributions 
13*c54f35caSApple OSS Distributions 	retval = setup_tempdir(tempdir);
14*c54f35caSApple OSS Distributions 
15*c54f35caSApple OSS Distributions 	VERIFY(retval, "tempdir setup failed");
16*c54f35caSApple OSS Distributions 
17*c54f35caSApple OSS Distributions 	printf("tempdir: %s\n", tempdir);
18*c54f35caSApple OSS Distributions 
19*c54f35caSApple OSS Distributions 	return PERFINDEX_SUCCESS;
20*c54f35caSApple OSS Distributions }
21*c54f35caSApple OSS Distributions 
22*c54f35caSApple OSS Distributions DECL_TEST {
23*c54f35caSApple OSS Distributions 	return test_file_create(tempdir, thread_id, num_threads, length);
24*c54f35caSApple OSS Distributions }
25*c54f35caSApple OSS Distributions 
26*c54f35caSApple OSS Distributions DECL_CLEANUP {
27*c54f35caSApple OSS Distributions 	int retval;
28*c54f35caSApple OSS Distributions 
29*c54f35caSApple OSS Distributions 	retval = cleanup_tempdir(tempdir);
30*c54f35caSApple OSS Distributions 	VERIFY(retval == 0, "cleanup_tempdir failed");
31*c54f35caSApple OSS Distributions 
32*c54f35caSApple OSS Distributions 	return PERFINDEX_SUCCESS;
33*c54f35caSApple OSS Distributions }
34