Commit 1e89d436 authored by Mateusz Loskot's avatar Mateusz Loskot

Fully qualify uses of session class with namespace soci::session.

This should solve compilation errors on OSX where struct session defined in
global namespace in /usr/include/sys/proc.h conflicts with unqualified uses of
soci::session.
Fixes #340
parent caa3e2bc
This diff is collapsed.
......@@ -121,7 +121,7 @@ public:
TEST_CASE("DB2 test 1", "[db2]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
sql << "SELECT CURRENT TIMESTAMP FROM SYSIBM.SYSDUMMY1";
sql << "SELECT " << 123 << " FROM SYSIBM.SYSDUMMY1";
......@@ -303,7 +303,7 @@ TEST_CASE("DB2 test 1", "[db2]")
TEST_CASE("DB2 test 2", "[db2]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
std::string query = "CREATE TABLE DB2INST1.SOCI_TEST (ID BIGINT,DATA VARCHAR(8),DT TIMESTAMP)";
sql << query;
......@@ -350,7 +350,7 @@ TEST_CASE("DB2 test 2", "[db2]")
TEST_CASE("DB2 test 3", "[db2]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
int i;
std::string query = "CREATE TABLE DB2INST1.SOCI_TEST (ID BIGINT,DATA VARCHAR(8),DT TIMESTAMP)";
......
......@@ -76,7 +76,7 @@ namespace soci
TEST_CASE("Dummy test", "[empty]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
sql << "Do what I want.";
sql << "Do what I want " << 123 << " times.";
......
......@@ -43,7 +43,7 @@ namespace boost {
// fundamental tests - transactions in Firebird
TEST_CASE("Firebird transactions", "[firebird][transaction]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
// In Firebird transaction is always required and is started
// automatically when session is opened. There is no need to
......@@ -77,7 +77,7 @@ TEST_CASE("Firebird transactions", "[firebird][transaction]")
// character types
TEST_CASE("Firebird char types", "[firebird][string]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -172,7 +172,7 @@ TEST_CASE("Firebird char types", "[firebird][string]")
// date and time
TEST_CASE("Firebird date and time", "[firebird][datetime]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -225,7 +225,7 @@ TEST_CASE("Firebird date and time", "[firebird][datetime]")
// floating points
TEST_CASE("Firebird floating point", "[firebird][float]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -308,7 +308,7 @@ TEST_CASE("Firebird floating point", "[firebird][float]")
// integer types and indicators
TEST_CASE("Firebird integers", "[firebird][int]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
{
short sh(0);
......@@ -369,7 +369,7 @@ TEST_CASE("Firebird integers", "[firebird][int]")
// repeated fetch and bulk operations for character types
TEST_CASE("Firebird bulk operations", "[firebird][bulk]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -518,7 +518,7 @@ TEST_CASE("Firebird bulk operations", "[firebird][bulk]")
// blob test
TEST_CASE("Firebird blobs", "[firebird][blob]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -637,7 +637,7 @@ TEST_CASE("Firebird blobs", "[firebird][blob]")
// named parameters
TEST_CASE("Firebird named parameters", "[firebird][named-params]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -720,7 +720,7 @@ TEST_CASE("Firebird named parameters", "[firebird][named-params]")
// Dynamic binding to row objects
TEST_CASE("Firebird dynamic binding", "[firebird][dynamic]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -812,7 +812,7 @@ TEST_CASE("Firebird dynamic binding", "[firebird][dynamic]")
// stored procedures
TEST_CASE("Firebird stored procedures", "[firebird][procedure]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -1004,7 +1004,7 @@ namespace soci
TEST_CASE("Firebird direct API use", "[firebird][native]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -1071,7 +1071,7 @@ TEST_CASE("Firebird direct API use", "[firebird][native]")
TEST_CASE("Firebird string coercions", "[firebird][string]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
try
{
......@@ -1141,7 +1141,7 @@ TEST_CASE("Firebird decimals as strings", "[firebird][decimal][string]")
CHECK(format_decimal<int>(&a, -8) == "0.12345678");
CHECK(format_decimal<int>(&a, -9) == "0.012345678");
session sql(backEnd, connectString + " decimals_as_strings=1");
soci::session sql(backEnd, connectString + " decimals_as_strings=1");
try
{
......
......@@ -44,7 +44,7 @@ namespace boost {
// procedure call test
TEST_CASE("MySQL stored procedures", "[mysql][stored-procedure]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
mysql_session_backend *sessionBackEnd
= static_cast<mysql_session_backend *>(sql.get_backend());
......@@ -99,7 +99,7 @@ TEST_CASE("MySQL error reporting", "[mysql][exception]")
{
try
{
session sql(backEnd, "host=test.soci.invalid");
soci::session sql(backEnd, "host=test.soci.invalid");
}
catch (mysql_soci_error const &e)
{
......@@ -113,7 +113,7 @@ TEST_CASE("MySQL error reporting", "[mysql][exception]")
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
sql << "create table soci_test (id integer)";
try
{
......@@ -167,7 +167,7 @@ struct bigint_unsigned_table_creator : table_creator_base
TEST_CASE("MySQL long long", "[mysql][longlong]")
{
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_table_creator tableCreator(sql);
......@@ -182,7 +182,7 @@ TEST_CASE("MySQL long long", "[mysql][longlong]")
// vector<long long>
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_table_creator tableCreator(sql);
......@@ -207,7 +207,7 @@ TEST_CASE("MySQL long long", "[mysql][longlong]")
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_unsigned_table_creator tableCreator(sql);
......@@ -217,7 +217,7 @@ TEST_CASE("MySQL long long", "[mysql][longlong]")
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_unsigned_table_creator tableCreator(sql);
......@@ -231,7 +231,7 @@ TEST_CASE("MySQL long long", "[mysql][longlong]")
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_unsigned_table_creator tableCreator(sql);
......@@ -245,7 +245,7 @@ TEST_CASE("MySQL long long", "[mysql][longlong]")
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_unsigned_table_creator tableCreator(sql);
......@@ -257,7 +257,7 @@ TEST_CASE("MySQL long long", "[mysql][longlong]")
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_unsigned_table_creator tableCreator(sql);
......@@ -282,7 +282,7 @@ void test_num(const char* s, bool valid, T value)
{
try
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
T val;
sql << "select \'" << s << "\'", into(val);
if (valid)
......@@ -377,7 +377,7 @@ TEST_CASE("MySQL number conversion", "[mysql][float][int]")
TEST_CASE("MySQL datetime", "[mysql][datetime]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
std::tm t;
sql << "select maketime(19, 54, 52)", into(t);
CHECK(t.tm_year == 100);
......@@ -391,7 +391,7 @@ TEST_CASE("MySQL datetime", "[mysql][datetime]")
// TEXT and BLOB types support test.
TEST_CASE("MySQL text and blob", "[mysql][text][blob]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
std::string a("asdfg\0hjkl", 10);
std::string b("lkjhg\0fd\0\0sa\0", 13);
std::string c("\\0aa\\0bb\\0cc\\0", 10);
......@@ -513,7 +513,7 @@ struct integer_value_table_creator : table_creator_base
TEST_CASE("MySQL get affected rows", "[mysql][affected-rows]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
integer_value_table_creator tableCreator(sql);
......@@ -539,7 +539,7 @@ TEST_CASE("MySQL get affected rows", "[mysql][affected-rows]")
// The prepared statements should survive session::reconnect().
TEST_CASE("MySQL statements after reconnect", "[mysql][connect]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
integer_value_table_creator tableCreator(sql);
......@@ -580,7 +580,7 @@ struct unsigned_value_table_creator : table_creator_base
// rowset<> should be able to take INT UNSIGNED.
TEST_CASE("MySQL unsigned int", "[mysql][int]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
unsigned_value_table_creator tableCreator(sql);
......@@ -598,7 +598,7 @@ TEST_CASE("MySQL unsigned int", "[mysql][int]")
TEST_CASE("MySQL function call", "[mysql][function]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
row r;
......@@ -629,7 +629,7 @@ TEST_CASE("MySQL special floating point values", "[mysql][float]")
"Use element used with infinity or NaN, which are "
"not supported by the MySQL server.";
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
double x = std::numeric_limits<double>::quiet_NaN();
statement st = (sql.prepare << "SELECT :x", use(x, "x"));
......@@ -640,7 +640,7 @@ TEST_CASE("MySQL special floating point values", "[mysql][float]")
}
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
double x = std::numeric_limits<double>::infinity();
statement st = (sql.prepare << "SELECT :x", use(x, "x"));
......@@ -651,7 +651,7 @@ TEST_CASE("MySQL special floating point values", "[mysql][float]")
}
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
double_value_table_creator tableCreator(sql);
std::vector<double> v(1, std::numeric_limits<double>::quiet_NaN());
......@@ -662,7 +662,7 @@ TEST_CASE("MySQL special floating point values", "[mysql][float]")
}
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
double_value_table_creator tableCreator(sql);
std::vector<double> v(1, std::numeric_limits<double>::infinity());
......@@ -695,7 +695,7 @@ struct tinyint_unsigned_value_table_creator : table_creator_base
TEST_CASE("MySQL tinyint", "[mysql][int][tinyint]")
{
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
unsigned_value_table_creator tableCreator(sql);
unsigned int mask = 0xffffff00;
sql << "insert into soci_test set val = " << mask;
......@@ -707,7 +707,7 @@ TEST_CASE("MySQL tinyint", "[mysql][int][tinyint]")
CHECK(r.get<unsigned>("val") == 0xffffff00);
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
tinyint_value_table_creator tableCreator(sql);
sql << "insert into soci_test set val = -123";
row r;
......@@ -717,7 +717,7 @@ TEST_CASE("MySQL tinyint", "[mysql][int][tinyint]")
CHECK(r.get<int>("val") == -123);
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
tinyint_unsigned_value_table_creator tableCreator(sql);
sql << "insert into soci_test set val = 123";
row r;
......@@ -727,7 +727,7 @@ TEST_CASE("MySQL tinyint", "[mysql][int][tinyint]")
CHECK(r.get<int>("val") == 123);
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_unsigned_table_creator tableCreator(sql);
sql << "insert into soci_test set val = 123456789012345";
row r;
......@@ -737,7 +737,7 @@ TEST_CASE("MySQL tinyint", "[mysql][int][tinyint]")
CHECK(r.get<unsigned long long>("val") == 123456789012345ULL);
}
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
bigint_table_creator tableCreator(sql);
sql << "insert into soci_test set val = -123456789012345";
row r;
......@@ -762,7 +762,7 @@ struct strings_table_creator : table_creator_base
TEST_CASE("MySQL strings", "[mysql][string]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
strings_table_creator tableCreator(sql);
std::string text = "Ala ma kota.";
std::string binary("Ala\0ma\0kota.........", 20);
......@@ -802,7 +802,7 @@ struct table_creator_for_get_last_insert_id : table_creator_base
TEST_CASE("MySQL last insert id", "[mysql][last-insert-id]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
table_creator_for_get_last_insert_id tableCreator(sql);
sql << "insert into soci_test () values ()";
long id;
......@@ -825,7 +825,7 @@ std::string escape_string(soci::session& sql, const std::string& s)
void test14()
{
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
strings_table_creator tableCreator(sql);
std::string s = "word1'word2:word3";
std::string escaped = escape_string(sql, s);
......@@ -844,7 +844,7 @@ void test14()
void test15()
{
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
int n;
sql << "select @a := 123", into(n);
CHECK(n == 123);
......
......@@ -124,7 +124,7 @@ struct table_creator_bigint : table_creator_base
TEST_CASE("ODBC/DB2 long long", "[odbc][db2][longlong]")
{
const int num_recs = 100;
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
table_creator_bigint table(sql);
{
......@@ -153,7 +153,7 @@ TEST_CASE("ODBC/DB2 long long", "[odbc][db2][longlong]")
TEST_CASE("ODBC/DB2 unsigned long long", "[odbc][db2][unsigned][longlong]")
{
const int num_recs = 100;
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
table_creator_bigint table(sql);
{
......@@ -182,7 +182,7 @@ TEST_CASE("ODBC/DB2 unsigned long long", "[odbc][db2][unsigned][longlong]")
TEST_CASE("ODBC/DB2 vector long long", "[odbc][db2][vector][longlong]")
{
const std::size_t num_recs = 100;
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
table_creator_bigint table(sql);
{
......@@ -223,7 +223,7 @@ TEST_CASE("ODBC/DB2 vector long long", "[odbc][db2][vector][longlong]")
TEST_CASE("ODBC/DB2 vector unsigned long long", "[odbc][db2][vector][unsigned][longlong]")
{
const std::size_t num_recs = 100;
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
table_creator_bigint table(sql);
{
......
......@@ -199,7 +199,7 @@ public:
private:
odbc_version get_driver_version() const
{
session sql(get_backend_factory(), get_connect_string());
soci::session sql(get_backend_factory(), get_connect_string());
odbc_session_backend* const
odbc_session = static_cast<odbc_session_backend*>(sql.get_backend());
if (!odbc_session)
......
......@@ -39,7 +39,7 @@ namespace boost {
// Extra tests for date/time
TEST_CASE("Oracle datetime", "[oracle][datetime]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
{
std::time_t now = std::time(NULL);
......@@ -106,7 +106,7 @@ TEST_CASE("Oracle datetime", "[oracle][datetime]")
// explicit calls test
TEST_CASE("Oracle explicit calls", "[oracle]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
statement st(sql);
st.alloc();
......@@ -135,7 +135,7 @@ struct blob_table_creator : public table_creator_base
TEST_CASE("Oracle blob", "[oracle][blob]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
blob_table_creator tableCreator(sql);
......@@ -199,7 +199,7 @@ struct basic_table_creator : public table_creator_base
TEST_CASE("Oracle nested statement", "[oracle][blob]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
basic_table_creator tableCreator(sql);
int id;
......@@ -236,7 +236,7 @@ TEST_CASE("Oracle nested statement", "[oracle][blob]")
// ROWID test
TEST_CASE("Oracle rowid", "[oracle][rowid]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
basic_table_creator tableCreator(sql);
sql << "insert into soci_test(id, name) values(7, \'John\')";
......@@ -268,7 +268,7 @@ struct procedure_creator : procedure_creator_base
TEST_CASE("Oracle stored procedure", "[oracle][stored-procedure]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
procedure_creator procedure_creator(sql);
std::string in("my message");
......@@ -345,7 +345,7 @@ struct returns_null_procedure_creator : public procedure_creator_base
TEST_CASE("Oracle user-defined objects", "[oracle][type_conversion]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
{
basic_table_creator tableCreator(sql);
......@@ -366,7 +366,7 @@ TEST_CASE("Oracle user-defined objects", "[oracle][type_conversion]")
TEST_CASE("Oracle user-defined objects in/out", "[oracle][type_conversion]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
// test procedure with user-defined type as in-out parameter
{
......@@ -391,7 +391,7 @@ TEST_CASE("Oracle user-defined objects in/out", "[oracle][type_conversion]")
TEST_CASE("Oracle null user-defined objects in/out", "[oracle][null][type_conversion]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
// test procedure which returns null
returns_null_procedure_creator procedureCreator(sql);
......@@ -406,7 +406,7 @@ TEST_CASE("Oracle null user-defined objects in/out", "[oracle][null][type_conver
// test bulk insert features
TEST_CASE("Oracle bulk insert", "[oracle][insert][bulk]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
basic_table_creator tableCreator(sql);
......@@ -645,7 +645,7 @@ TEST_CASE("Oracle bulk insert", "[oracle][insert][bulk]")
// more tests for bulk fetch
TEST_CASE("Oracle bulk fetch", "[oracle][fetch][bulk]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
basic_table_creator tableCreator(sql);
......@@ -784,7 +784,7 @@ struct times100_procedure_creator : public procedure_creator_base
TEST_CASE("Oracle ORM", "[oracle][orm]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
{
person_table_creator tableCreator(sql);
......@@ -939,7 +939,7 @@ namespace soci
TEST_CASE("Oracle ORM by index", "[oracle][orm]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
person_table_creator tableCreator(sql);
......@@ -984,7 +984,7 @@ struct long_table_creator : public table_creator_base
TEST_CASE("Oracle large strings as long", "[oracle][compatibility]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
long_table_creator creator(sql);
const std::string::size_type max = 32768;
......@@ -1002,7 +1002,7 @@ TEST_CASE("Oracle large strings as long", "[oracle][compatibility]")
// test for modifiable and const use elements
TEST_CASE("Oracle const and modifiable parameters", "[oracle][use]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
int i = 7;
sql << "begin "
......@@ -1039,7 +1039,7 @@ struct longlong_table_creator : table_creator_base
TEST_CASE("Oracle long long", "[oracle][longlong]")
{
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
longlong_table_creator tableCreator(sql);
......@@ -1054,7 +1054,7 @@ TEST_CASE("Oracle long long", "[oracle][longlong]")
// vector<long long>
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
longlong_table_creator tableCreator(sql);
......
......@@ -59,7 +59,7 @@ struct oid_table_creator : public table_creator_base
// whatever that means.
TEST_CASE("PostgreSQL ROWID", "[postgresql][rowid][oid]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
oid_table_creator tableCreator(sql);
......@@ -95,7 +95,7 @@ TEST_CASE("PostgreSQL ROWID", "[postgresql][rowid][oid]")
TEST_CASE("PostgreSQL prepare error", "[postgresql][exception]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
// Must not cause the application to crash.
statement st(sql);
......@@ -146,7 +146,7 @@ protected:
TEST_CASE("PostgreSQL function call", "[postgresql][function]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
function_creator functionCreator(sql);
......@@ -212,7 +212,7 @@ struct blob_table_creator : public table_creator_base
TEST_CASE("PostgreSQL blob", "[postgresql][blob]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
blob_table_creator tableCreator(sql);
......@@ -261,7 +261,7 @@ struct longlong_table_creator : table_creator_base
// long long test
TEST_CASE("PostgreSQL long long", "[postgresql][longlong]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
longlong_table_creator tableCreator(sql);
......@@ -277,7 +277,7 @@ TEST_CASE("PostgreSQL long long", "[postgresql][longlong]")
// vector<long long>
TEST_CASE("PostgreSQL vector long long", "[postgresql][vector][longlong]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
longlong_table_creator tableCreator(sql);
......@@ -304,7 +304,7 @@ TEST_CASE("PostgreSQL vector long long", "[postgresql][vector][longlong]")
// unsigned long long test
TEST_CASE("PostgreSQL unsigned long long", "[postgresql][unsigned][longlong]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
longlong_table_creator tableCreator(sql);
......@@ -328,7 +328,7 @@ struct boolean_table_creator : table_creator_base
TEST_CASE("PostgreSQL boolean", "[postgresql][boolean]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
boolean_table_creator tableCreator(sql);
......@@ -351,7 +351,7 @@ TEST_CASE("PostgreSQL dynamic backend", "[postgresql][backend][.]")
{
try
{
session sql("nosuchbackend://" + connectString);
soci::session sql("nosuchbackend://" + connectString);
FAIL("expected exception not thrown");
}
catch (soci_error const & e)
......@@ -368,7 +368,7 @@ TEST_CASE("PostgreSQL dynamic backend", "[postgresql][backend][.]")
CHECK(backends[0] == "pgsql");
{
session sql("pgsql://" + connectString);
soci::session sql("pgsql://" + connectString);
}
dynamic_backends::unload("pgsql");
......@@ -378,13 +378,13 @@ TEST_CASE("PostgreSQL dynamic backend", "[postgresql][backend][.]")
}
{
session sql("postgresql://" + connectString);
soci::session sql("postgresql://" + connectString);
}
}
TEST_CASE("PostgreSQL literals", "[postgresql][into]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
int i;
sql << "select 123", into(i);
......@@ -405,7 +405,7 @@ TEST_CASE("PostgreSQL literals", "[postgresql][into]")
TEST_CASE("PostgreSQL backend name", "[postgresql][backend]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
CHECK(sql.get_backend_name() == "postgresql");
}
......@@ -413,7 +413,7 @@ TEST_CASE("PostgreSQL backend name", "[postgresql][backend]")
// test for double-colon cast in SQL expressions
TEST_CASE("PostgreSQL double colon cast", "[postgresql][cast]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
int a = 123;
int b = 0;
......@@ -424,7 +424,7 @@ TEST_CASE("PostgreSQL double colon cast", "[postgresql][cast]")
// test for date, time and timestamp parsing
TEST_CASE("PostgreSQL datetime", "[postgresql][datetime]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
std::string someDate = "2009-06-17 22:51:03.123";
std::tm t1, t2, t3;
......@@ -470,7 +470,7 @@ struct table_creator_for_test11 : table_creator_base
TEST_CASE("PostgreSQL get affected rows", "[postgresql][affected-rows]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
table_creator_for_test11 tableCreator(sql);
......@@ -505,7 +505,7 @@ struct table_creator_for_test12 : table_creator_base
TEST_CASE("PostgreSQL insert into ... returning", "[postgresql]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
table_creator_for_test12 tableCreator(sql);
......@@ -535,7 +535,7 @@ struct bytea_table_creator : public table_creator_base
TEST_CASE("PostgreSQL bytea", "[postgresql][bytea]")
{
session sql(backEnd, connectString);
soci::session sql(backEnd, connectString);
// PostgreSQL supports two different output formats for bytea values:
// historical "escape" format, which is the only one supported until
......@@ -609,7 +609,7 @@ server_version get_postgresql_version(session& sql)
// Test JSON. Only valid for PostgreSQL Server 9.2++
TEST_CASE("PostgreSQL JSON", "[postgresql][json]")
{