No description provided.
Add testcase to simulate bitcoin schema in leveldb #14125
pull MapleLaker wants to merge 2 commits into bitcoin:master from MapleLaker:master changing 1 files +89 −0-
MapleLaker commented at 11:52 PM on August 31, 2018: contributor
-
Add testcase to simulate bitcoin schema in leveldb 29aa77d9ed
- fanquake added the label Tests on Aug 31, 2018
-
9fa2ec8d95
Update dbwrapper_tests.cpp
Modify test case of bitcoin schema leveldb
-
laanwj commented at 9:48 AM on September 1, 2018: member
concept ack
travis fail is due to linting failure:
This diff appears to have added new lines with trailing whitespace. The following changes were suspected: diff --git a/src/test/dbwrapper_tests.cpp b/src/test/dbwrapper_tests.cpp @@ -44,0 +45,89 @@ BOOST_AUTO_TEST_CASE(dbwrapper) + + BOOST_CHECK_EQUAL(res.ToString(), in_block.ToString()); + BOOST_CHECK_EQUAL(res.ToString(), in_transaction.ToString()); + BOOST_CHECK_EQUAL(res.ToString(), in_utxo.ToString()); + BOOST_CHECK_EQUAL(lastblockfilenumber, res_uint_32); + BOOST_CHECK_EQUAL(isInReindexing, res_bool); + BOOST_CHECK_EQUAL(lastblock_hash, res); + BOOST_CHECK_EQUAL(res_bool, in_file_bool); ^---- failure generated from test/lint/lint-whitespace.sh -
in src/test/dbwrapper_tests.cpp:50 in 9fa2ec8d95
41 | @@ -42,6 +42,95 @@ BOOST_AUTO_TEST_CASE(dbwrapper) 42 | } 43 | } 44 | 45 | +BOOST_AUTO_TEST_CASE(dbwrapper_basic_data) 46 | +{ 47 | + // Perform tests both obfuscated and non-obfuscated. 48 | + for (bool obfuscate : {false, true}) { 49 | + fs::path ph = SetDataDir(std::string("dbwrapper_1").append(obfuscate ? "_true" : "_false")); 50 | + //CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
Empact commented at 7:48 PM on September 1, 2018:nit: Could drop this comment
unknown commented at 11:29 PM on September 7, 2018:nit: Could drop this comment
in src/test/dbwrapper_tests.cpp:51 in 9fa2ec8d95
46 | +{ 47 | + // Perform tests both obfuscated and non-obfuscated. 48 | + for (bool obfuscate : {false, true}) { 49 | + fs::path ph = SetDataDir(std::string("dbwrapper_1").append(obfuscate ? "_true" : "_false")); 50 | + //CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate); 51 | + CDBWrapper dbw(ph, (1 << 20), false, true, obfuscate);
Empact commented at 7:49 PM on September 1, 2018:nit: Could you comment these bool literal args?
unknown commented at 11:29 PM on September 7, 2018:CDBWrapper dbw(ph, (1 << 20), false, true, obfuscate);
in src/test/dbwrapper_tests.cpp:63 in 9fa2ec8d95
58 | + BOOST_CHECK(obfuscate != is_null_key(dbwrapper_private::GetObfuscateKey(dbw))); 59 | + 60 | + //Simulate block raw data - "b + block hash" 61 | + std::string block_tag = "b"; 62 | + uint256 block_hash = InsecureRand256(); 63 | + std::string key_block = block_tag + block_hash.ToString();
Empact commented at 8:06 PM on September 1, 2018:Inlining these constructions is a bit more clear IMO, because the var names are redundant with the comments:
//Simulate block raw data - "b + block hash" std::string key_block = "b" + InsecureRand256().ToString(); //Simulate file raw data - "f + file_number" std::string key_file = strprintf("f%04x", InsecureRand32());
unknown commented at 11:30 PM on September 7, 2018:/Simulate block raw data - "b + block hash" std::string key_block = "b" + InsecureRand256().ToString();
//Simulate file raw data - "f + file_number" std::string key_file = strprintf("f%04x", InsecureRand32());
unknown changes_requestedDrahtBot closed this on May 7, 2019DrahtBot commented at 5:06 PM on May 7, 2019: member<!--5d09a71f8925f3f132321140b44b946d-->The last travis run for this pull request was 248 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.
DrahtBot reopened this on May 7, 2019fanquake added the label Up for grabs on Aug 4, 2019fanquake closed this on Aug 4, 2019fanquake removed the label Up for grabs on Oct 21, 2019MarcoFalke referenced this in commit c5ac7af779 on Oct 23, 2019PastaPastaPasta referenced this in commit 16f656e018 on Jun 27, 2021PastaPastaPasta referenced this in commit 72dff249c4 on Jun 28, 2021PastaPastaPasta referenced this in commit 9bd39a0b2d on Jun 29, 2021PastaPastaPasta referenced this in commit 4b0f649cf3 on Jul 1, 2021PastaPastaPasta referenced this in commit a938656ab3 on Jul 1, 2021PastaPastaPasta referenced this in commit 6add296925 on Jul 12, 2021PastaPastaPasta referenced this in commit db4245375a on Jul 13, 2021PastaPastaPasta referenced this in commit 432f329f83 on Jul 13, 2021DrahtBot locked this on Dec 16, 2021ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 09:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 09:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me