diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-10-03 08:54:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-10-04 08:03:19 -0400 |
commit | 4a0749596cc21198dd853bb0c631e9658db7fe2d (patch) | |
tree | 6a23a73b7678df168928895acbff434980a7a728 /src/test/resolve_test_helpers.h | |
parent | 9c24ceeb3f2082193bf76a77ad6d6d011561e239 (diff) | |
download | tor-4a0749596cc21198dd853bb0c631e9658db7fe2d.tar.gz tor-4a0749596cc21198dd853bb0c631e9658db7fe2d.zip |
Add a mock replacement for blocking hostname resolution
Based on examination of our tests, this mock function accepts
"localhost" and "torproject.org", and rejects everything else.
Diffstat (limited to 'src/test/resolve_test_helpers.h')
-rw-r--r-- | src/test/resolve_test_helpers.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/resolve_test_helpers.h b/src/test/resolve_test_helpers.h new file mode 100644 index 0000000000..e7d2e29373 --- /dev/null +++ b/src/test/resolve_test_helpers.h @@ -0,0 +1,18 @@ +/* Copyright (c) 2001 Matej Pfajfar. + * Copyright (c) 2001-2004, Roger Dingledine. + * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. + * Copyright (c) 2007-2019, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * @file resolve_test_helpers.h + * @brief Header for test/resolve_test_helpers.c + **/ + +#ifndef TOR_TEST_RESOLVE_TEST_HELPERS_H +#define TOR_TEST_RESOLVE_TEST_HELPERS_H + +void mock_hostname_resolver(void); +void unmock_hostname_resolver(void); + +#endif /* !defined(TOR_TEST_RESOLVE_TEST_HELPERS_H) */ |