Completely refactor how FILENAME_PRIVATE works
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.
Showing
- changes/fancy_testing 3 additions, 0 deletionschanges/fancy_testing
- src/common/crypto.c 3 additions, 3 deletionssrc/common/crypto.c
- src/common/crypto.h 3 additions, 4 deletionssrc/common/crypto.h
- src/common/crypto_curve25519.c 1 addition, 1 deletionsrc/common/crypto_curve25519.c
- src/common/crypto_curve25519.h 3 additions, 2 deletionssrc/common/crypto_curve25519.h
- src/common/crypto_format.c 0 additions, 1 deletionsrc/common/crypto_format.c
- src/common/log.c 4 additions, 0 deletionssrc/common/log.c
- src/common/testsupport.h 2 additions, 2 deletionssrc/common/testsupport.h
- src/common/torlog.h 0 additions, 6 deletionssrc/common/torlog.h
- src/common/tortls.c 0 additions, 3 deletionssrc/common/tortls.c
- src/common/util.c 2 additions, 2 deletionssrc/common/util.c
- src/common/util.h 3 additions, 2 deletionssrc/common/util.h
- src/or/addressmap.c 1 addition, 1 deletionsrc/or/addressmap.c
- src/or/addressmap.h 4 additions, 2 deletionssrc/or/addressmap.h
- src/or/buffers.c 1 addition, 1 deletionsrc/or/buffers.c
- src/or/buffers.h 3 additions, 1 deletionsrc/or/buffers.h
- src/or/circuitstats.c 17 additions, 4 deletionssrc/or/circuitstats.c
- src/or/circuitstats.h 11 additions, 10 deletionssrc/or/circuitstats.h
- src/or/config.c 0 additions, 2 deletionssrc/or/config.c
- src/or/config.h 0 additions, 3 deletionssrc/or/config.h
Loading
Please register or sign in to comment