summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-05-24 11:25:18 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2020-05-24 11:25:18 +0100
commitf9d6f4d9699b759a62a88e279331b5dbb72e18e9 (patch)
treee2b4f54b53811694970119657c0245468bf6e38e
parentBlob should actually be implicitly constructible from a vector (diff)
downloadlibdbpp-f9d6f4d9699b759a62a88e279331b5dbb72e18e9.tar.bz2
libdbpp-f9d6f4d9699b759a62a88e279331b5dbb72e18e9.tar.xz
libdbpp-f9d6f4d9699b759a62a88e279331b5dbb72e18e9.zip
Add some test blob data to testcore
-rw-r--r--libdbpp/Jamfile.jam1
-rw-r--r--libdbpp/testCore.cpp8
-rw-r--r--libdbpp/testCore.h2
3 files changed, 10 insertions, 1 deletions
diff --git a/libdbpp/Jamfile.jam b/libdbpp/Jamfile.jam
index 6f9e780..a5b9a88 100644
--- a/libdbpp/Jamfile.jam
+++ b/libdbpp/Jamfile.jam
@@ -29,6 +29,7 @@ lib dbpptestcore :
:
<define>BOOST_TEST_DYN_LINK
<library>dbppcore
+ <library>adhocutil
<library>boost_utf
: :
<include>.
diff --git a/libdbpp/testCore.cpp b/libdbpp/testCore.cpp
index db18316..d29480b 100644
--- a/libdbpp/testCore.cpp
+++ b/libdbpp/testCore.cpp
@@ -3,13 +3,19 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/test/test_tools.hpp>
#include <compileTimeFormatter.h>
+#include <fileUtils.h>
namespace DB {
TestCore::TestCore() :
testString("Some C String"),
testDateTime(boost::posix_time::from_time_t(1430530593)),
- testInterval(boost::posix_time::time_duration(1, 2, 3))
+ testInterval(boost::posix_time::time_duration(1, 2, 3)),
+ testBlobData([](){
+ AdHoc::FileUtils::MemMap f("/proc/self/exe");
+ return std::vector<unsigned char>(f.sv<unsigned char>().begin(), f.sv<unsigned char>().end());
+ }()),
+ testBlob(testBlobData)
{
}
diff --git a/libdbpp/testCore.h b/libdbpp/testCore.h
index 285c4b7..06aedf0 100644
--- a/libdbpp/testCore.h
+++ b/libdbpp/testCore.h
@@ -19,6 +19,8 @@ class DLL_PUBLIC TestCore {
bool testBool { false };
boost::posix_time::ptime testDateTime;
boost::posix_time::time_duration testInterval;
+ std::vector<unsigned char> testBlobData;
+ DB::Blob testBlob;
template<typename T> void assertScalarValueHelper(SelectCommand & sel, const T & t) const;
template<typename T> void assertColumnValueHelper(SelectCommand & sel, unsigned int col, const T & t) const;