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

Function TestKey

src/leveldb/db/dbformat_test.cc:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30static void TestKey(const std::string& key, uint64_t seq, ValueType vt) {
31 std::string encoded = IKey(key, seq, vt);
32
33 Slice in(encoded);
34 ParsedInternalKey decoded("", 0, kTypeValue);
35
36 ASSERT_TRUE(ParseInternalKey(in, &decoded));
37 ASSERT_EQ(key, decoded.user_key.ToString());
38 ASSERT_EQ(seq, decoded.sequence);
39 ASSERT_EQ(vt, decoded.type);
40
41 ASSERT_TRUE(!ParseInternalKey(Slice("bar"), &decoded));
42}
43
44class FormatTest {};
45

Callers 1

TESTFunction · 0.85

Calls 4

IKeyFunction · 0.85
ParseInternalKeyFunction · 0.85
SliceClass · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected