Related refactoring to updated of ThrottleList to use new Scheduler.

This commit is contained in:
Jari Sundell
2025-05-12 10:38:07 +02:00
committed by GitHub
parent 6d888c008d
commit 9ff373fe58
33 changed files with 1005 additions and 230 deletions
+30
View File
@@ -0,0 +1,30 @@
#ifndef TEST_HELPERS_TEST_MAIN_THREAD_H
#define TEST_HELPERS_TEST_MAIN_THREAD_H
#include <memory>
#include <torrent/common.h>
#include <torrent/utils/thread.h>
#include "test/helpers/test_thread.h"
class TestMainThread : public torrent::utils::Thread {
public:
static std::unique_ptr<TestMainThread> create();
~TestMainThread() override;
const char* name() const override { return "rtorrent test main"; }
void init_thread() override;
void test_set_cached_time(std::chrono::microseconds t) { set_cached_time(365 * 24h + t); }
void test_process_events_without_cached_time() { process_events_without_cached_time(); }
private:
TestMainThread();
void call_events() override;
std::chrono::microseconds next_timeout() override;
};
#endif // TEST_HELPERS_TEST_MAIN_THREAD_H