Browse Source

Random Code: build issues

cl-refactor
Dimitry 10 years ago
parent
commit
3bcee73c84
  1. 6
      test/fuzzTesting/fuzzHelper.cpp
  2. 2
      test/fuzzTesting/fuzzHelper.h

6
test/fuzzTesting/fuzzHelper.cpp

@ -40,11 +40,11 @@ boostIntGenerator RandomCode::randOpCodeGen = boostIntGenerator(gen, opCodeDist)
boostIntGenerator RandomCode::randOpLengGen = boostIntGenerator(gen, opLengDist); boostIntGenerator RandomCode::randOpLengGen = boostIntGenerator(gen, opLengDist);
boostIntGenerator RandomCode::randUniIntGen = boostIntGenerator(gen, uniIntDist); boostIntGenerator RandomCode::randUniIntGen = boostIntGenerator(gen, uniIntDist);
std::string RandomCode::rndByteSequence(int _length, SizeStrictness sizeType) std::string RandomCode::rndByteSequence(int _length, SizeStrictness _sizeType)
{ {
refreshSeed(); refreshSeed();
std::string hash; std::string hash;
_length = (sizeType == SizeStrictness::Strict) ? std::max(1, _length) : randomUniInt() % _length; _length = (_sizeType == SizeStrictness::Strict) ? std::max(1, _length) : randomUniInt() % _length;
for (auto i = 0; i < _length; i++) for (auto i = 0; i < _length; i++)
{ {
uint8_t byte = randOpCodeGen(); uint8_t byte = randOpCodeGen();
@ -182,7 +182,7 @@ void RandomCodeOptions::addAddress(dev::Address const& _address)
addressList.push_back(_address); addressList.push_back(_address);
} }
dev::Address RandomCodeOptions::getRandomAddress() dev::Address RandomCodeOptions::getRandomAddress() const
{ {
if (addressList.size() > 0) if (addressList.size() > 0)
{ {

2
test/fuzzTesting/fuzzHelper.h

@ -47,7 +47,7 @@ public:
RandomCodeOptions(); RandomCodeOptions();
void setWeight(dev::eth::Instruction _opCode, int _weight); void setWeight(dev::eth::Instruction _opCode, int _weight);
void addAddress(dev::Address const& _address); void addAddress(dev::Address const& _address);
dev::Address getRandomAddress(); dev::Address getRandomAddress() const;
bool useUndefinedOpCodes; bool useUndefinedOpCodes;
int smartCodeProbability; int smartCodeProbability;

Loading…
Cancel
Save