Skip to content

Commit

Permalink
Merge pull request #63 from mloskot/odbc-tests
Browse files Browse the repository at this point in the history
Add missing ODBC tests to CMake configuration (issue #62)
  • Loading branch information
mloskot committed Feb 12, 2013
2 parents 2deef98 + cacc9d1 commit 20f1e3c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
12 changes: 12 additions & 0 deletions src/backends/odbc/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ soci_backend_test(
SOURCE test-odbc-access.cpp
CONNSTR "test-access.dsn")

soci_backend_test(
NAME mssql
BACKEND ODBC
SOURCE test-odbc-mssql.cpp
CONNSTR "test-mssql.dsn")

soci_backend_test(
NAME mysql
BACKEND ODBC
SOURCE test-odbc-mysql.cpp
CONNSTR "test-mysql.dsn")

soci_backend_test(
NAME postgresql
BACKEND ODBC
Expand Down
2 changes: 1 addition & 1 deletion src/backends/odbc/test/test-access.dsn
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ MaxBufferSize=2048
FIL=MS Access
DriverId=25
DefaultDir=.\
DBQ=.\soci.mdb
DBQ=.\soci_test.mdb
2 changes: 1 addition & 1 deletion src/backends/odbc/test/test-mssql.dsn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ODBC]
DRIVER=SQL Native Client
UID=David
DATABASE=socitest
DATABASE=soci_test
WSID=NANO
APP=Microsoft Data Access Components
Trusted_Connection=Yes
Expand Down
2 changes: 1 addition & 1 deletion src/backends/odbc/test/test-mysql.dsn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[ODBC]
DRIVER=MySQL ODBC 3.51 Driver
DATABASE=socitest
DATABASE=soci_test
USER=root
PORT=0
OPTION=0
3 changes: 1 addition & 2 deletions src/backends/odbc/test/test-odbc-mssql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ using namespace soci;
using namespace soci::tests;

std::string connectString;
backend_factory const &backEnd = odbc;

backend_factory const &backEnd = *soci::factory_odbc();

// DDL Creation objects for common tests
struct table_creator_one : public table_creator_base
Expand Down
13 changes: 9 additions & 4 deletions src/backends/odbc/test/test-odbc-mysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using namespace soci;
using namespace soci::tests;

std::string connectString;
backend_factory const &backEnd = odbc;
backend_factory const &backEnd = *soci::factory_odbc();

// DDL Creation objects for common tests
struct table_creator_one : public table_creator_base
Expand All @@ -45,7 +45,7 @@ struct table_creator_two : public table_creator_base

struct table_creator_three : public table_creator_base
{
table_creator_three(ession & sql)
table_creator_three(session & sql)
: table_creator_base(sql)
{
sql << "create table soci_test(name varchar(100) not null, "
Expand All @@ -69,12 +69,17 @@ class test_context : public test_context_base
return new table_creator_one(s);
}

table_creator_base * tableCreator2(session& s) const
table_creator_base * table_creator_2(session& s) const
{
return new table_creator_two(s);
}

table_creator_base * tableCreator3(session& s) const
table_creator_base * table_creator_3(session& s) const
{
return new table_creator_three(s);
}

table_creator_base * table_creator_4(session& s) const
{
return new table_creator_three(s);
}
Expand Down

0 comments on commit 20f1e3c

Please sign in to comment.