aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_dns.c
AgeCommit message (Collapse)Author
2020-02-18Replace identifiers related to clipping DNS ttls.Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ MIN_DNS_TTL_AT_EXIT MIN_DNS_TTL \ MAX_DNS_TTL_AT_EXIT MAX_DNS_TTL \ dns_clip_ttl clip_dns_ttl
2020-01-09Fix wide lines from NS() removal fallout.Nick Mathewson
2020-01-09Remove all usage of the NS*() macros in test*.cNick Mathewson
This is an automatically generated commit, made with the following kludgey perl script. It results in a number of wide lines, which I'll clean up in a subsequent commit. #/usr/bin/perl -w -i $mod = "NS_MODULE"; $submod = "NS_SUBMODULE"; $last_was_empty = 0; while (<>) { s/\bASPECT\(\s*(\w+)\s*,\s*(\w+)\s*\)/$1_$2/; if (/# *define +NS_MODULE +(\w+)/) { $mod = $1; next; } elsif (/# *define +NS_SUBMODULE +(\w+)/) { $submod = $1; next; } next if (/#undef NS_(SUB)?MODULE/); s/NS\(\s*test_main\s*\)/test_${mod}_${submod}/; s/NS\(\s*(\w+)\s*\)/${mod}_${submod}_$1/g; s/NS_FULL\(\\s*(\w+)\s*,\s*(\w+),\s*(\w+)\s*\)/$1_$2_$3/; s/^(\s*)NS_MOCK\(\s*(\w+)\s*\)/$1MOCK($2,\n$1 ${mod}_${submod}_$2)/; s/NS_UNMOCK\(\s*(\w+)\s*\)/UNMOCK($1)/; s/TEST_CASE\(\s*(\w+)\s*\)/{ "$1", test_${mod}_$1, TT_FORK, NULL, NULL }/; s/TEST_CASE_ASPECT\(\s*(\w+)\s*,\s*(\w+)\s*\)/{ "$1_$2", test_${mod}_$1_$2, TT_FORK, NULL, NULL }/; s/NS_DECL\(\s*([^,]+)\s*,\s*([^,]+)\s*,\s*(\(.*)\);/static $1 ${mod}_${submod}_$2$3;\nATTR_UNUSED static int ${mod}_${submod}_$2_called = 0;/; s/\bCALLED\(\s*(\w+)\s*\)/${mod}_${submod}_$1_called/; if (/^$/) { print if (! $last_was_empty); $last_was_empty = 1; } else { $last_was_empty = 0; print; } if (eof) { $mod = "NS_MODULE"; $submod = "NS_SUBMODULE"; $last_was_empty = 0; } } # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Thu Jan 9 10:26:10 2020 -0500 # # On branch disable_ns_macro # Changes to be committed: # modified: src/test/test_accounting.c # modified: src/test/test_compat_libevent.c # modified: src/test/test_dir.c # modified: src/test/test_dir_handle_get.c # modified: src/test/test_dns.c # modified: src/test/test_options.c # modified: src/test/test_procmon.c # modified: src/test/test_rendcache.c # modified: src/test/test_router.c # modified: src/test/test_routerset.c # modified: src/test/test_status.c # modified: src/test/test_tortls.c # modified: src/test/test_tortls_openssl.c # modified: src/test/test_util_format.c # modified: src/test/test_util_process.c # # Untracked files: # experiments/ # locate_options.sh # un_ns.pl # # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Thu Jan 9 10:26:10 2020 -0500 # # On branch disable_ns_macro # Changes to be committed: # modified: src/test/test_accounting.c # modified: src/test/test_compat_libevent.c # modified: src/test/test_dir.c # modified: src/test/test_dir_handle_get.c # modified: src/test/test_dns.c # modified: src/test/test_options.c # modified: src/test/test_procmon.c # modified: src/test/test_rendcache.c # modified: src/test/test_router.c # modified: src/test/test_routerset.c # modified: src/test/test_status.c # modified: src/test/test_tortls.c # modified: src/test/test_tortls_openssl.c # modified: src/test/test_util_format.c # modified: src/test/test_util_process.c # # Untracked files: # experiments/ # locate_options.sh # un_ns.pl #
2020-01-09Replace various NS_MODULE/SUBMODULE vals with shorter names.Nick Mathewson
This will help avoid wide lines in our output.
2020-01-09Put all NS_DECL invocations on single lines.Nick Mathewson
This is going to make my script happier; these lines will soon disappear.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-06-05Run "make autostyle."Nick Mathewson
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-10-20Exclude test and a supporting function when evdns_base_get_nameserver_addr() ↵rl1987
is not available
2018-10-20Unit test for DNS fallback in configure_nameserversrl1987
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-01Extract more constants from or.hNick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-06-15Split entry and edge_connection_t into their own headers.Nick Mathewson
2017-12-08Convert connection_free to a nulling macro.Nick Mathewson
2017-10-27Make sure all C files have copyright/license noticesNick Mathewson
2017-08-24Fix operator usage in src/test/*.cAlexander Færøy
This patch fixes the operator usage in src/test/*.c to use the symbolic operators instead of the normal C comparison operators. This patch was generated using: ./scripts/coccinelle/test-operator-cleanup src/test/*.[ch]
2017-01-18DefecTor countermeasure: change server- and client-side DNS TTL clippingNick Mathewson
The server-side clipping now clamps to one of two values, both for what to report, and how long to cache. Additionally, we move some defines to dns.h, and give them better names.
2016-07-28Fix all -Wshadow warnings on LinuxNick Mathewson
This is a partial fix for 18902.
2016-02-04Fix two problems in the 0.2.8.x unit testsNick Mathewson
1. We were sometimes using libevent uninitialized, which is Not Allowed. 2. The malformed-PTR dns test was supposed to get a -1 output... but the test was wrong, since it forgot that in-addr.arpa addresses are in reverse order. Bugs not in any released tor.
2015-12-18Fix a coverity NULL-pointer deref warning in the DNS tests.Nick Mathewson
This is CID 1340251
2015-12-15Fix some memory leaks in the unit testsNick Mathewson
2015-10-29Fix GCC warnings.rl1987
2015-10-24Seventh test case for dns_resolve_impl().rl1987
2015-10-24Sixth test case for dns_resolve_impl.rl1987
2015-10-24Add a fifth unit test.rl1987
2015-10-24Whitespace fixes.rl1987
2015-10-24Add a fourth test case.rl1987
2015-10-24Third test case for dns_resolve_impl.rl1987
2015-10-24A second test case for dns_resolve_impl.rl1987
2015-10-24Making it slightly cleaner.rl1987
2015-10-24First test case for dns_resolve_impl().rl1987
2015-10-24Using namespace macros for mock functions in test_dns.crl1987
2015-10-24Use NS_SUBMODULEs in test_dns.crl1987
2015-08-26Fix some memory issues in test_dns.cNick Mathewson
2015-08-26Resolve check-spaces in test_dns.cNick Mathewson
2015-08-26fix compilation warnings in test_dns.cNick Mathewson
2015-08-23Unit test dns_resolve(), dns_clip_ttl(), dns_get_expiry_ttl().rl1987