MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / genBlock

Function genBlock

source/test/btree_database_test.cpp:19–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 }
18
19 ByteArray genBlock(uint32_t k) {
20 // Make sure not empty, because we test for existence with empty()
21 size_t size = (RandFactor * k) % (MaxSize - 1) + 1;
22 uint8_t val = (uint8_t)(k % 256);
23
24 ByteArray b(size, 0);
25
26 for (size_t i = 0; i < size; ++i) {
27 b[i] = val;
28 val += 1;
29 }
30
31 return b;
32 }
33
34 bool checkBlock(uint32_t k, ByteArray b) {
35 return genBlock(k) == b;

Callers 4

checkBlockFunction · 0.85
putAllFunction · 0.85
removeAllFunction · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected