Advertisement
Guest User

utils.h

a guest
May 30th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. /*
  2.  * utils.h
  3.  *
  4.  *  Created on: 30 May 2015
  5.  *      Author: supermaja
  6.  */
  7.  
  8. #ifndef UTILS_H_
  9. #define UTILS_H_
  10.  
  11.  
  12. #ifdef UNIT_TESTING
  13.  
  14. /* All functions in this object need to be exposed to the test application,
  15.  * so redefine static to nothing. */
  16. #define static
  17.  
  18. extern int example_test_fprintf(FILE * const file, const char *format, ...);
  19.  
  20.  
  21. /* Redirect fprintf to a function in the test application so it's possible to
  22.  * test error messages. */
  23. #ifdef fprintf
  24. #undef fprintf
  25. #endif /* fprintf */
  26. #define fprintf example_test_fprintf
  27.  
  28.  
  29.  
  30. #endif /* UNIT_TESTING */
  31.  
  32.  
  33. #endif /* UTILS_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement