diff options
Diffstat (limited to 'libdbpp/testCore.cpp')
-rw-r--r-- | libdbpp/testCore.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libdbpp/testCore.cpp b/libdbpp/testCore.cpp index 08b0e99..3c71daa 100644 --- a/libdbpp/testCore.cpp +++ b/libdbpp/testCore.cpp @@ -3,6 +3,7 @@ #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/test/test_tools.hpp> #include <boost/utility/enable_if.hpp> +#include <compileTimeFormatter.h> namespace DB { @@ -62,6 +63,20 @@ TestCore::assertColumnValueHelper(DB::SelectCommand & sel, unsigned int col, con sel[col].apply(a); } +bool +operator==(const DB::Blob a, const DB::Blob b) +{ + return a.len == b.len && memcmp(a.data, b.data, a.len) == 0; +} + +AdHocFormatter(BlobDbg, "Blob[length=%?, addr=%?]"); +std::ostream & +operator<<(std::ostream & s, const DB::Blob b) +{ + BlobDbg::write(s, b.len, b.data); + return s; +} + template void TestCore::assertScalarValueHelper<bool>(SelectCommand &, const bool &) const; template void TestCore::assertScalarValueHelper<int64_t>(SelectCommand &, const int64_t &) const; template void TestCore::assertScalarValueHelper<int>(SelectCommand &, const int &) const; @@ -69,6 +84,7 @@ template void TestCore::assertScalarValueHelper<double>(SelectCommand &, const d template void TestCore::assertScalarValueHelper<std::string>(SelectCommand &, const std::string &) const; template void TestCore::assertScalarValueHelper<boost::posix_time::ptime>(SelectCommand &, const boost::posix_time::ptime &) const; template void TestCore::assertScalarValueHelper<boost::posix_time::time_duration>(SelectCommand &, const boost::posix_time::time_duration &) const; +template void TestCore::assertScalarValueHelper<DB::Blob>(SelectCommand &, const DB::Blob &) const; template void TestCore::assertColumnValueHelper<bool>(SelectCommand &, unsigned int, const bool &) const; template void TestCore::assertColumnValueHelper<int>(SelectCommand &, unsigned int, const int &) const; @@ -77,6 +93,7 @@ template void TestCore::assertColumnValueHelper<double>(SelectCommand &, unsigne template void TestCore::assertColumnValueHelper<std::string>(SelectCommand &, unsigned int, const std::string &) const; template void TestCore::assertColumnValueHelper<boost::posix_time::ptime>(SelectCommand &, unsigned int, const boost::posix_time::ptime &) const; template void TestCore::assertColumnValueHelper<boost::posix_time::time_duration>(SelectCommand &, unsigned int, const boost::posix_time::time_duration &) const; +template void TestCore::assertColumnValueHelper<DB::Blob>(SelectCommand &, unsigned int, const DB::Blob &) const; } |