17 Commits

Author SHA1 Message Date
Yann Collet
2d94529192 added test_alias
expected to fail due to #1013
2025-06-18 16:52:30 -07:00
Yann Collet
0e31b789f5 make -C tests finally compatible with -j
and uses multiconf.make
2025-05-04 15:56:17 -07:00
Takayuki Matsuoka
e592478eea add: cli: --ignore-missing
- Add `--ignore-missing` option for `xxhsum`.
- Add test script `tests/cli-ignore-missing.sh` and related `Makefile` entries.
  - Note that we still don't have CLI test entry in our CI.

`xxhsum` returns failure exit code when

- `--ignore-missing` is presented.
- Checksum file is specified.
- But `XSUM_checkFile()` doesn't read actual file (may) due to `--ignore-missing`

If so, `xxhsum` reports `no file was verified` with failure exit code.

<details><summary>`--ignore-missing` related code in `digest.c`</summary>
- 2f1cffe07a/src/digest.c (L190-L191)
- 2f1cffe07a/src/digest.c (L362)
- 2f1cffe07a/src/digest.c (L380)
- 2f1cffe07a/src/digest.c (L506)
- 2f1cffe07a/src/digest.c (L978-L982)
- 2f1cffe07a/src/digest.c (L1236-L1240)
- 2f1cffe07a/src/digest.c (L1325-L1328)
- 2f1cffe07a/src/digest.c (L1429-L1431)
- 2f1cffe07a/src/digest.c (L1558-L1564)
</details>
2023-07-10 17:43:40 +09:00
Takayuki Matsuoka
0691980f72 Add test for # comment lines 2023-06-17 20:37:02 +09:00
Takayuki Matsuoka
25dfa1aab7 Add Makefile entry and gitignore for sanity_test
make check
Depends (invokes) test_sanity

make test_sanity
Invokes make -C tests test_sanity

make -C tests test_sanity
Create and execute tests/sanity_test

make -C tests sanity_test_vectors.h
Create and execute tests/sanity_test_vectors_generator.
It generates tests/sanity_test_vectors.h.
2023-03-11 22:28:04 +09:00
Takayuki Matsuoka
f1f2ff9133 Add test script and Makefile entry for filename escape 2022-04-04 19:53:17 +09:00
Yann Collet
f035303b8a updated copyright years 2021-12-08 11:04:22 -08:00
Yann Collet
81d343d04b check multiple inclusions of XXH_INLINE_ALL
and tidy up code.
2021-08-23 11:59:03 -07:00
Yann Collet
3231cdfb15 XXH_INLINE_ALL can be declared after XXH_NAMESPACE
It's now available again,
and tested with `multiInclude` test
2021-08-23 11:45:34 -07:00
Yann Collet
00b7bd1243 regroup all xxhsum files into cli/ 2021-07-12 22:34:34 -07:00
easyaspi314 (Devin)
fdf2e840cb Fix Unicode test
Now uses XXH_INLINE_ALL.
2020-09-16 22:41:36 -04:00
Yann Collet
cd59de7b58 fix altivec.h redefinition issue
fix #426
2020-07-23 16:37:57 -07:00
Yann Collet
2c992d0cc7 merge xxh3 implementation within xxhash.h
xxh3.h is no longer necessary
but remains available,
in case some programs do #include "xxh3.h" directly.

Also : bumped version number to v0.8.0
2020-07-23 10:24:51 -07:00
easyaspi314 (Devin)
87e7d8b999 More typos, add some more documentation
- Remove most remaining spaces before punctuation
 - Fix a few missed copyright messages
 - Document the timer resolution workaround
 - Document XXH_mult32to64
   - I compiled GCC 3.2 and 4.2 just to test this, both are affected.
   - Make sure we downcast for __emulu
 - Other minor fixes
2020-03-03 12:10:19 -05:00
easyaspi314 (Devin)
b5cef6dce0 Fix accidental typo
Don't know how I did that one.
2020-02-14 19:14:08 -05:00
easyaspi314 (Devin)
cac3ca4d5d Implement a safer Unicode test
This new test doesn't use any Unicode in the source files, instead
encoding all UTF-8 and UTF-16 as hex.

The test script will be generated from a C file, in which both a shell
script and a batch script will be generated, as well as the Unicode file
to test.

On Cygwin, MinGW, and MSYS, we will automatically bail from the shell
script to the batch script, as cmd.exe has more reliable Unicode
support, at least on Windows 7 and later.

When the make rule is called, it first checks if `$LANG` contains UTF-8,
defining the (overridable) ENABLE_UNICODE flag. If so, it will skip the
test with a warning.

Also fixed an issue with printf in multiInclude.c causing warnings on
old MinGW versions which expect %I64, and updated the .gitignore.
2020-02-14 19:08:09 -05:00
Yann Collet
19cd4ffed3 xxhash can be inlined even if it was previously included
Inlining hash functions is generally beneficial for performance.
It becomes extremely beneficial whenever input size is a compile-time constant.

To inline xxhash functions, one just needs to include it this way :

One potential issue is that "xxhash.h" may have already been included previously,
typically as part of another included `*.h` .
In which case, the second `#include` statement will have no effect.

This patch fixes this situation :
now, when XXH_INLINE_ALL is defined, all identifiers are renamed,
in order to avoid name collision and confusion with already included indentifiers.

The renaming process uses XXH_NAMESPACE.
XXH_NAMESPACE must be available (i.e. not already used) for renaming to work.

A test has been added in `tests/` to ensure this scenario works correctly.
2020-02-12 11:43:33 -08:00