From 4bd7b6981bb49dd4111c908aaa34c34f677171f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 13 Apr 2018 23:35:06 +0200 Subject: Refactor that fixes a compilation issue in Release mode Some template specialization were not found, because they were not declared at the point they were used. We moved things around, things are less inter-dependant, and also now it works. --- tests/database.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/database.cpp b/tests/database.cpp index c9b8dc7..15c117b 100644 --- a/tests/database.cpp +++ b/tests/database.cpp @@ -7,6 +7,7 @@ #include #include +#include #include @@ -28,11 +29,11 @@ TEST_CASE("Database") { auto o = Database::get_irc_server_options("zouzou@example.com", "irc.example.com"); CHECK(Database::count(Database::irc_server_options) == 0); - o.save(Database::db); + save(o, *Database::db); CHECK(Database::count(Database::irc_server_options) == 1); o.col() = "Different realname"; CHECK(o.col() == "Different realname"); - o.save(Database::db); + save(o, *Database::db); CHECK(o.col() == "Different realname"); CHECK(Database::count(Database::irc_server_options) == 1); @@ -44,7 +45,7 @@ TEST_CASE("Database") // inserted CHECK(1 == Database::count(Database::irc_server_options)); - b.save(Database::db); + save(b, *Database::db); CHECK(2 == Database::count(Database::irc_server_options)); CHECK(b.col() == ""); @@ -58,7 +59,7 @@ TEST_CASE("Database") o.col() = "ISO-8859-1"; CHECK(o.col().is_set == false); o.col().set_value(false); - o.save(Database::db); + save(o, *Database::db); auto b = Database::get_irc_channel_options("zouzou@example.com", "irc.example.com", "#foo"); CHECK(o.col() == "ISO-8859-1"); CHECK(o.col().is_set == true); @@ -77,7 +78,7 @@ TEST_CASE("Database") GIVEN("An option defined for the channel but not the server") { c.col() = "channelEncoding"; - c.save(Database::db); + save(c, *Database::db); WHEN("we fetch that option") { auto r = Database::get_irc_channel_options_with_server_default(owner, server, chan1); @@ -88,7 +89,7 @@ TEST_CASE("Database") GIVEN("An option defined for the server but not the channel") { s.col() = "serverEncoding"; - s.save(Database::db); + save(s, *Database::db); WHEN("we fetch that option") { auto r = Database::get_irc_channel_options_with_server_default(owner, server, chan1); @@ -99,9 +100,9 @@ TEST_CASE("Database") GIVEN("An option defined for both the server and the channel") { s.col() = "serverEncoding"; - s.save(Database::db); + save(s, *Database::db); c.col() = "channelEncoding"; - c.save(Database::db); + save(c, *Database::db); WHEN("we fetch that option") { auto r = Database::get_irc_channel_options_with_server_default(owner, server, chan1); @@ -129,8 +130,8 @@ TEST_CASE("Database") auto after_connection_commands = Database::get_after_connection_commands(soptions); CHECK(after_connection_commands.empty()); - soptions.save(Database::db); - soptions2.save(Database::db); + save(soptions, *Database::db); + save(soptions2, *Database::db); auto com = Database::after_connection_commands.row(); com.col() = "first"; after_connection_commands.push_back(com); -- cgit v1.2.3