From e66ee3eeae2313a26b3e3a2104e8b95ccffb4629 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 22 Aug 2021 11:47:57 +0300 Subject: [PATCH] Add check for code 2. --- benchmark/bench_misc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/benchmark/bench_misc.cpp b/benchmark/bench_misc.cpp index 8b5db4329..e3671a3e7 100644 --- a/benchmark/bench_misc.cpp +++ b/benchmark/bench_misc.cpp @@ -103,7 +103,7 @@ BENCH(NewObj, "new struct, then delete") { } #if !TD_THREAD_UNSUPPORTED -BENCH(ThreadNew, "new struct, then delete in several threads") { +BENCH(ThreadNew, "new struct, then delete in 2 threads") { NewObjBench a, b; td::thread ta([&] { a.run(n / 2); }); td::thread tb([&] { b.run(n - n / 2); }); @@ -593,6 +593,10 @@ class DuplicateCheckerBenchRepeat final : public td::Benchmark { auto iter = i >> 10; auto pos = i - (iter << 10); if (pos < 768) { + if (iter >= 3 && pos == 0) { + auto error = checker_.check((iter - 3) * 768 + pos); + CHECK(error.error().code() == 2); + } checker_.check(iter * 768 + pos).ensure(); } else { checker_.check(iter * 768 + pos - 256).ensure_error();