Add common unit test macros
This commit is contained in:
		
							parent
							
								
									2f3dcbed1f
								
							
						
					
					
						commit
						7bbd74cb17
					
				
							
								
								
									
										12
									
								
								test/unit/unittest.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								test/unit/unittest.h
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | ||||
| /* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
 | ||||
|  * SPDX-License-Identifier: GPL-3.0-or-later */ | ||||
| 
 | ||||
| #ifndef UNITTEST_H | ||||
| #define UNITTEST_H | ||||
| 
 | ||||
| #include "common.h" | ||||
| 
 | ||||
| #define OK(x) do { if ((x) != 0) { die(#x " failed"); } } while (0) | ||||
| #define ERR(x) do { if ((x) == 0) { die(#x " didn't fail"); } } while (0) | ||||
| 
 | ||||
| #endif /* UNITTEST_H */ | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user