YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/src/yb/docdb/docdb_test_base.cc
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) YugaByte, Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4
// in compliance with the License.  You may obtain a copy of the License at
5
//
6
// http://www.apache.org/licenses/LICENSE-2.0
7
//
8
// Unless required by applicable law or agreed to in writing, software distributed under the License
9
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10
// or implied.  See the License for the specific language governing permissions and limitations
11
// under the License.
12
//
13
14
#include "yb/docdb/docdb_test_base.h"
15
16
#include "yb/docdb/docdb.h"
17
#include "yb/docdb/docdb_test_util.h"
18
19
namespace yb {
20
namespace docdb {
21
22
0
DocDBTestBase::DocDBTestBase() {
23
0
}
24
25
0
DocDBTestBase::~DocDBTestBase() {
26
0
}
27
28
0
void DocDBTestBase::SetUp() {
29
0
  YBTest::SetUp();
30
0
  ASSERT_OK(InitRocksDBOptions());
31
0
  ASSERT_OK(InitRocksDBDir());
32
0
  ASSERT_OK(OpenRocksDB());
33
0
  ResetMonotonicCounter();
34
0
}
35
36
0
void DocDBTestBase::TearDown() {
37
0
  ASSERT_OK(DestroyRocksDB());
38
0
  YBTest::TearDown();
39
0
}
40
41
0
void DocDBTestBase::CaptureLogicalSnapshot() {
42
0
  logical_snapshots_.emplace_back();
43
0
  logical_snapshots_.back().Capture(rocksdb());
44
0
}
45
46
0
void DocDBTestBase::ClearLogicalSnapshots() {
47
0
  logical_snapshots_.clear();
48
0
}
49
50
0
void DocDBTestBase::RestoreToRocksDBLogicalSnapshot(size_t snapshot_index) {
51
0
  CHECK_LE(0, snapshot_index);
52
0
  CHECK_LT(snapshot_index, logical_snapshots_.size());
53
0
  logical_snapshots_[snapshot_index].RestoreTo(rocksdb());
54
0
}
55
56
}  // namespace docdb
57
}  // namespace yb