MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / RandomDigits

Method RandomDigits

extern/re2/re2/testing/string_generator.cc:64–78  ·  view source on GitHub ↗

Generates random digits_, return true if successful. Returns false if the random sequence is over.

Source from the content-addressed store, hash-verified

62// Generates random digits_, return true if successful.
63// Returns false if the random sequence is over.
64bool StringGenerator::RandomDigits() {
65 if (--nrandom_ <= 0)
66 return false;
67
68 std::uniform_int_distribution<int> random_len(0, maxlen_);
69 std::uniform_int_distribution<int> random_alphabet_index(
70 0, static_cast<int>(alphabet_.size()) - 1);
71
72 // Pick length.
73 int len = random_len(rng_);
74 digits_.resize(len);
75 for (int i = 0; i < len; i++)
76 digits_[i] = random_alphabet_index(rng_);
77 return true;
78}
79
80// Returns the next string in the iteration, which is the one
81// currently described by digits_. Calls IncrementDigits

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected