diff options
Diffstat (limited to 'util/testutil.h')
-rw-r--r-- | util/testutil.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/util/testutil.h b/util/testutil.h index adad3fc1ea..d7e4583702 100644 --- a/util/testutil.h +++ b/util/testutil.h @@ -45,6 +45,16 @@ class ErrorEnv : public EnvWrapper { } return target()->NewWritableFile(fname, result); } + + virtual Status NewAppendableFile(const std::string& fname, + WritableFile** result) { + if (writable_file_error_) { + ++num_writable_file_errors_; + *result = NULL; + return Status::IOError(fname, "fake error"); + } + return target()->NewAppendableFile(fname, result); + } }; } // namespace test |