test: clean up threadpool test types #35174

pull l0rinc wants to merge 2 commits into bitcoin:master from l0rinc:l0rinc/threadpool-test-casts changing 1 files +18 −18
  1. l0rinc commented at 6:28 PM on April 28, 2026: contributor

    Loosely related to the review of #31132 (review).

    Problem

    threadpool_tests currently stores a container-sized task count as int32_t in the range-submission test, then casts it back to size_t when sizing containers and checking future counts.

    Some atomic declarations in the same file also use the longer std::atomic<T> spelling while nearby code uses the shorter standard typedefs.

    Fix

    Use size_t for the task count, generated range, task return type, and accumulators so the test stays in the same type domain as the containers it exercises.

    Also switch the remaining simple atomic declarations in threadpool_tests to the matching standard typedefs such as std::atomic_int, std::atomic_bool, and std::atomic_size_t.

  2. test: keep threadpool task count as `size_t`
    `threadpool_tests` uses a small task count to size containers and compare future counts, but stores it in `int32_t` and casts it back to `size_t` throughout the range-submission test.
    
    Use `size_t` for the task count, generated range, task return type, and accumulators so the test stays in the container size domain.
    b5f8a03738
  3. test: unify `std::atomic_` references in `threadpool_tests` dc4588c129
  4. DrahtBot added the label Tests on Apr 28, 2026
  5. DrahtBot commented at 6:28 PM on April 28, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me