diff options
author | snappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143> | 2013-04-09 15:33:30 +0000 |
---|---|---|
committer | snappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143> | 2013-04-09 15:33:30 +0000 |
commit | 19a58fe3eb730b82932527293ea3734c924a179d (patch) | |
tree | dfba6ee89f5af5d2a20d228b6ce4b276819ab787 /snappy-test.h | |
parent | 2be83699adf1cb58e43f9dd9f7cf8fe136fd797a (diff) | |
download | snappy-19a58fe3eb730b82932527293ea3734c924a179d.tar.gz |
Supports truncated test data in zippy benchmark.
R=sesse
git-svn-id: http://snappy.googlecode.com/svn/trunk@74 03e5f5b5-db94-4691-08a0-1a8bf15f6143
Diffstat (limited to 'snappy-test.h')
-rw-r--r-- | snappy-test.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/snappy-test.h b/snappy-test.h index bec9020..f7ba79e 100644 --- a/snappy-test.h +++ b/snappy-test.h @@ -139,10 +139,10 @@ namespace file { void CheckSuccess() { } }; - DummyStatus ReadFileToString(const char* filename, string* data, int unused) { - FILE* fp = fopen(filename, "rb"); + DummyStatus GetContents(const string& filename, string* data, int unused) { + FILE* fp = fopen(filename.c_str(), "rb"); if (fp == NULL) { - perror(filename); + perror(filename.c_str()); exit(1); } @@ -160,15 +160,9 @@ namespace file { fclose(fp); } - DummyStatus ReadFileToString(const string& filename, - string* data, - int unused) { - ReadFileToString(filename.c_str(), data, unused); - } - - DummyStatus WriteStringToFile(const string& str, - const string& filename, - int unused) { + DummyStatus SetContents(const string& filename, + const string& str, + int unused) { FILE* fp = fopen(filename.c_str(), "wb"); if (fp == NULL) { perror(filename.c_str()); @@ -203,6 +197,8 @@ void Test_Snappy_ReadPastEndOfBuffer(); void Test_Snappy_FindMatchLength(); void Test_Snappy_FindMatchLengthRandom(); +string ReadTestDataFile(const string& base, size_t size_limit); + string ReadTestDataFile(const string& base); // A sprintf() variant that returns a std::string. |