MCPcopy Create free account
hub / github.com/apache/impala / RandomlyFillString

Function RandomlyFillString

be/src/util/redactor-test-utils.cc:78–86  ·  view source on GitHub ↗

Randomly fills the contents of 'string' up to the given length.

Source from the content-addressed store, hash-verified

76
77/// Randomly fills the contents of 'string' up to the given length.
78void RandomlyFillString(char* string, const int length) {
79 ASSERT_GT(length, 0);
80 unsigned int rand_seed = RandSeed();
81 int char_count = static_cast<int>('~') - static_cast<int>(' ') + 1;
82 for (int i = 0; i < length - 1; ++i) {
83 string[i] = ' ' + rand_r(&rand_seed) % char_count;
84 }
85 string[length - 1] = '\0';
86}
87
88void AssertErrorMessageContains(const std::string& message, const char* expected) {
89 ASSERT_TRUE(message.find(expected) != std::string::npos)

Callers 2

MultiThreadWorkloadFunction · 0.85
TESTFunction · 0.85

Calls 1

RandSeedFunction · 0.85

Tested by

no test coverage detected