mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-06 10:18:44 -05:00
23 lines
675 B
C++
23 lines
675 B
C++
|
// Copyright (c) 2019 The Bitcoin Core developers
|
||
|
// Distributed under the MIT software license, see the accompanying
|
||
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||
|
|
||
|
#include <test/fuzz/fuzz.h>
|
||
|
|
||
|
#include <util/strencodings.h>
|
||
|
|
||
|
#include <cassert>
|
||
|
#include <cstdint>
|
||
|
#include <string>
|
||
|
#include <vector>
|
||
|
|
||
|
void test_one_input(const std::vector<uint8_t>& buffer)
|
||
|
{
|
||
|
const std::string random_hex_string(buffer.begin(), buffer.end());
|
||
|
const std::vector<unsigned char> data = ParseHex(random_hex_string);
|
||
|
const std::string hex_data = HexStr(data);
|
||
|
if (IsHex(random_hex_string)) {
|
||
|
assert(ToLower(random_hex_string) == hex_data);
|
||
|
}
|
||
|
}
|