summaryrefslogtreecommitdiff
path: root/snappy-test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Supports truncated test data in zippy benchmark.snappy.mirrorbot@gmail.com2013-04-091-8/+12
| | | | | | | R=sesse git-svn-id: http://snappy.googlecode.com/svn/trunk@74 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Make ./snappy_unittest pass without "srcdir" being defined.snappy.mirrorbot@gmail.com2013-02-051-1/+1
| | | | | | | | | | | | Previously, snappy_unittests would read from an absolute path /testdata/..; convert it to use a relative path instead. Patch from Marc-Antonie Ruel. R=maruel git-svn-id: http://snappy.googlecode.com/svn/trunk@72 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Adjust the Snappy open-source distribution for the changes in Google'ssnappy.mirrorbot@gmail.com2013-01-061-3/+6
| | | | | | | | | | internal file API. R=sanjay git-svn-id: http://snappy.googlecode.com/svn/trunk@70 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Handle the case where gettimeofday() goes backwards or returns the same valuesnappy.mirrorbot@gmail.com2012-07-041-14/+19
| | | | | | | | | | | | | | twice; it could cause division by zero in the unit test framework. (We already had one fix for this in place, but it was incomplete.) This could in theory happen on any system, since there are few guarantees about gettimeofday(), but seems to only happen in practice on GNU/Hurd, where gettimeofday() is cached and only updated ever so often. R=sanjay git-svn-id: http://snappy.googlecode.com/svn/trunk@65 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue r57: Fix most warnings with -Wall, mostly signed/unsignedsnappy.mirrorbot@gmail.com2012-01-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | 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: http://snappy.googlecode.com/svn/trunk@56 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue #39: Pick out the median runs based on CPU time,snappy.mirrorbot@gmail.com2011-05-091-2/+5
| | | | | | | | | | | | | | | not real time. Also, use nth_element instead of sort, since we only need one element. R=csilvers DELTA=5 (3 added, 0 deleted, 2 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1799 git-svn-id: http://snappy.googlecode.com/svn/trunk@35 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue #38: Make the microbenchmark framework handlesnappy.mirrorbot@gmail.com2011-05-091-2/+7
| | | | | | | | | | | | | | | | | | | | | | properly cases where gettimeofday() can stand return the same result twice (as sometimes on GNU/Hurd) or go backwards (as when the user adjusts the clock). We avoid a division-by-zero, and put a lower bound on the number of iterations -- the same amount as we use to calibrate. We should probably use CLOCK_MONOTONIC for platforms that support it, to be robust against clock adjustments; we already use Windows' monotonic timers. However, that's for a later changelist. R=csilvers DELTA=7 (5 added, 0 deleted, 2 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1798 git-svn-id: http://snappy.googlecode.com/svn/trunk@34 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue #30: Stop using gettimeofday() altogether on Win32,snappy.mirrorbot@gmail.com2011-04-261-9/+21
| | | | | | | | | | | | | | | | | | 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: http://snappy.googlecode.com/svn/trunk@31 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* When including <windows.h>, define WIN32_LEAN_AND_MEAN first,snappy.mirrorbot@gmail.com2011-04-151-0/+1
| | | | | | | | | | | | | | | so we won't pull in macro definitions of things like min() and max(), which can conflict with <algorithm>. R=csilvers DELTA=1 (1 added, 0 deleted, 0 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1485 git-svn-id: http://snappy.googlecode.com/svn/trunk@29 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix public issue #29: Write CPU timing code for Windows, based on ↵snappy.mirrorbot@gmail.com2011-04-111-3/+36
| | | | | | | | | | | | | | | | | | | | 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: http://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: http://snappy.googlecode.com/svn/trunk@20 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Fix a microbenchmark crash on mingw32; seemingly %lld is not universallysnappy.mirrorbot@gmail.com2011-03-241-1/+6
| | | | | | | | | | | | | | supported on Windows, and %I64d is recommended instead. R=csilvers DELTA=6 (5 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=1034 git-svn-id: http://snappy.googlecode.com/svn/trunk@18 03e5f5b5-db94-4691-08a0-1a8bf15f6143
* Revision created by MOE tool push_codebase.snappy.mirrorbot@gmail.com2011-03-181-0/+523
MOE_MIGRATION= git-svn-id: http://snappy.googlecode.com/svn/trunk@2 03e5f5b5-db94-4691-08a0-1a8bf15f6143