rippled
|
std::uniform_int_distribution is platform dependent. More...
Classes | |
struct | paramType |
Public Types | |
using | resultType = IntType |
Public Member Functions | |
uniformIntDistribution (const resultType a=0, const resultType b=std::numeric_limits< resultType >::max()) | |
uniformIntDistribution (const paramType ¶ms) | |
template<class Generator > | |
resultType | operator() (Generator &g) const |
template<class Generator > | |
resultType | operator() (Generator &g, const paramType ¶ms) const |
resultType | a () const |
resultType | b () const |
resultType | min () const |
resultType | max () const |
Public Attributes | |
const resultType | A |
const resultType | B |
Private Member Functions | |
template<class Generator > | |
resultType | rnd (Generator &g, const resultType a, const resultType b) const |
std::uniform_int_distribution is platform dependent.
Unit test for deterministic shards is the following: it generates predictable accounts and transactions, packs them into ledgers and makes the shard. The hash of this shard should be equal to the given value. On different platforms (precisely, Linux and Mac) hashes of the resulting shard was different. It was unvestigated that the problem is in the class std::uniform_int_distribution which generates different pseudorandom sequences on different platforms, but we need predictable sequence.
Definition at line 60 of file DatabaseShard_test.cpp.
using ripple::NodeStore::uniformIntDistribution< IntType >::resultType = IntType |
Definition at line 62 of file DatabaseShard_test.cpp.
|
explicit |
Definition at line 75 of file DatabaseShard_test.cpp.
|
explicit |
Definition at line 82 of file DatabaseShard_test.cpp.
resultType ripple::NodeStore::uniformIntDistribution< IntType >::operator() | ( | Generator & | g | ) | const |
Definition at line 89 of file DatabaseShard_test.cpp.
resultType ripple::NodeStore::uniformIntDistribution< IntType >::operator() | ( | Generator & | g, |
const paramType & | params | ||
) | const |
Definition at line 96 of file DatabaseShard_test.cpp.
resultType ripple::NodeStore::uniformIntDistribution< IntType >::a | ( | ) | const |
Definition at line 102 of file DatabaseShard_test.cpp.
resultType ripple::NodeStore::uniformIntDistribution< IntType >::b | ( | ) | const |
Definition at line 108 of file DatabaseShard_test.cpp.
resultType ripple::NodeStore::uniformIntDistribution< IntType >::min | ( | ) | const |
Definition at line 114 of file DatabaseShard_test.cpp.
resultType ripple::NodeStore::uniformIntDistribution< IntType >::max | ( | ) | const |
Definition at line 120 of file DatabaseShard_test.cpp.
|
private |
Definition at line 128 of file DatabaseShard_test.cpp.
const resultType ripple::NodeStore::uniformIntDistribution< IntType >::A |
Definition at line 64 of file DatabaseShard_test.cpp.
const resultType ripple::NodeStore::uniformIntDistribution< IntType >::B |
Definition at line 64 of file DatabaseShard_test.cpp.