From 4f7702b284e6cd3a523f706cea5b39f7f049bad9 Mon Sep 17 00:00:00 2001 From: AndyStieber Date: Thu, 27 Jul 2023 10:51:08 -0600 Subject: [PATCH] Added broken unit test for bulk user-defined objects --- tests/common-tests.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/common-tests.h b/tests/common-tests.h index ee791d591..202e9fde4 100644 --- a/tests/common-tests.h +++ b/tests/common-tests.h @@ -823,6 +823,27 @@ TEST_CASE_METHOD(common_tests, "Use and into", "[core][into]") } } +//batch custom object use +TEST_CASE_METHOD(common_tests, "Bulk use with user-defined object", "[core][bulk]") +{ + soci::session sql(backEndFactory_, connectString_); + // create and populate the test table + auto_table_creator tableCreator(tc_.table_creator_1(sql)); + + std::vector entries; + + for (int i = 0; i < 10; i++) + { + PhonebookEntry entry; + entry.name = "test"; + entry.phone = i; + entries.push_back(entry); + } + + + soci::statement statement = (sql.prepare << "INSERT INTO soci_test (value) VALUES (:value)", soci::use(entries)); +} + // repeated fetch and bulk fetch TEST_CASE_METHOD(common_tests, "Repeated and bulk fetch", "[core][bulk]") {