log_test_helpers.h 869 B

12345678910111213141516171819202122232425262728293031
  1. /* Copyright (c) 2014-2015, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. #include "or.h"
  4. #ifndef TOR_LOG_TEST_HELPERS_H
  5. #define TOR_LOG_TEST_HELPERS_H
  6. typedef struct mock_saved_log_entry_t {
  7. int severity;
  8. const char *funcname;
  9. const char *suffix;
  10. const char *format;
  11. char *generated_msg;
  12. struct mock_saved_log_entry_t *next;
  13. } mock_saved_log_entry_t;
  14. void mock_saving_logv(int severity, log_domain_mask_t domain,
  15. const char *funcname, const char *suffix,
  16. const char *format, va_list ap)
  17. CHECK_PRINTF(5, 0);
  18. void mock_clean_saved_logs(void);
  19. const smartlist_t *mock_saved_logs(void);
  20. int setup_capture_of_logs(int new_level);
  21. void teardown_capture_of_logs(int prev);
  22. const char *mock_saved_log_at(int ix);
  23. int mock_saved_severity_at(int ix);
  24. int mock_saved_log_number(void);
  25. #endif