MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/dbwrapper_tests.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24BOOST_FIXTURE_TEST_SUITE(dbwrapper_tests, BasicTestingSetup)
25
26BOOST_AUTO_TEST_CASE(dbwrapper)
27{
28 // Perform tests both obfuscated and non-obfuscated.
29 for (bool obfuscate : {false, true}) {
30 fs::path ph = SetDataDir(std::string("dbwrapper").append(obfuscate ? "_true" : "_false"));
31 CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
32 char key = 'k';
33 uint256 in = InsecureRand256();
34 uint256 res;
35
36 // Ensure that we're doing real obfuscation when obfuscate=true
37 BOOST_CHECK(obfuscate != is_null_key(dbwrapper_private::GetObfuscateKey(dbw)));
38
39 BOOST_CHECK(dbw.Write(key, in));
40 BOOST_CHECK(dbw.Read(key, res));
41 BOOST_CHECK_EQUAL(res.ToString(), in.ToString());
42 }
43}
44
45// Test batch operations
46BOOST_AUTO_TEST_CASE(dbwrapper_batch)

Callers

nothing calls this directly

Calls 15

SetDataDirFunction · 0.85
InsecureRand256Function · 0.85
is_null_keyFunction · 0.85
IsEmptyMethod · 0.80
WriteMethod · 0.45
ReadMethod · 0.45
ToStringMethod · 0.45
EraseMethod · 0.45
WriteBatchMethod · 0.45
NewIteratorMethod · 0.45
SeekMethod · 0.45
GetKeyMethod · 0.45

Tested by

no test coverage detected