summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/TarWriterTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix build bot after r319750 "[Support/TarWriter] - Don't allow TarWriter to ↵George Rimar2017-12-051-3/+3
| | | | | | | | | | | | add the same file more than once." Error was: error: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare] http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3469/steps/build-unified-tree/logs/stdio http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/7118/steps/build-stage2-compiler/logs/stdio llvm-svn: 319752
* [Support/TarWriter] - Don't allow TarWriter to add the same file more than once.George Rimar2017-12-051-0/+56
| | | | | | | | | | | | | | This is for PR35460. Currently when LLD adds files to TarWriter it may pass the same file multiple times. For example it happens for clang reproduce file which specifies archive (.a) files more than once in command line. Patch makes TarWriter to ignore files with the same path, so it will add only the first one to archive. Differential revision: https://reviews.llvm.org/D40606 llvm-svn: 319750
* Fix off-by-one error in TarWriter.Rui Ueyama2017-09-271-19/+54
| | | | | | | | | | | | | | | | | | | | | | | | The tar format originally supported up to 99 byte filename. The two extensions are proposed later: Ustar or PAX. In the UStar extension, a pathanme is split at a '/' and its "prefix" and "suffix" are stored in different locations in the tar header. Since "prefix" can be up to 155 byte, it can represent up to 254 byte filename (but exact limit depends on the location of '/' character in a pathname.) Our TarWriter first attempt to use UStar extension and then fallback to PAX extension. But there's a bug in UStar header creation. "Suffix" part must be a NUL- terminated string, but we didn't handle it correctly. As a result, if your filename just 100 characters long, the last character was droppped. This patch fixes the issue. Differential Revision: https://reviews.llvm.org/D38149 llvm-svn: 314349
* Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. llvm-svn: 304786
* Use EXPECT_EQ instead of ASSERT_EQ in a unit test.Rui Ueyama2017-01-111-10/+10
| | | | llvm-svn: 291713
* Fix memory leak in a unit test.Rui Ueyama2017-01-101-1/+1
| | | | llvm-svn: 291595
* TarWriter: Fix a bug in Ustar header.Rui Ueyama2017-01-091-0/+88
If we split a filename into `Name` and `Prefix`, `Prefix` is at most 145 bytes. We had a bug that didn't split a path correctly. This bug was pointed out by Rafael in the post commit review. This patch adds a unit test for TarWriter to verify the fix. llvm-svn: 291494
OpenPOWER on IntegriCloud