MCPcopy Create free account
hub / github.com/apple/foundationdb / testRangeBasedForLoop

Function testRangeBasedForLoop

flow/Arena.cpp:511–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509namespace {
510template <template <class> class VectorRefLike>
511void testRangeBasedForLoop() {
512 VectorRefLike<StringRef> xs;
513 Arena a;
514 int size = deterministicRandom()->randomInt(0, 100);
515 for (int i = 0; i < size; ++i) {
516 xs.push_back_deep(a, StringRef(std::to_string(i)));
517 }
518 ASSERT(xs.size() == size);
519 int i = 0;
520 for (const auto& x : xs) {
521 ASSERT(x == StringRef(std::to_string(i++)));
522 }
523 ASSERT(i == size);
524}
525
526template <template <class> class VectorRefLike>
527void testIteratorIncrement() {

Callers

nothing calls this directly

Calls 6

deterministicRandomFunction · 0.85
StringRefClass · 0.50
to_stringFunction · 0.50
randomIntMethod · 0.45
push_back_deepMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected