summaryrefslogtreecommitdiff
path: root/tests/util
Commit message (Collapse)AuthorAgeFilesLines
* process: test SIGTERM with catEdward Thomson2023-02-231-1/+1
| | | | | | Use something that will wait (eg `cat`) instead of something that completes basically immediately (eg `echo`) so that we have a chance to actually kill the process.
* process: test SIGTERM detectionEdward Thomson2023-04-111-1/+38
| | | | | | We can't reliably detect SIGPIPE on close because of platform differences. Track `pid` and send `SIGTERM` to a function and ensure that we can detect it.
* Introduce git_process class that invokes processesEdward Thomson2023-04-113-0/+387
|
* utf8: add conversion with size and refactor namesEdward Thomson2023-03-211-3/+3
| | | | | | | | Add functions to use convert a string with length, instead of assuming NUL termination. In addition, move the utf8 to 16 conversion routines into the `git_utf8` namespace instead of using namespaceless `git__` prefixed names.
* fs_path: let root run the ownership testsEdward Thomson2023-02-271-1/+5
| | | | | | | The `git_fs_path_owner_is_current_user` expects the root dir on unix (`/`) to be owned by a non-current user. This makes sense unless root (or euid == 0) is running the tests, which often happens during distro build / packaging scripts. Allow them to run the tests.
* url: only allow @s in usernames for ssh urlsEdward Thomson2022-06-171-0/+5
| | | | | | Enforce the RFC for other protocols; Google's questionable choices about malformed SSH protocols shouldn't impact our ability to properly parse HTTPS.
* url_parse: introduce our own url parsingEdward Thomson2022-06-171-0/+217
| | | | | Provide our own url parser, so that we can handle Google Code's "fun" URLs that have a userinfo with an `@` in it. :cry:
* url: test that we don't expand % encoding in pathsEdward Thomson2022-06-171-0/+12
|
* url: remove invalid scp url parsing testEdward Thomson2022-06-161-4/+0
| | | | | | The url::scp::invalid_addresses test attempts to test an invalid IPv6 address. It does not, it calls the regular URL parsing function which treats it like a possibly invalid scheme.
* net: move url tests into utilEdward Thomson2022-06-166-0/+1339
|
* fs_path: refactor ownership checks into current user and systemEdward Thomson2022-04-111-0/+25
| | | | | | Provide individual file ownership checks for both the current user and the system user, as well as a combined current user and system user check.
* tests: support flaky statEdward Thomson2022-04-061-5/+14
| | | | | The 32-bit ARM QEMU builds are flaky when running `lstat`. Disable those testing `lstat`'s `st_size` temporarily.
* sha: ensure we test both cng and cryptoapi on windowsEdward Thomson2022-03-232-5/+67
| | | | | When GIT_SHA1_WIN32 or GIT_SHA256_WIN32 is used, ensure that we test both CryptoNG ("cng") and CryptoAPI.
* sha: add sha256 algorithmEdward Thomson2022-03-231-0/+81
| | | | | Add support for a SHA256 hash algorithm, and add the "builtin" SHA256 hash engine (from RFC 6234).
* assert: add `ASSERT_WITH_CLEANUP`Edward Thomson2022-02-271-0/+23
| | | | | | Now that we safely assert and return, we may need to be in a place where we need to unlock mutexes or cleanup resources. Provide `ASSERT_WITH_CLEANUP` that permits for this behavior by taking a block.
* cmake: refactor `add_clar_test` into separate moduleEdward Thomson2022-02-221-9/+2
|
* refactor: move utility tests into utilEdward Thomson2022-02-2246-0/+8316