summaryrefslogtreecommitdiff
path: root/tests/core
Commit message (Collapse)AuthorAgeFilesLines
* Remove extra semicolon outside of a functionStefan Widgren2015-02-152-2/+2
| | | | | Without this change, compiling with gcc and pedantic generates warning: ISO C does not allow extra ‘;’ outside of a function.
* Make our overflow check look more like gcc/clang'sEdward Thomson2015-02-131-6/+10
| | | | | | | | | Make our overflow checking look more like gcc and clang's, so that we can substitute it out with the compiler instrinsics on platforms that support it. This means dropping the ability to pass `NULL` as an out parameter. As a result, the macros also get updated to reflect this as well.
* overflow checking: don't make callers set oomEdward Thomson2015-02-121-0/+21
| | | | | | Have the ALLOC_OVERFLOW testing macros also simply set_oom in the case where a computation would overflow, so that callers don't need to.
* allocations: test for overflow of requested sizeEdward Thomson2015-02-121-0/+40
| | | | | Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
* stat: don't remove trailing '/' from root on win32Edward Thomson2015-02-051-0/+17
| | | | | | | `p_stat` calls `git_win32_path_from_utf8`, which canonicalizes the path. Do not further try to modify the path, else we trim the trailing slash from a root directory and try to access `C:` instead of `C:/`.
* structinit test: use %PRIuZ instead of %d for size_tEdward Thomson2015-02-041-1/+1
|
* structinit test: only run on DEBUG buildsEdward Thomson2015-01-211-0/+163
| | | | | | | The structinit tests don't make sense unless structure padding is uniformly initialized, which is unlikely to happen on release builds. Only enable them for DEBUG builds. Further, rename them to core::structinit.
* Make binary detection work similar to vanilla gitSven Strickroth2015-01-201-1/+1
| | | | | | Main change: Don't treat chars > 128 as non-printable (common in UTF-8 files) Signed-off-by: Sven Strickroth <email@cs-ware.de>
* win32: use NT-prefixed "\\?\" pathsEdward Thomson2014-12-161-16/+3
| | | | | | | | | | | | When turning UTF-8 paths into UCS-2 paths for Windows, always use the \\?\-prefixed paths. Because this bypasses the system's path canonicalization, handle the canonicalization functions ourselves. We must: 1. always use a backslash as a directory separator 2. only use a single backslash between directories 3. not rely on the system to translate "." and ".." in paths 4. remove trailing backslashes, except at the drive root (C:\)
* core::link test: clean up junction point nameEdward Thomson2014-12-091-7/+50
|
* init: return the number of initializationsEdward Thomson2014-12-041-0/+14
|
* buffer: Do not `put` anything if len is 0Vicent Marti2014-11-211-3/+2
|
* hashsig: Export as a `sys` headervmg/hashsigVicent Marti2014-10-011-1/+1
|
* path: Fix `git_path_walk_up` to work with non-rooted pathsThe rugged tests are fragile2014-09-171-15/+38
|
* Allow mkdir helper to skip parent errorsrb/mkdir-allow-parent-failuresRussell Belfer2014-08-221-0/+31
| | | | | | | Our mkdir helper was failing is a parent directory was not accessible even if the child directory could be created. This changes the helper to keep trying child directories even when the parent is unwritable.
* Introduce git_buf_decode_base64Edward Thomson2014-08-151-8/+29
| | | | Decode base64-encoded text into a git_buf
* Round up pool alloc sizes for alignmentrb/round-up-pool-allocationsRussell Belfer2014-06-301-5/+5
| | | | | | | | | | | | | To make sure that items returned from pool allocations are aligned on nice boundaries, this rounds up all pool allocation sizes to a multiple of 8. This adds a small amount of overhead to each item. The rounding up could be made optional with an extra parameter to the pool initialization that turned on rounding only for pools where item alignment actually matters, but I think for the extra code and complexity that would be involved, that it makes sense just to burn a little bit of extra memory and enable this all the time.
* crlf: pass-through mixed EOL buffers from LF->CRLFcmn/mixed-eol-passthroughCarlos Martín Nieto2014-06-231-18/+8
| | | | | | | | | | When checking out files, we're performing conversion into the user's native line endings, but we only want to do it for files which have consistent line endings. Refuse to perform the conversion for mixed-EOL files. The CRLF->LF filter is left as-is, as that conversion is considered to be normalization by git and should force a conversion of the line endings.
* fileops: allow linking files when copying directory structuresCarlos Martín Nieto2014-05-281-0/+26
| | | | | When passed the LINK_FILES flag, the recursive copy will hardlink files instead of copying them.
* Better search path sandboxingrb/restore-search-pathsRussell Belfer2014-05-151-14/+12
| | | | | | | There are a number of tests that modify the global or system search paths during the tests. This adds a helper function to make it easier to restore those paths and makes sure that they are getting restored in a manner that preserves test isolation.
* Merge pull request #2291 from ethomson/patch_binaryVicent Marti2014-04-231-0/+20
|\ | | | | patch: emit deflated binary patches (optionally)
| * patch: emit binary patches (optionally)Edward Thomson2014-04-221-0/+20
| |
* | React to feedback for UTF-8 <-> WCHAR and reparse workPhilip Kelley2014-04-231-1/+1
| |
* | Handle win32 reparse points properlyEdward Thomson2014-04-221-0/+602
| |
* | Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-191-1/+1
|/
* Add diff threading tests and attr file cache locksRussell Belfer2014-04-171-37/+35
| | | | | | This adds a basic test of doing simultaneous diffs on multiple threads and adds basic locking for the attr file cache because that was the immediate problem that arose from these tests.
* Some vector utility tweaksRussell Belfer2014-04-171-7/+8
| | | | | This is just laying some groundwork for internal index changes that I'm working on.
* Fix bug with multiple iconv conversions in one dirRussell Belfer2014-04-071-1/+11
| | | | | | | | The internal buffer in the `git_path_iconv_t` structure was not being reset before the calls to `iconv` were made to convert data, so if there were multiple decomposed Unicode paths in a single directory, paths after the first one were being appended to the first instead of treated as independent data.
* Add efficient git_buf join3 APIRussell Belfer2014-04-011-0/+32
| | | | | | | There are a few places where we need to join three strings to assemble a path. This adds a simple join3 function to avoid the comparatively expensive join_n (which calls strlen on each string twice).
* Test for giterr_captureEdward Thomson2014-03-251-0/+24
|
* env test needs to deref git_buf's ptrEdward Thomson2014-03-241-1/+1
|
* settings: use git_buf for returning stringsCarlos Martín Nieto2014-03-241-4/+6
| | | | | This survived the last round of culling, as the signature is only in the comments.
* Fix pqueue sort boundary condition bugRussell Belfer2014-03-121-0/+31
| | | | | | If the pqueue comparison fn returned just 0 or 1 (think "a<b") then the sort order of returned items could be wrong because there was a "< 0" that really needed to be "<= 0". Yikes!!!
* features: Rename `_HAS_` to `_FEATURE_`vmg/featuresVicent Marti2014-03-031-6/+6
|
* caps: Rename to features to avoid confusionVicent Marti2014-03-031-8/+8
|
* Move system directory cache out of utilsEdward Thomson2014-02-241-16/+17
|
* Add some priority queue testsRussell Belfer2014-02-031-0/+97
| | | | I forgot that I wrote some tests for the new priority queue code.
* Expand zstream tests and fix off-by-one errorRussell Belfer2014-01-301-17/+62
|
* Reorganize zstream API and fix wrap problemsRussell Belfer2014-01-301-0/+98
| | | | | | | | There were some confusing issues mixing up the number of bytes written to the zstream output buffer with the number of bytes consumed from the zstream input. This reorganizes the zstream API and makes it easier to deflate an arbitrarily large input while still using a fixed size output.
* add unit tests for git_buf_join corner casesPatrick Reynolds2014-01-201-0/+31
|
* pool: Agh, this test doesn't really apply in 32-bit machinesVicent Marti2013-12-131-3/+0
| | | | | | The size_t is 32-bit already, so it overflows before going into the function. The `-1` test should handle this gracefully in both cases anyway.
* pool: Correct overflow checksVicent Marti2013-12-131-1/+5
| | | | | | | Ok, scrap the previous commit. This is the right overflow check that takes care of 64 bit overflow **and** 32-bit overflow, which needs to be considered because the pool malloc can only allocate 32-bit elements in one go.
* Remove converting user error to GIT_EUSERRussell Belfer2013-12-111-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
* Further EUSER and error propagation fixesRussell Belfer2013-12-111-0/+46
| | | | | | | | | | | | | This continues auditing all the places where GIT_EUSER is being returned and making sure to clear any existing error using the new giterr_user_cancel helper. As a result, places that relied on intercepting GIT_EUSER but having the old error preserved also needed to be cleaned up to correctly stash and then retrieve the actual error. Additionally, as I encountered places where error codes were not being propagated correctly, I tried to fix them up. A number of those fixes are included in the this commit as well.
* Rename tests-clar to testsBen Straub2013-11-1424-0/+4329