Advertisement
Guest User

Untitled

a guest
May 30th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1.  
  2. /* A mock fprintf function that checks the value of strings printed to the
  3.  * standard error stream. */
  4. int example_test_fprintf(FILE* const file, const char *format, ...) {
  5.     int return_value;
  6.     va_list args;
  7.     assert_true(file == stderr);
  8.     va_start(args, format);
  9.     return_value = vsnprintf(temporary_buffer, sizeof(temporary_buffer), format, args);
  10.     check_expected_ptr(temporary_buffer);
  11.     va_end(args);
  12.     return return_value;
  13. }
  14.  
  15. /* A mock printf function that checks the value of strings printed to the
  16.  * standard output stream. */
  17. int example_test_printf(const char *format, ...) {
  18.     int return_value;
  19.     va_list args;
  20.     va_start(args, format);
  21.     return_value = vsnprintf(temporary_buffer, sizeof(temporary_buffer), format, args);
  22.     check_expected_ptr(temporary_buffer);
  23.     va_end(args);
  24.     return return_value;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement