aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_util.c
AgeCommit message (Collapse)Author
2020-09-17Merge branch 'tor-gitlab/mr/129'David Goulet
2020-09-17Resolve some coverity complaints in test_util_glob().Nick Mathewson
Coverity's first complaint was that we didn't check the return values from chmod. That's easily fixed. Coverity's second complaint was that there were code paths where we pass NULL to chmod. For example, if this line failed, we'd "goto done", and then pass NULL to chmod. tt_ptr_op(dirname, OP_NE, NULL); Closes #40103. Bug not in any released Tor.
2020-09-10Check if glob() is available at build-time.Alexander Færøy
This patch disables the glob() support in the path library if glob() is unavailable at build-time. This currently happens with the Android NDK used for Tor Browser. See: https://bugs.torproject.org/tpo/core/tor/40114
2020-08-12Make test_glob() pass even when run as root.Nick Mathewson
Previously the test relied on not being able to look inside 000 directories, which is a thing root _can_ do. Bug not in any released Tor version.
2020-08-12Merge remote-tracking branch 'tor-gitlab/mr/62'Nick Mathewson
2020-07-30Add a unit test for write_str_to_file_if_not_equal()Nick Mathewson
2020-07-30test_util.c: Extract utime() function.Nick Mathewson
We need this to manipulate mtimes, but only in this file.
2020-07-15Add support for patterns on %include #25140Daniel Pinto
Also adds generic tor_glob function to expand globs.
2020-07-14Merge remote-tracking branch 'tor-gitlab/mr/50'Nick Mathewson
2020-07-14Strip '\r' characters when reading text files on Unix.Alexander Færøy
This patch ensures that we strip "\r" characters on both Windows as well as Unix when we read text files. This should prevent the issue where some Tor state files have been moved from a Windows machine, and thus contains CRLF line ending, to a Unix machine where only \n is needed. We add a test-case to ensure that we handle this properly on all our platforms. See: https://bugs.torproject.org/tpo/core/tor/33781
2020-07-13Bug 31812: Change http URL's to httpsJeremyRand
2020-03-30Merge branch 'tor-github/pr/1775'David Goulet
2020-03-17Run "make autostyle"teor
2020-03-05Add a config_lines_partition() function to help with LINELIST_V.Nick Mathewson
This function works a little bit like strsep(), to get a chunk of configuration lines with a given header. We can use this to make hidden service config easier to parse.
2020-03-05Merge branch 'clang_format_prep_3'Nick Mathewson
2020-02-24Merge remote-tracking branch 'tor-github/pr/1685/head'Nick Mathewson
2020-02-12Run "make autostyle".Nick Mathewson
2020-02-06Use parentheses to avoid mis-indentations of stringified macro argsNick Mathewson
clang-format sometimes thinks that "#name" should be written as "# name" if it appears at the start of a line. Using () appears to suppress this, while confusing Coccinelle.
2020-01-21Add a function to maybe memcpy() a value, in constant time.Nick Mathewson
2020-01-14Merge branch 'ticket32825_squashed'Nick Mathewson
2020-01-14Rename UTIL_TEST_NO_WIN to reflect intentNick Mathewson
Now that these tests are skipped on windows _and_ android, we should name the macro that skips them after the functionality that the tests depend on. Closes last part of 32825.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2020-01-07speaking of utf-8, remove strange char from commentRoger Dingledine
2020-01-07string: Add extra UTF-8 test casesteor
These test cases are validated differently by some programming languages, because those languages have incorrect UTF-8 implementations. We want to make sure that tor validates them correctly. Closes ticket 32845.
2019-12-20test_util: remove UTIL_LEGACY_NO_WIN.Nick Mathewson
It was only used in one place.
2019-12-20Android: skip tests that check UNIX user account setupHans-Christoph Steiner
* there is no ~ or HOME in Android * UIDs and GIDs in Android represent apps, not users, and Android apps cannot ever change UIDs This should be replaced by whatever @nmathewson wants to name this stuff: https://github.com/torproject/tor/pull/1436
2019-12-20Code Style: Delete PRIVATE defines that are never usedteor
Some ".c" files define *_PRIVATE macros, but those macros are not used in any header file. Delete them. These changes were created using the "make autostyle" from 32522, and then split into commits.
2019-11-11Merge remote-tracking branch 'tor-github/pr/1338'Nick Mathewson
2019-10-27Add nowrap u64 multiplication functionJosé M. Guisado
Follows #30920 Signed-off-by: José M. Guisado <guigom@riseup.net>
2019-10-22Re-run make autostyle.Nick Mathewson
2019-10-22Merge branch 'ticket31705_v2' into ticket31705_v2_mergedNick Mathewson
Conflicts: src/feature/dirparse/authcert_parse.c src/feature/dirparse/ns_parse.c src/feature/hs/hs_service.c src/lib/conf/conftesting.h src/lib/log/log.h src/lib/thread/threads.h src/test/test_options.c These conflicts were mostly related to autostyle improvements, with one or two due to doxygen fixes.
2019-10-22test: Hide some test-declaration macro definitions to COCCI.Nick Mathewson
(These ones cause parsing failures.)
2019-10-03util/map_anon_nofork: Add a cast to avoid passing -48 to memsetNick Mathewson
This fixes coverity CID 1454593, and bug 31948. Bug not in any released version of Tor.
2019-10-02Merge remote-tracking branch 'tor-github/pr/1374'Nick Mathewson
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-30test: Avoid a map_anon_nofork test failure on SunOSteor
This test failure happened due to a signed/unsigned integer comparison. This bug occurred on SunOS, it may also occur on other systems that use signed char as the default. (And cast 1-byte integer constants to an unsigned integer.) Fixes bug 31897; bugfix on 0.4.1.1-alpha.
2019-09-16Run "make autostyle" and fix wide lines.Nick Mathewson
2019-08-06test_util: Do not check for ENETUNREACH unless it exists.Nick Mathewson
Fixes bug 31352; bug not in any released Tor.
2019-06-07Tolerate net-unreachable failures in util/socketpair_ersatzNick Mathewson
This can happen when we have no network stack configured. Fixes bug 30804; bugfix on 0.2.5.1-alpha.
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-07Merge branch 'tor-github/pr/994'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-30Split reply formatting out of control_fmt.cTaylor Yu
Split the core reply formatting code out of control_fmt.c into control_proto.c. The remaining code in control_format.c deals with specific subsystems and will eventually move to join those subsystems.
2019-04-09Merge branch 'maint-0.4.0'Nick Mathewson
2019-04-09Merge branch 'bug29922_035' into maint-0.4.0Nick Mathewson
2019-04-09Actually I believe this should be an EINVAL.Nick Mathewson
2019-04-09Merge branch 'maint-0.4.0'George Kadianakis
2019-04-09Merge branch 'tor-github/pr/915' into maint-0.4.0George Kadianakis
2019-04-08Detect and suppress an additional gmtime() warning in test_util.cNick Mathewson
Fixes bug 29922; bugfix on 0.2.9.3-alpha when we tried to capture all these warnings. No need to backport any farther than 0.3.5, though -- these warnings don't cause test failures before then. This one was tricky to find because apparently it only happened on _some_ windows builds.
2019-04-05Merge branch 'tor-github/pr/761'George Kadianakis