Age | Commit message (Collapse) | Author |
|
I added this so I could write a unit test for ServerTransportOptions,
but it incidentally exercises the succeed-on-defaults case of
options_validate too.
|
|
|
|
This removes some INLINE markers from functions that probably didn't
need them.
|
|
|
|
Conflicts:
src/test/test_pt.c
|
|
|
|
|
|
|
|
Since we are going to be using that function to also escape parameters
passed to transport proxies using environment variables.
|
|
This is in preparation for using tor_escape_str_for_socks_arg() to
escape server-side pluggable transport parameters.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We used to test parse_{c,s}method_line() without actually testing that
the resulting transport_t was well formed.
|
|
|
|
Better tests for upper bounds, and for failing cases.
Also, change the function's interface to take a buffer length rather
than a maximum length, and then NUL-terminate: functions that don't
NUL-terminate are trouble waiting to happen.
|
|
format_hex_number_sigsafe
|
|
There are some other places in the code that will want a signal-safe
way to format numbers, so it shouldn't be static to util.c.
|
|
The only thing that used format_helper_exit_status on win32 was the
unit tests. This caused an error when we tried to leave a static
format_helper_exit_status lying around in a production object file.
The easiest solution is to admit that this way of dealing with process
exit status is Unix-only.
|
|
Fixes #9261.
|
|
These show off the new mocking code by mocking the circuitmux code
so that we can test the circuit map code in isolation.
|
|
If you pass the --enable-coverage flag on the command line, we build
our testing binaries with appropriate options eo enable coverage
testing. We also build a "tor-cov" binary that has coverage enabled,
for integration tests.
On recent OSX versions, test coverage only works with clang, not gcc.
So we warn about that.
Also add a contrib/coverage script to actually run gcov with the
appropriate options to generate useful .gcov files. (Thanks to
automake, the .o files will not have the names that gcov expects to
find.)
Also, remove generated gcda and gcno files on clean.
|
|
We previously used FILENAME_PRIVATE identifiers mostly for
identifiers exposed only to the unit tests... but also for
identifiers exposed to the benchmarker, and sometimes for
identifiers exposed to a similar module, and occasionally for no
really good reason at all.
Now, we use FILENAME_PRIVATE identifiers for identifiers shared by
Tor and the unit tests. They should be defined static when we
aren't building the unit test, and globally visible otherwise. (The
STATIC macro will keep us honest here.)
For identifiers used only by the unit tests and never by Tor at all,
on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS.
This is not the motivating use case for the split test/non-test
build system; it's just a test example to see how it works, and to
take a chance to clean up the code a little.
|
|
This is mainly a matter of automake trickery: we build each static
library in two versions now: one with the TOR_UNIT_TESTS macro
defined, and one without. When TOR_UNIT_TESTS is defined, we can
enable mocking and expose more functions. When it's not defined, we
can lock the binary down more.
The alternatives would be to have alternate build modes: a "testing
configuration" for building the libraries with test support, and a
"production configuration" for building them without. I don't favor
that approach, since I think it would mean more people runnning
binaries build for testing, or more people not running unit tests.
|
|
|
|
|
|
|
|
Spotted by Coverity Scan. Not in any released Tor.
|
|
That security measure costs more than it gives.
So, keep your PATH sane and we can run this script on more than
one system.
|
|
|
|
This implements ticket #8530.
|
|
tor_tls_evp_pkey_eq
|
|
|
|
Is it possible that *every* attempt to replace the microdesc cache on
windows 7 is going to fail because of our lack of FILE_SHARE_DELETE
while opening the file? If so, this test will catch #2077 and let us
know when it's fixed.
|
|
|
|
|
|
|
|
bugfix on 78cc5833a1da038331186ddf07f4add7f8f1094b; bug not in any
released Tor.
Spotted by weasel using Jenkins.
|
|
We do our filesystem wrangling relative to get_fname() results, so
that if we fail or crash, we can always clean up.
|
|
|
|
See #8792
|
|
|
|
|
|
See #8790.
|
|
|
|
|
|
strmap tests
|