From 8df752428244c5ff4d81a1b91ce5ad02b943e68c Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 12 Oct 2024 04:14:10 -0300 Subject: [PATCH] fix: remove tests --- tests/unit/database/database_test.cpp | 38 +++------------------------ 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/tests/unit/database/database_test.cpp b/tests/unit/database/database_test.cpp index 9965b71dfef..730c1a20512 100644 --- a/tests/unit/database/database_test.cpp +++ b/tests/unit/database/database_test.cpp @@ -64,31 +64,11 @@ suite<"database"> databaseTest = [] { }; test("Database::insertTable should insert data into a table") = [&]() { - std::string tableName = "player_bosstiary"; - std::vector columns = { "player_id", "bossIdSlotOne" , "bossIdSlotTwo"}; - std::vector values = { 1, 1, 2 }; + std::string tableName = "player_storage"; + std::vector columns = { "player_id", "key" , "value"}; + std::vector values = { 1, 5000, 5 }; - expect(g_database().insertTable(tableName, columns, values)) << "Should successfully insert data into the table"; - }; - - test("Database::updateTable should update existing records") = [&]() { - std::string tableName = "test_table"; - std::vector columns = { "value" }; - std::vector values = { 100 }; - std::string whereColumnName = "name"; - mysqlx::Value whereValue = "test_name"; - - expect(g_database().updateTable(tableName, columns, values, whereColumnName, whereValue)) << "Should successfully update the existing record"; - }; - - test("Database::updateTable should insert if record does not exist") = [&]() { - std::string tableName = "test_table"; - std::vector columns = { "name", "value" }; - std::vector values = { "new_name", 200 }; - std::string whereColumnName = "name"; - mysqlx::Value whereValue = "new_name"; - - expect(g_database().updateTable(tableName, columns, values, whereColumnName, whereValue)) << "Should insert a new record if it does not exist"; + expect(db.insertTable(tableName, columns, values)) << "Should successfully insert data into the table"; }; test("Database::retryQuery should retry on failure") = [&]() { @@ -97,14 +77,4 @@ suite<"database"> databaseTest = [] { expect(not g_database().retryQuery(query, retries)) << "Should fail after retry attempts are exhausted"; }; - - test("DBInsert should construct and execute insert queries") = [&]() { - std::string insertQuery = "INSERT INTO test_table (name, value) VALUES"; - DBInsert dbInsert(insertQuery); - - dbInsert.addRow("'name1', 1"); - dbInsert.addRow("'name2', 2"); - - expect(dbInsert.execute()) << "Should successfully execute the insert"; - }; };