Skip to content

Commit

Permalink
Update seed of random number generator in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed May 7, 2020
1 parent 85a9b91 commit 2e43116
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
#include <cstdlib>
#include <iostream>
#include <boost/test/included/unit_test.hpp>
#include <chrono>

extern uint32_t GRAPHENE_TESTING_GENESIS_TIMESTAMP;

boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) {
std::srand(time(NULL));
std::cout << "Random number generator seeded to " << time(NULL) << std::endl;
const auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count();
std::srand( seed );
std::cout << "Random number generator seeded to " << seed << std::endl;
const char* genesis_timestamp_str = getenv("GRAPHENE_TESTING_GENESIS_TIMESTAMP");
if( genesis_timestamp_str != nullptr )
{
Expand Down

0 comments on commit 2e43116

Please sign in to comment.