<commit_before>#include <gtest/gtest.h>

#include <EC/ThreadPool.hpp>

using OneThreadPool = EC::ThreadPool<1>;
using ThreeThreadPool = EC::ThreadPool<3>;

TEST(ECThreadPool, CannotCompile) {
    OneThreadPool p;
    std::atomic_int data;
    data.store(0);
    const auto fn = [](void *ud) {
        auto *data = static_cast<std::atomic_int*>(ud);
        data->fetch_add(1);
    };

    p.queueFn(fn, &data);

    p.wakeThreads();

    do {
        std::this_thread::sleep_for(std::chrono::milliseconds(10));
    } while(!p.isQueueEmpty() || !p.isAllThreadsWaiting());

    ASSERT_EQ(data.load(), 1);

    for(unsigned int i = 0; i < 10; ++i) {
        p.queueFn(fn, &data);
    }
    p.wakeThreads();

    do {<commit_msg>Rename a UnitTest for ThreadPool<commit_after>#include <gtest/gtest.h>

#include <EC/ThreadPool.hpp>

using OneThreadPool = EC::ThreadPool<1>;
using ThreeThreadPool = EC::ThreadPool<3>;

TEST(ECThreadPool, OneThread) {
    OneThreadPool p;
    std::atomic_int data;
    data.store(0);
    const auto fn = [](void *ud) {
        auto *data = static_cast<std::atomic_int*>(ud);
        data->fetch_add(1);
    };

    p.queueFn(fn, &data);

    p.wakeThreads();

    do {
        std::this_thread::sleep_for(std::chrono::milliseconds(10));
    } while(!p.isQueueEmpty() || !p.isAllThreadsWaiting());

    ASSERT_EQ(data.load(), 1);

    for(unsigned int i = 0; i < 10; ++i) {
        p.queueFn(fn, &data);
    }
    p.wakeThreads();

    do {
{'fraction_non_alphanumeric': 0.17337883959044367, 'fraction_numerical': 0.013651877133105802, 'mean_word_length': 3.2492753623188406, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6409568', 'n_tokens_mistral': 558, 'n_tokens_neox': 537, 'n_words': 96}