|
Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
|
Unit tests for thread_adapter (Phase 4) More...
#include "../../database/integrated/adapters/thread_adapter.h"#include <atomic>#include <chrono>#include <iostream>#include <thread>
Go to the source code of this file.
Macros | |
| #define | TEST(name) |
| #define | RUN_TEST(name) |
| #define | ASSERT_TRUE(condition) |
| #define | ASSERT_FALSE(condition) |
Functions | |
| void | test_configuration_construction () |
| void | test_adapter_construction () |
| void | test_api_availability_submit () |
| void | test_api_availability_priority () |
| void | test_api_availability_stats () |
| void | test_multiple_instances () |
| void | test_move_semantics () |
| void | test_destructor_safety () |
| void | test_shutdown_without_init () |
| void | test_double_initialization () |
| int | main () |
Variables | |
| int | tests_passed = 0 |
| int | tests_failed = 0 |
Unit tests for thread_adapter (Phase 4)
These are lightweight API tests that verify the adapter interface without requiring deep integration with thread_system.
For full integration testing, run the integration test suite instead.
Definition in file test_thread_adapter.cpp.
| #define ASSERT_FALSE | ( | condition | ) |
Definition at line 47 of file test_thread_adapter.cpp.
| #define ASSERT_TRUE | ( | condition | ) |
Definition at line 42 of file test_thread_adapter.cpp.
Referenced by test_api_availability_priority(), test_api_availability_submit(), and test_configuration_construction().
| #define RUN_TEST | ( | name | ) |
Definition at line 29 of file test_thread_adapter.cpp.
Referenced by main().
| #define TEST | ( | name | ) |
Definition at line 28 of file test_thread_adapter.cpp.
| int main | ( | ) |
Definition at line 242 of file test_thread_adapter.cpp.
References RUN_TEST, tests_failed, and tests_passed.
| void test_adapter_construction | ( | ) |
Definition at line 67 of file test_thread_adapter.cpp.
References database::integrated::db_thread_config::thread_count.
| void test_api_availability_priority | ( | ) |
Definition at line 107 of file test_thread_adapter.cpp.
References ASSERT_TRUE, database::integrated::adapters::thread_adapter::initialize(), database::integrated::adapters::thread_adapter::shutdown(), database::integrated::adapters::thread_adapter::submit(), and database::integrated::db_thread_config::thread_count.

| void test_api_availability_stats | ( | ) |
Definition at line 133 of file test_thread_adapter.cpp.
References database::integrated::adapters::thread_adapter::queue_size(), database::integrated::db_thread_config::thread_count, and database::integrated::adapters::thread_adapter::worker_count().

| void test_api_availability_submit | ( | ) |
Definition at line 78 of file test_thread_adapter.cpp.
References ASSERT_TRUE, database::integrated::adapters::thread_adapter::initialize(), database::integrated::adapters::thread_adapter::shutdown(), database::integrated::adapters::thread_adapter::submit(), and database::integrated::db_thread_config::thread_count.

| void test_configuration_construction | ( | ) |
Definition at line 54 of file test_thread_adapter.cpp.
References ASSERT_TRUE, database::integrated::db_thread_config::enable_priority_scheduling, database::integrated::db_thread_config::max_queue_size, database::integrated::db_thread_config::pool_type, and database::integrated::db_thread_config::thread_count.
| void test_destructor_safety | ( | ) |
Definition at line 181 of file test_thread_adapter.cpp.
References database::integrated::adapters::thread_adapter::initialize(), database::integrated::adapters::thread_adapter::submit(), and database::integrated::db_thread_config::thread_count.

| void test_double_initialization | ( | ) |
Definition at line 219 of file test_thread_adapter.cpp.
References database::integrated::adapters::thread_adapter::initialize(), database::integrated::adapters::thread_adapter::shutdown(), and database::integrated::db_thread_config::thread_count.

| void test_move_semantics | ( | ) |
Definition at line 164 of file test_thread_adapter.cpp.
References database::integrated::adapters::thread_adapter::initialize(), database::integrated::adapters::thread_adapter::shutdown(), and database::integrated::db_thread_config::thread_count.

| void test_multiple_instances | ( | ) |
Definition at line 149 of file test_thread_adapter.cpp.
References database::integrated::db_thread_config::thread_count.
| void test_shutdown_without_init | ( | ) |
Definition at line 205 of file test_thread_adapter.cpp.
References database::integrated::adapters::thread_adapter::shutdown(), and database::integrated::db_thread_config::thread_count.

| int tests_failed = 0 |
Definition at line 26 of file test_thread_adapter.cpp.
Referenced by main().
| int tests_passed = 0 |
Definition at line 25 of file test_thread_adapter.cpp.
Referenced by main().