MCPcopy Create free account
hub / github.com/couchbase/fleece / insertItems

Method insertItems

Tests/HashTreeTests.cc:56–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 void insertItems(size_t N =0, bool verbose= false, bool check =false) {
57 if (N == 0)
58 N = keys.size();
59 for (size_t i = 0; i < N; i++) {
60 if (verbose)
61 cerr << "\n##### Inserting #" << (i)
62 << ", " << hex << hashtree::ComputeHash(keys[i]) << dec << "\n";
63 tree.set(keys[i], values.get(uint32_t(i)));
64 if (verbose)
65 tree.dump(cerr);
66 if (check) {
67 CHECK(tree.count() == i + 1);
68 for (ssize_t j = i; j >= 0; --j)
69 CHECK(tree.get(keys[j]) == values.get(uint32_t(i)));
70 }
71 }
72 }
73
74 void checkTree(size_t N) {
75 CHECK(tree.count() == N);

Callers

nothing calls this directly

Calls 6

ComputeHashFunction · 0.85
sizeMethod · 0.45
setMethod · 0.45
getMethod · 0.45
dumpMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected