test_helpers.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* Copyright (c) 2017-2019, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. #ifndef TOR_TEST_HELPERS_H
  4. #define TOR_TEST_HELPERS_H
  5. #define BUFFERS_PRIVATE
  6. #include "core/or/or.h"
  7. #include "tinytest.h"
  8. const char *get_yesterday_date_str(void);
  9. circuit_t * dummy_origin_circuit_new(int num_cells);
  10. /* Number of descriptors contained in test_descriptors.txt. */
  11. #define HELPER_NUMBER_OF_DESCRIPTORS 8
  12. void helper_setup_fake_routerlist(void);
  13. #define GET(path) "GET " path " HTTP/1.0\r\n\r\n"
  14. void connection_write_to_buf_mock(const char *string, size_t len,
  15. connection_t *conn, int compressed);
  16. char *buf_get_contents(buf_t *buf, size_t *sz_out);
  17. int mock_tor_addr_lookup__fail_on_bad_addrs(const char *name,
  18. uint16_t family, tor_addr_t *out);
  19. connection_t *test_conn_get_connection(uint8_t state,
  20. uint8_t type, uint8_t purpose);
  21. or_options_t *helper_parse_options(const char *conf);
  22. extern const char TEST_DESCRIPTORS[];
  23. void *helper_setup_pubsub(const struct testcase_t *);
  24. int helper_cleanup_pubsub(const struct testcase_t *, void *);
  25. extern const struct testcase_setup_t helper_pubsub_setup;
  26. #endif /* !defined(TOR_TEST_HELPERS_H) */