1 //  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2 //  This source code is licensed under both the GPLv2 (found in the
3 //  COPYING file in the root directory) and Apache 2.0 License
4 //  (found in the LICENSE.Apache file in the root directory).
5 //
6 // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file. See the AUTHORS file for names of contributors.
9 #pragma once
10 
11 #include <atomic>
12 #include <map>
13 #include <string>
14 #include <vector>
15 
16 #include "env/composite_env_wrapper.h"
17 #include "rocksdb/env.h"
18 #include "rocksdb/status.h"
19 #include "rocksdb/system_clock.h"
20 
21 namespace ROCKSDB_NAMESPACE {
22 class MockEnv : public CompositeEnvWrapper {
23  public:
24   static MockEnv* Create(Env* base);
25   static MockEnv* Create(Env* base, const std::shared_ptr<SystemClock>& clock);
26 
27   Status CorruptBuffer(const std::string& fname);
28  private:
29   MockEnv(Env* env, const std::shared_ptr<FileSystem>& fs,
30           const std::shared_ptr<SystemClock>& clock);
31 };
32 
33 }  // namespace ROCKSDB_NAMESPACE
34