From 19a58fe3eb730b82932527293ea3734c924a179d Mon Sep 17 00:00:00 2001 From: "snappy.mirrorbot@gmail.com" Date: Tue, 9 Apr 2013 15:33:30 +0000 Subject: Supports truncated test data in zippy benchmark. R=sesse git-svn-id: http://snappy.googlecode.com/svn/trunk@74 03e5f5b5-db94-4691-08a0-1a8bf15f6143 --- snappy-test.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'snappy-test.h') 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. -- cgit v1.2.1