2020-12-31 09:48:25 +01:00
|
|
|
// Copyright (c) 2009-2020 The Bitcoin Core developers
|
2019-10-02 12:01:52 +00:00
|
|
|
// 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/moneystr.h>
|
|
|
|
#include <util/strencodings.h>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2020-12-03 16:42:49 +01:00
|
|
|
FUZZ_TARGET(parse_numbers)
|
2019-10-02 12:01:52 +00:00
|
|
|
{
|
|
|
|
const std::string random_string(buffer.begin(), buffer.end());
|
|
|
|
|
2021-06-11 12:33:20 +08:00
|
|
|
(void)ParseMoney(random_string);
|
2019-10-02 12:01:52 +00:00
|
|
|
|
2021-03-14 13:10:25 +01:00
|
|
|
uint8_t u8;
|
|
|
|
(void)ParseUInt8(random_string, &u8);
|
|
|
|
|
2021-03-19 23:50:36 +01:00
|
|
|
uint16_t u16;
|
|
|
|
(void)ParseUInt16(random_string, &u16);
|
|
|
|
|
2019-10-02 12:01:52 +00:00
|
|
|
int32_t i32;
|
|
|
|
(void)ParseInt32(random_string, &i32);
|
2021-09-30 14:18:50 +00:00
|
|
|
(void)LocaleIndependentAtoi<int>(random_string);
|
2019-10-02 12:01:52 +00:00
|
|
|
|
|
|
|
uint32_t u32;
|
|
|
|
(void)ParseUInt32(random_string, &u32);
|
|
|
|
|
|
|
|
int64_t i64;
|
2021-09-30 14:18:50 +00:00
|
|
|
(void)LocaleIndependentAtoi<int64_t>(random_string);
|
2019-10-02 12:01:52 +00:00
|
|
|
(void)ParseFixedPoint(random_string, 3, &i64);
|
|
|
|
(void)ParseInt64(random_string, &i64);
|
|
|
|
|
|
|
|
uint64_t u64;
|
|
|
|
(void)ParseUInt64(random_string, &u64);
|
|
|
|
}
|