summaryrefslogtreecommitdiff
path: root/snappy-test.h
Commit message (Collapse)AuthorAgeFilesLines
* Migrate feature detection macro checks from #ifdef to #if.Victor Costan2021-08-161-9/+9
| | | | | | | | | | | | | The #if predicate evaluates to false if the macro is undefined, or defined to 0. #ifdef (and its synonym #if defined) evaluates to false only if the macro is undefined. The new setup allows differentiating between setting a macro to 0 (to express that the capability definitely does not exist / should not be used) and leaving a macro undefined (to express not knowing whether a capability exists / not caring if a capability is used). PiperOrigin-RevId: 391094241
* Add stubs for abseil flags.Victor Costan2021-03-081-19/+0
| | | | | | | This CL also removes support for using the gflags library to modify the flags. PiperOrigin-RevId: 361583626
* Test stub improvements.Victor Costan2020-12-161-92/+64
| | | | PiperOrigin-RevId: 347736380
* Fix CHECK_EQ to call ok() instead of CheckSuccess().Chris Mumford2020-12-151-1/+1
| | | | | | CheckSuccess was removed in e1e91ee464373e0bba4aadfbd3d88a6d84dc5b95. PiperOrigin-RevId: 347625874
* Rework file:: stubs.Victor Costan2020-12-151-49/+32
| | | | PiperOrigin-RevId: 347541488
* Remove custom testing and benchmarking code.Victor Costan2020-12-141-128/+4
| | | | | | | | | | | | | | | | | | | | | Snappy includes a testing framework, which implements a subset of the Google Test API, and can be used when Google Test is not available. Snappy also includes a micro-benchmark framework, which implements an old version of the Google Benchmark API. This CL replaces the custom test and micro-benchmark frameworks with google/googletest and google/benchmark. The code is vendored in third_party/ via git submodules. The setup is similar to google/crc32c and google/leveldb. This CL also updates the benchmarking code to the modern Google Benchmark API. Benchmark results are expected to be more precise, as the old framework ran each benchmark with a fixed number of iterations, whereas Google Benchmark keeps iterating until the noise is low. PiperOrigin-RevId: 347456142
* Add LZ4 as a benchmark option. Snappy is starting to look really good ↵Snappy Team2020-11-181-0/+4
| | | | | | compared to LZ4. LZ4 is considered the fastest solution by many on internet. We now see that Snappy is actually becoming very competitive with compression a little faster and decompression slower but certainly not terribly slower. PiperOrigin-RevId: 343140860
* Fix Clang/GCC compilation warnings.Victor Costan2020-05-051-2/+2
| | | | | | This makes it easier to adopt snappy in other projects. PiperOrigin-RevId: 309958249
* Fix accidental double std:: qualifiers.Victor Costan2020-04-301-1/+1
| | | | PiperOrigin-RevId: 309136120
* Add some std:: qualifiers to types and functions.Victor Costan2020-04-291-25/+27
| | | | PiperOrigin-RevId: 309110343
* Switch from C headers to C++ headers.Victor Costan2020-04-291-3/+2
| | | | | | | | | | | | | | | This CL makes the following substitutions. * assert.h -> cassert * math.h -> cmath * stdarg.h -> cstdarg * stdio.h -> cstdio * stdlib.h -> cstdlib * string.h -> cstring stddef.h and stdint.h are not migrated to C++ headers. PiperOrigin-RevId: 309074805
* Migrate to standard integral types.Victor Costan2020-04-121-2/+2
| | | | | | | | | | | | The following changes are done via find/replace. * int8 -> int8_t * int16 -> int16_t * int32 -> int32_t * int64 -> int64_t The aliases were removed from snappy-stubs-public.h. PiperOrigin-RevId: 306141557
* Fix build errors.Victor Costan2019-11-031-1/+1
| | | | PiperOrigin-RevId: 278310119
* Fully qualify std::string.Victor Costan2019-09-261-8/+8
| | | | | | | This is in preparation for removing the snappy::string alias of std::string. PiperOrigin-RevId: 271383199
* Fix benchmarks.Victor Costan2019-08-201-0/+4
| | | | PiperOrigin-RevId: 264420835
* Use std random number generators in tests.costan2019-01-041-50/+0
| | | | | | | | | | An earlier CL introduced absl::Uniform, which is not yet open sourced, and therefore unavailable in the open source build. This CL removes absl::Uniform and ACMRandom in favor of equivalent C++11 standard random generators. Abseil promises to be faster than the standard library, but we can afford a speed hit in tests in return for an easier open sourcing story.
* C++11 guarantees <cstddef> and <cstdint>.costan2018-08-161-2/+0
| | | | The build configuration can be cleaned up a bit.
* Add SNAPPY_ prefix to PREDICT_{TRUE,FALSE} macros.jueminyang2017-08-011-1/+1
|
* Clean up CMake header and type checks.costan2017-07-251-10/+0
| | | | | | | | | | | | | | Unused macros: HAVE_DLFCN_H, HAVE_INTTYPES_H, HAVE_MEMORY_H, HAVE_STDLIB_H, HAVE_STRINGS_H, HAVE_STRING_H, HAVE_SYS_BYTESWAP_H, HAVE_SYS_STAT_H, HAVE_SYS_TYPES_H, HAVE_UNISTD_H. Used but never set macros: HAVE_LIBLZF, HAVE_LIBQUICKLZ. These only gate conditional includes. The code that takes advantage of them was removed. Unused types: ssize_t. The testing code uses HAVE_FUNC_MMAP, which was not wired in the CMake build, causing a whole test to be skipped.
* Remove benchmarking support for fastlz.ysaed2017-06-281-4/+0
|
* Clean up unused function warnings in snappy.costan2017-03-171-17/+4
|
* Remove "using namespace std;" from zippy-stubs-internal.h.costan2017-03-131-8/+9
| | | | | This makes it easier to build zippy, as some compiles require a warning suppression to accept "using namespace std".
* Fix an issue where the ByteSource path (used for parsing std::string)Steinar H. Gunderson2016-01-041-0/+2
| | | | | | | | would incorrectly accept some invalid varints that the other path would not, causing potential CHECK-failures if the unit test were run with --write_uncompressed and a corrupted input file. Found by the afl fuzzer.
* Fixed unit tests to compile under MSVC.Steinar H. Gunderson2015-06-221-1/+11
| | | | | | | | | | | | | 1. Including config.h in test. 2. Including windows.h before zippy-test.h. 3. Removed definition of WIN32_LEAN_AND_MEAN. This caused problems in build environments that define WIN32_LEAN_AND_MEAN as our definition didn't check for prior existence. This constant is old and no longer needed anyhow. 4. Disable MSVC warning 4722 since ~LogMessageCrash() never returns. A=cmumford R=jeff
* Sync with various Google-internal changes.Steinar H. Gunderson2015-06-221-1/+6
| | | | Should not mean much for the open-source version.
* Change some internal path names.Steinar H. Gunderson2015-06-221-3/+3
| | | | | This is mostly to sync up with some changes from Google's internal repositories; it does not affect the open-source distribution in itself.
* Add support for uncompressing to iovecs (scatter I/O).snappy.mirrorbot@gmail.com2013-06-131-0/+2
| | | | | | | | | | | | | Windows does not have struct iovec defined anywhere, so we define our own version that's equal to what UNIX typically has. The bulk of this patch was contributed by Mohit Aron. R=jeff git-svn-id: https://snappy.googlecode.com/svn/trunk@76 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Supports truncated test data in zippy benchmark.snappy.mirrorbot@gmail.com2013-04-091-12/+8
| | | | | | | R=sesse git-svn-id: https://snappy.googlecode.com/svn/trunk@74 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Adjust the Snappy open-source distribution for the changes in Google'ssnappy.mirrorbot@gmail.com2013-01-061-7/+22
| | | | | | | | | | internal file API. R=sanjay git-svn-id: https://snappy.googlecode.com/svn/trunk@70 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue 64: Check for <sys/time.h> at configure time,snappy.mirrorbot@gmail.com2012-07-311-0/+2
| | | | | | | | | since MSVC seemingly does not have it. R=sanjay git-svn-id: https://snappy.googlecode.com/svn/trunk@66 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Snappy library no longer depends on iostream.snappy.mirrorbot@gmail.com2012-05-221-0/+62
| | | | | | | | | | | Achieved by moving logging macro definitions to a test-only header file, and by changing non-test code to use assert, fprintf, and abort instead of LOG/CHECK macros. R=sesse git-svn-id: https://snappy.googlecode.com/svn/trunk@62 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue r57: Fix most warnings with -Wall, mostly signed/unsignedsnappy.mirrorbot@gmail.com2012-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | warnings. There are still some in the unit test, but the main .cc file should be clean. We haven't enabled -Wall for the default build, since the unit test is still not clean. This also fixes a real bug in the open-source implementation of ReadFileToStringOrDie(); it would not detect errors correctly. I had to go through some pains to avoid performance loss as the types were changed; I think there might still be some with 32-bit if and only if LFS is enabled (ie., size_t is 64-bit), but for regular 32-bit and 64-bit I can't see any losses, and I've diffed the generated GCC assembler between the old and new code without seeing any significant choices. If anything, it's ever so slightly faster. This may or may not enable compression of very large blocks (>2^32 bytes) when size_t is 64-bit, but I haven't checked, and it is still not a supported case. git-svn-id: https://snappy.googlecode.com/svn/trunk@56 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue #30: Stop using gettimeofday() altogether on Win32,snappy.mirrorbot@gmail.com2011-04-261-0/+24
| | | | | | | | | | | | | | | | | | as MSVC doesn't include it. Replace with QueryPerformanceCounter(), which is monotonic and probably reasonably high-resolution. (Some machines have traditionally had bugs in QPC, but they should be relatively rare these days, and there's really no much better alternative that I know of.) R=csilvers DELTA=74 (55 added, 19 deleted, 0 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1556 git-svn-id: https://snappy.googlecode.com/svn/trunk@31 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue #29: Write CPU timing code for Windows, based on ↵snappy.mirrorbot@gmail.com2011-04-111-0/+3
| | | | | | | | | | | | | | | | | | | | GetProcessTimes() instead of getursage(). I thought I'd already committed this patch, so that the 1.0.1 release already would have a Windows-compatible snappy_unittest, but I'd seemingly deleted it instead, so this is a reconstruction. R=csilvers DELTA=43 (39 added, 3 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1295 git-svn-id: https://snappy.googlecode.com/svn/trunk@28 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Change Snappy from the Apache 2.0 to a BSD-type license.snappy.mirrorbot@gmail.com2011-03-251-9/+23
| | | | | | | | | | | | R=dannyb DELTA=328 (80 added, 184 deleted, 64 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1061 git-svn-id: https://snappy.googlecode.com/svn/trunk@20 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue #19: Fix unit test when Google Test is installed but thesnappy.mirrorbot@gmail.com2011-03-241-1/+2
| | | | | | | | | | | | | | | | gflags package isn't (Google Test is not properly initialized). Patch by Martin Gieseking. R=csilvers DELTA=2 (1 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1033 git-svn-id: https://snappy.googlecode.com/svn/trunk@17 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Make the unit test work on systems without mmap(). This is required for,snappy.mirrorbot@gmail.com2011-03-241-0/+5
| | | | | | | | | | | | | | | | | | among others, Windows support. For Windows in specific, we could have used CreateFileMapping/MapViewOfFile, but this should at least get us a bit closer to compiling, and is of course also relevant for embedded systems with no MMU. (Part 1/2) R=csilvers DELTA=9 (8 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1031 git-svn-id: https://snappy.googlecode.com/svn/trunk@15 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Revision created by MOE tool push_codebase.snappy.mirrorbot@gmail.com2011-03-181-0/+458
MOE_MIGRATION= git-svn-id: https://snappy.googlecode.com/svn/trunk@2 03e5f5b5-db94-4691-08a0-1a8bf15f6143