Commit c0e93b36 authored by msobczak's avatar msobczak

Name fixes.

parent ce826edd
...@@ -14,41 +14,41 @@ ...@@ -14,41 +14,41 @@
#include <ctime> #include <ctime>
#include <cmath> #include <cmath>
using namespace SOCI; using namespace soci;
using namespace SOCI::tests; using namespace soci::tests;
std::string connectString; std::string connectString;
BackEndFactory const &backEnd = odbc; backend_factory const &backEnd = odbc;
// DDL Creation objects for common tests // DDL Creation objects for common tests
struct TableCreator1 : public TableCreatorBase struct table_creator_one : public table_creator_base
{ {
TableCreator1(Session& session) table_creator_one(session & sql)
: TableCreatorBase(session) : table_creator_base(sql)
{ {
session << "create table soci_test(id integer, val integer, c char, " sql << "create table soci_test(id integer, val integer, c char, "
"str varchar(20), sh int2, ul numeric(20), d float8, " "str varchar(20), sh int2, ul numeric(20), d float8, "
"tm datetime, i1 integer, i2 integer, i3 integer, " "tm datetime, i1 integer, i2 integer, i3 integer, "
"name varchar(20))"; "name varchar(20))";
} }
}; };
struct TableCreator2 : public TableCreatorBase struct table_creator_two : public table_creator_base
{ {
TableCreator2(Session& session) table_creator_two(session & sql)
: TableCreatorBase(session) : table_creator_base(sql)
{ {
session << "create table soci_test(num_float float8, num_int integer," sql << "create table soci_test(num_float float8, num_int integer,"
" name varchar(20), sometime datetime, chr char)"; " name varchar(20), sometime datetime, chr char)";
} }
}; };
struct TableCreator3 : public TableCreatorBase struct table_creator_three : public table_creator_base
{ {
TableCreator3(Session& session) table_creator_three(ession & sql)
: TableCreatorBase(session) : table_creator_base(sql)
{ {
session << "create table soci_test(name varchar(100) not null, " sql << "create table soci_test(name varchar(100) not null, "
"phone varchar(15))"; "phone varchar(15))";
} }
}; };
...@@ -57,29 +57,29 @@ struct TableCreator3 : public TableCreatorBase ...@@ -57,29 +57,29 @@ struct TableCreator3 : public TableCreatorBase
// Support for SOCI Common Tests // Support for SOCI Common Tests
// //
class TestContext : public TestContextBase class test_context : public test_context_base
{ {
public: public:
TestContext(BackEndFactory const &backEnd, test_context(backend_factory const &backEnd,
std::string const &connectString) std::string const &connectString)
: TestContextBase(backEnd, connectString) {} : test_context_base(backEnd, connectString) {}
TableCreatorBase* tableCreator1(Session& s) const table_creator_base * table_creator_1(session& s) const
{ {
return new TableCreator1(s); return new table_creator_one(s);
} }
TableCreatorBase* tableCreator2(Session& s) const table_creator_base * tableCreator2(session& s) const
{ {
return new TableCreator2(s); return new table_creator_two(s);
} }
TableCreatorBase* tableCreator3(Session& s) const table_creator_base * tableCreator3(session& s) const
{ {
return new TableCreator3(s); return new table_creator_three(s);
} }
std::string toDateTime(std::string const &datdt_string) const std::string to_date_time(std::string const &datdt_string) const
{ {
return "\'" + datdt_string + "\'"; return "\'" + datdt_string + "\'";
} }
...@@ -108,16 +108,16 @@ int main(int argc, char** argv) ...@@ -108,16 +108,16 @@ int main(int argc, char** argv)
} }
try try
{ {
TestContext tc(backEnd, connectString); test_context tc(backEnd, connectString);
CommonTests tests(tc); common_tests tests(tc);
tests.run(); tests.run();
} }
catch (SOCI::ODBCSOCIError const & e) catch (SOCI::odbc_soci_error const & e)
{ {
std::cout << "ODBC Error Code: " << e.odbcErrorCode() << std::endl std::cout << "ODBC Error Code: " << e.odbc_error_code() << std::endl
<< "Native Error Code: " << e.nativeErrorCode() << std::endl << "Native Error Code: " << e.native_error_code() << std::endl
<< "SOCI Message: " << e.what() << std::endl << "SOCI Message: " << e.what() << std::endl
<< "ODBC Message: " << e.odbcErrorMessage() << std::endl; << "ODBC Message: " << e.odbc_error_message() << std::endl;
} }
catch (std::exception const & e) catch (std::exception const & e)
{ {
......
...@@ -14,42 +14,42 @@ ...@@ -14,42 +14,42 @@
#include <ctime> #include <ctime>
#include <cmath> #include <cmath>
using namespace SOCI; using namespace soci;
using namespace SOCI::tests; using namespace soci::tests;
std::string connectString; std::string connectString;
BackEndFactory const &backEnd = odbc; backend_factory const &backEnd = odbc;
// DDL Creation objects for common tests // DDL Creation objects for common tests
struct TableCreator1 : public TableCreatorBase struct table_creator_one : public table_creator_base
{ {
TableCreator1(Session& session) table_creator_one(session & sql)
: TableCreatorBase(session) : table_creator_base(sql)
{ {
session << "create table soci_test(id integer, val integer, c char, " sql << "create table soci_test(id integer, val integer, c char, "
"str varchar(20), sh int2, ul numeric(20), d float8, " "str varchar(20), sh int2, ul numeric(20), d float8, "
"tm timestamp, i1 integer, i2 integer, i3 integer, " "tm timestamp, i1 integer, i2 integer, i3 integer, "
"name varchar(20))"; "name varchar(20))";
} }
}; };
struct TableCreator2 : public TableCreatorBase struct table_creator_two : public table_creator_base
{ {
TableCreator2(Session& session) table_creator_two(session & sql)
: TableCreatorBase(session) : table_creator_base(sql)
{ {
session << "create table soci_test(num_float float8, num_int integer," sql << "create table soci_test(num_float float8, num_int integer,"
" name varchar(20), sometime timestamp, chr char)"; " name varchar(20), sometime timestamp, chr char)";
} }
}; };
struct TableCreator3 : public TableCreatorBase struct table_creator_three : public table_creator_base
{ {
TableCreator3(Session& session) table_creator_three(session & sql)
: TableCreatorBase(session) : table_creator_base(sql)
{ {
session << "create table soci_test(name varchar(100) not null, " sql << "create table soci_test(name varchar(100) not null, "
"phone varchar(15))"; "phone varchar(15))";
} }
}; };
...@@ -58,29 +58,29 @@ struct TableCreator3 : public TableCreatorBase ...@@ -58,29 +58,29 @@ struct TableCreator3 : public TableCreatorBase
// Support for SOCI Common Tests // Support for SOCI Common Tests
// //
class TestContext : public TestContextBase class test_context : public test_context_base
{ {
public: public:
TestContext(BackEndFactory const &backEnd, test_context(backend_factory const &backEnd,
std::string const &connectString) std::string const &connectString)
: TestContextBase(backEnd, connectString) {} : test_context_base(backEnd, connectString) {}
TableCreatorBase* tableCreator1(Session& s) const table_creator_base * table_creator_1(session& s) const
{ {
return new TableCreator1(s); return new table_creator_one(s);
} }
TableCreatorBase* tableCreator2(Session& s) const table_creator_base * table_creator_2(session& s) const
{ {
return new TableCreator2(s); return new table_creator_two(s);
} }
TableCreatorBase* tableCreator3(Session& s) const table_creator_base * table_creator_3(session& s) const
{ {
return new TableCreator3(s); return new table_creator_three(s);
} }
std::string toDateTime(std::string const &datdt_string) const std::string to_date_time(std::string const &datdt_string) const
{ {
return "timestamptz(\'" + datdt_string + "\')"; return "timestamptz(\'" + datdt_string + "\')";
} }
...@@ -109,16 +109,16 @@ int main(int argc, char** argv) ...@@ -109,16 +109,16 @@ int main(int argc, char** argv)
} }
try try
{ {
TestContext tc(backEnd, connectString); test_context tc(backEnd, connectString);
CommonTests tests(tc); common_tests tests(tc);
tests.run(); tests.run();
} }
catch (SOCI::ODBCSOCIError const & e) catch (SOCI::odbc_soci_error const & e)
{ {
std::cout << "ODBC Error Code: " << e.odbcErrorCode() << std::endl std::cout << "ODBC Error Code: " << e.odbc_error_code() << std::endl
<< "Native Error Code: " << e.nativeErrorCode() << std::endl << "Native Error Code: " << e.native_error_code() << std::endl
<< "SOCI Message: " << e.what() << std::endl << "SOCI Message: " << e.what() << std::endl
<< "ODBC Message: " << e.odbcErrorMessage() << std::endl; << "ODBC Message: " << e.odbc_error_message() << std::endl;
} }
catch (std::exception const & e) catch (std::exception const & e)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment