Changeset View
Changeset View
Standalone View
Standalone View
src/test/dbwrapper_tests.cpp
// Copyright (c) 2012-2016 The Bitcoin Core developers | // Copyright (c) 2012-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <dbwrapper.h> | #include <dbwrapper.h> | ||||
#include <random.h> | #include <random.h> | ||||
#include <uint256.h> | #include <uint256.h> | ||||
#include <test/test_bitcoin.h> | #include <test/test_bitcoin.h> | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <memory> | |||||
// Test if a string consists entirely of null characters | // Test if a string consists entirely of null characters | ||||
static bool is_null_key(const std::vector<uint8_t> &key) { | static bool is_null_key(const std::vector<uint8_t> &key) { | ||||
bool isnull = true; | bool isnull = true; | ||||
for (unsigned int i = 0; i < key.size(); i++) | for (unsigned int i = 0; i < key.size(); i++) | ||||
isnull &= (key[i] == '\x00'); | isnull &= (key[i] == '\x00'); | ||||
return isnull; | return isnull; | ||||
▲ Show 20 Lines • Show All 311 Lines • Show Last 20 Lines |