aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb/util/testutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/leveldb/util/testutil.h')
-rw-r--r--src/leveldb/util/testutil.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/leveldb/util/testutil.h b/src/leveldb/util/testutil.h
index adad3fc1ea..d7e4583702 100644
--- a/src/leveldb/util/testutil.h
+++ b/src/leveldb/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