Skip to content

Commit

Permalink
tests: Add fuzzing harness for count_seconds(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalswift committed Mar 15, 2020
1 parent 67dfd18 commit cb4eec1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/fuzz/integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <streams.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <time.h>
#include <uint256.h>
#include <util/moneystr.h>
#include <util/strencodings.h>
Expand All @@ -31,6 +32,7 @@
#include <version.h>

#include <cassert>
#include <chrono>
#include <limits>
#include <vector>

Expand Down Expand Up @@ -124,6 +126,8 @@ void test_one_input(const std::vector<uint8_t>& buffer)
assert(parsed_money == i64);
}
}
const std::chrono::seconds seconds{i64};
assert(count_seconds(seconds) == i64);

const arith_uint256 au256 = UintToArith256(u256);
assert(ArithToUint256(au256) == u256);
Expand Down

0 comments on commit cb4eec1

Please sign in to comment.