Test reading with and without malloc
This commit is contained in:
		@@ -33,12 +33,24 @@ struct reptester {
 | 
			
		||||
  reptest_results results;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct reptest_func {
 | 
			
		||||
  const char *name;
 | 
			
		||||
  void (*func)(reptester *tester);
 | 
			
		||||
enum alloc_type {
 | 
			
		||||
  ALLOC_TYPE_WITHOUT_MALLOC,
 | 
			
		||||
  ALLOC_TYPE_WITH_MALLOC,
 | 
			
		||||
 | 
			
		||||
  COUNT_ALLOC_TYPE,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void run_func_test(reptester *tester, reptest_func func_obj);
 | 
			
		||||
typedef void (*reptest_func)(reptester *tester, alloc_type type);
 | 
			
		||||
 | 
			
		||||
struct func_data {
 | 
			
		||||
  const char *names[COUNT_ALLOC_TYPE];
 | 
			
		||||
  reptest_func func;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void handle_alloc(reptester *tester, alloc_type type);
 | 
			
		||||
void handle_free(reptester *tester, alloc_type type);
 | 
			
		||||
void run_func_test(reptester *tester, reptest_func func, const char *func_name,
 | 
			
		||||
                   alloc_type type);
 | 
			
		||||
void print_results(reptester *tester, const char *name);
 | 
			
		||||
 | 
			
		||||
#endif // !REPTESTER_H
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user