MCPcopy Create free account
hub / github.com/apache/arrow / GenerateRandomData

Function GenerateRandomData

cpp/src/arrow/io/buffered_test.cc:53–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51using ::arrow::internal::TemporaryDir;
52
53static std::string GenerateRandomData(size_t nbytes) {
54 // MSVC doesn't accept uint8_t for std::independent_bits_engine<>
55 typedef unsigned long UInt; // NOLINT
56 std::independent_bits_engine<std::default_random_engine, 8 * sizeof(UInt), UInt> engine;
57
58 std::vector<UInt> data(nbytes / sizeof(UInt) + 1);
59 std::generate(begin(data), end(data), std::ref(engine));
60 return std::string(reinterpret_cast<char*>(data.data()), nbytes);
61}
62
63template <typename FileType>
64class FileTestFixture : public ::testing::Test {

Callers 1

TEST_FFunction · 0.85

Calls 4

refFunction · 0.85
beginFunction · 0.50
endFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected