Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
Loading...
Searching...
No Matches
AsyncStressTest Class Reference

Test fixture for async operation stress tests. More...

Inheritance diagram for AsyncStressTest:
Inheritance graph
Collaboration diagram for AsyncStressTest:
Collaboration graph

Protected Member Functions

void SetUp () override
 
void TearDown () override
 

Protected Attributes

std::unique_ptr< sqlite_backenddb_
 

Detailed Description

Test fixture for async operation stress tests.

Definition at line 36 of file async_stress_test.cpp.

Member Function Documentation

◆ SetUp()

void AsyncStressTest::SetUp ( )
inlineoverrideprotected

Definition at line 40 of file async_stress_test.cpp.

40 {
41 db_ = std::make_unique<sqlite_backend>();
42#ifdef USE_SQLITE
43 connection_config config;
44 config.database = ":memory:";
45 ASSERT_TRUE(db_->initialize(config).is_ok());
46 ASSERT_TRUE(db_->execute_query("CREATE TABLE stress_test ("
47 " id INTEGER PRIMARY KEY AUTOINCREMENT,"
48 " thread_id INTEGER,"
49 " value TEXT,"
50 " created_at TEXT DEFAULT CURRENT_TIMESTAMP"
51 ")").is_ok());
52#else
53 GTEST_SKIP() << "SQLite not available";
54#endif
55 }
std::unique_ptr< sqlite_backend > db_
Configuration for database connection.
#define ASSERT_TRUE(condition, message)

References ASSERT_TRUE, database::core::connection_config::database, and db_.

◆ TearDown()

void AsyncStressTest::TearDown ( )
inlineoverrideprotected

Definition at line 57 of file async_stress_test.cpp.

57 {
58 if (db_ && db_->is_initialized()) {
59 db_->shutdown();
60 }
61 }

References db_.

Member Data Documentation

◆ db_

std::unique_ptr<sqlite_backend> AsyncStressTest::db_
protected

Definition at line 38 of file async_stress_test.cpp.

Referenced by SetUp(), and TearDown().


The documentation for this class was generated from the following file: