Generate a sequence of randomly-sized ordered spans covering exactly [0, size). Returns a vector of (start, stop) pairs.
| 1409 | // Generate a sequence of randomly-sized ordered spans covering exactly [0, size). |
| 1410 | // Returns a vector of (start, stop) pairs. |
| 1411 | std::vector<std::pair<int, int>> RandomSequenceSpans(int size) { |
| 1412 | std::default_random_engine gen(seed_++); |
| 1413 | // The distribution of span sizes |
| 1414 | std::poisson_distribution<int> dist(5); |
| 1415 | std::vector<std::pair<int, int>> spans; |
| 1416 | int start = 0; |
| 1417 | while (start < size) { |
| 1418 | int stop = std::min(start + dist(gen), size); |
| 1419 | spans.emplace_back(start, stop); |
| 1420 | start = stop; |
| 1421 | } |
| 1422 | return spans; |
| 1423 | } |
| 1424 | |
| 1425 | void AssertAllNotFinished(const std::vector<int>& future_indices) { |
| 1426 | const auto& futures = executor_->futures(); |
nothing calls this directly
no test coverage detected