summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slicer/db/Jamfile.jam20
-rw-r--r--slicer/db/testConversions.cpp23
-rw-r--r--slicer/db/testInsert.cpp2
-rw-r--r--slicer/db/testModels.ice (renamed from slicer/test/db.ice)0
-rw-r--r--slicer/db/testPatch.cpp2
-rw-r--r--slicer/db/testSelect.cpp2
-rw-r--r--slicer/db/testUpdate.cpp2
-rw-r--r--slicer/test/conversions.cpp16
-rw-r--r--slicer/test/preprocessor.cpp1
9 files changed, 46 insertions, 22 deletions
diff --git a/slicer/db/Jamfile.jam b/slicer/db/Jamfile.jam
index ad15a6c..b8e45cc 100644
--- a/slicer/db/Jamfile.jam
+++ b/slicer/db/Jamfile.jam
@@ -13,7 +13,7 @@ lib IceUtil ;
lib slicer-db :
[ glob *.cpp : test*.cpp ]
- [ glob *.ice ]
+ [ glob *.ice : test*.ice ]
:
<include>..
<library>pthread
@@ -30,6 +30,16 @@ lib slicer-db :
path-constant me : . ;
+lib testCommon :
+ [ glob testConversions.cpp test*.ice ]
+ :
+ <dependency>../tool//slicer
+ <slicer>yes
+ <slicerbin>../tool//slicer
+ <implicit-dependency>../test//types
+ <library>../test//types
+ ;
+
run testSelect.cpp
: : :
<define>BOOST_TEST_DYN_LINK
@@ -43,6 +53,8 @@ run testSelect.cpp
<library>../test//common
<library>../slicer//slicer
<implicit-dependency>../slicer//slicer
+ <library>testCommon
+ <implicit-dependency>testCommon
<include>..
<dependency>slicer.sql
:
@@ -61,6 +73,8 @@ run testInsert.cpp
<library>../test//common
<library>../slicer//slicer
<implicit-dependency>../slicer//slicer
+ <library>testCommon
+ <implicit-dependency>testCommon
<include>..
<dependency>slicer.sql
:
@@ -79,6 +93,8 @@ run testPatch.cpp
<library>../test//common
<library>../slicer//slicer
<implicit-dependency>../slicer//slicer
+ <library>testCommon
+ <implicit-dependency>testCommon
<include>..
<dependency>slicer.sql
;
@@ -96,6 +112,8 @@ run testUpdate.cpp
<library>../test//common
<library>../slicer//slicer
<implicit-dependency>../slicer//slicer
+ <library>testCommon
+ <implicit-dependency>testCommon
<include>..
<dependency>slicer.sql
:
diff --git a/slicer/db/testConversions.cpp b/slicer/db/testConversions.cpp
new file mode 100644
index 0000000..893c6ae
--- /dev/null
+++ b/slicer/db/testConversions.cpp
@@ -0,0 +1,23 @@
+#include <testModels.h>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/numeric/conversion/cast.hpp>
+#include <visibility.h>
+
+#define SHORT(x) boost::numeric_cast< ::Ice::Short , int64_t >(x)
+
+namespace Slicer {
+ DLL_PUBLIC
+ ::TestDatabase::TimespanPtr
+ timedurationToTimespan(const boost::posix_time::time_duration & td)
+ {
+ return new ::TestDatabase::Timespan(SHORT(td.hours() / 24), SHORT(td.hours() % 24), SHORT(td.minutes()), SHORT(td.seconds()));
+ }
+
+ DLL_PUBLIC
+ boost::posix_time::time_duration
+ timespanToTimeduration(const ::TestDatabase::TimespanPtr & ts)
+ {
+ return boost::posix_time::time_duration((ts->days * 24) + ts->hours, ts->minutes, ts->seconds);
+ }
+}
+
diff --git a/slicer/db/testInsert.cpp b/slicer/db/testInsert.cpp
index 34a236f..fec0ed7 100644
--- a/slicer/db/testInsert.cpp
+++ b/slicer/db/testInsert.cpp
@@ -8,7 +8,7 @@
#include "sqlSelectDeserializer.h"
#include <types.h>
#include <common.h>
-#include <db.h>
+#include <testModels.h>
// LCOV_EXCL_START
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::DateTime);
diff --git a/slicer/test/db.ice b/slicer/db/testModels.ice
index a586503..a586503 100644
--- a/slicer/test/db.ice
+++ b/slicer/db/testModels.ice
diff --git a/slicer/db/testPatch.cpp b/slicer/db/testPatch.cpp
index 333b806..012f2f5 100644
--- a/slicer/db/testPatch.cpp
+++ b/slicer/db/testPatch.cpp
@@ -8,7 +8,7 @@
#include "sqlSelectDeserializer.h"
#include <types.h>
#include <common.h>
-#include <db.h>
+#include <testModels.h>
// LCOV_EXCL_START
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::DateTime);
diff --git a/slicer/db/testSelect.cpp b/slicer/db/testSelect.cpp
index 5428f29..e50047a 100644
--- a/slicer/db/testSelect.cpp
+++ b/slicer/db/testSelect.cpp
@@ -7,7 +7,7 @@
#include "sqlSelectDeserializer.h"
#include <types.h>
#include <common.h>
-#include <db.h>
+#include <testModels.h>
#include <sqlExceptions.h>
class StandardMockDatabase : public PQ::Mock {
diff --git a/slicer/db/testUpdate.cpp b/slicer/db/testUpdate.cpp
index 624149d..29115e3 100644
--- a/slicer/db/testUpdate.cpp
+++ b/slicer/db/testUpdate.cpp
@@ -9,7 +9,7 @@
#include "sqlUpdateSerializer.h"
#include <types.h>
#include <common.h>
-#include <db.h>
+#include <testModels.h>
#include <sqlExceptions.h>
class StandardMockDatabase : public PQ::Mock {
diff --git a/slicer/test/conversions.cpp b/slicer/test/conversions.cpp
index 9ac43e3..edeadac 100644
--- a/slicer/test/conversions.cpp
+++ b/slicer/test/conversions.cpp
@@ -1,7 +1,5 @@
#include "conversions.h"
#include <boost/numeric/conversion/cast.hpp>
-#include <visibility.h>
-#include <db.h>
#define SHORT(x) boost::numeric_cast< ::Ice::Short , int64_t >(x)
@@ -92,20 +90,6 @@ namespace Slicer {
}
DLL_PUBLIC
- ::TestDatabase::TimespanPtr
- timedurationToTimespan(const boost::posix_time::time_duration & td)
- {
- return new ::TestDatabase::Timespan(SHORT(td.hours() / 24), SHORT(td.hours() % 24), SHORT(td.minutes()), SHORT(td.seconds()));
- }
-
- DLL_PUBLIC
- boost::posix_time::time_duration
- timespanToTimeduration(const ::TestDatabase::TimespanPtr & ts)
- {
- return boost::posix_time::time_duration((ts->days * 24) + ts->hours, ts->minutes, ts->seconds);
- }
-
- DLL_PUBLIC
IceUtil::Optional<Ice::Int>
str2int(const std::string & s)
{
diff --git a/slicer/test/preprocessor.cpp b/slicer/test/preprocessor.cpp
index 7d81f5e..fbf692a 100644
--- a/slicer/test/preprocessor.cpp
+++ b/slicer/test/preprocessor.cpp
@@ -14,7 +14,6 @@ typedef std::map<std::string, unsigned int> ComponentsCount;
ComponentsCount COMPONENTS_IN_TEST_ICE = {
{ "classes.ice", 4 },
{ "collections.ice", 6 },
- { "db.ice", 4 },
{ "enums.ice", 2 },
{ "inheritance.ice", 12 },
{ "interfaces.ice", 0 },