| 49 | |
| 50 | template <typename T> |
| 51 | void doFuzzTest(const RowTypePtr& rowType) { |
| 52 | VectorFuzzer::Options opts; |
| 53 | opts.vectorSize = 100; |
| 54 | opts.nullRatio = 0.1; |
| 55 | opts.dictionaryHasNulls = false; |
| 56 | opts.stringVariableLength = true; |
| 57 | opts.stringLength = 20; |
| 58 | opts.containerVariableLength = true; |
| 59 | opts.complexElementsMaxSize = 10'000; |
| 60 | |
| 61 | // Spark uses microseconds to store timestamp |
| 62 | opts.timestampPrecision = |
| 63 | VectorFuzzer::Options::TimestampPrecision::kMicroSeconds, |
| 64 | opts.containerLength = 10; |
| 65 | |
| 66 | VectorFuzzer fuzzer(opts, pool_.get()); |
| 67 | |
| 68 | const auto iterations = 200; |
| 69 | for (size_t i = 0; i < iterations; ++i) { |
| 70 | auto seed = folly::Random::rand32(); |
| 71 | |
| 72 | LOG(INFO) << "seed: " << seed; |
| 73 | SCOPED_TRACE(fmt::format("seed: {}", seed)); |
| 74 | |
| 75 | fuzzer.reSeed(seed); |
| 76 | const auto& inputVector = fuzzer.fuzzInputRow(rowType); |
| 77 | |
| 78 | if (Test::HasFailure()) { |
| 79 | break; |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | template <typename T> |
| 85 | void testRoundTrip(const RowVectorPtr& data) { |
nothing calls this directly
no test coverage detected