summaryrefslogtreecommitdiffstats
path: root/src/test/neorados/completions.cc
blob: d9c0e087005efb72a9f0b9a80993b99683a2e2a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <cassert>
#include <boost/asio.hpp>
#include <boost/system/system_error.hpp>

constexpr int max_completions = 10'000'000;
int completed = 0;

boost::asio::io_context c;

void nested_cb() {
  if (++completed < max_completions)
    c.post(&nested_cb);
}

int main(void) {
  c.post(&nested_cb);
  c.run();
  assert(completed == max_completions);
  return 0;
}