MCPcopy Create free account
hub / github.com/ElementsProject/elements / Build

Method Build

src/leveldb/db/corruption_test.cc:57–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55 }
56
57 void Build(int n) {
58 std::string key_space, value_space;
59 WriteBatch batch;
60 for (int i = 0; i < n; i++) {
61 // if ((i % 100) == 0) fprintf(stderr, "@ %d of %d\n", i, n);
62 Slice key = Key(i, &key_space);
63 batch.Clear();
64 batch.Put(key, Value(i, &value_space));
65 WriteOptions options;
66 // Corrupt() doesn't work without this sync on windows; stat reports 0 for
67 // the file size.
68 if (i == n - 1) {
69 options.sync = true;
70 }
71 ASSERT_OK(db_->Write(options, &batch));
72 }
73 }
74
75 void Check(int min_expected, int max_expected) {
76 int next_expected = 0;

Callers

nothing calls this directly

Calls 5

ValueFunction · 0.85
KeyFunction · 0.70
ClearMethod · 0.45
PutMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected