From 2a8f6db525ba7f400c170cdd6321dcb20c2d24e3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Dec 2011 11:50:32 +0200 Subject: Test SQL Server long data in container --- mssql/types/test.hxx | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'mssql/types/test.hxx') diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 8cd689b..a0d261e 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -298,7 +298,6 @@ struct object } }; - // Test long NULL data. // #pragma db object @@ -322,4 +321,42 @@ struct long_null } }; +// Test long data in containers, in particular column re-arrangement. +// +#pragma db value +struct long_comp +{ + long_comp () {} + long_comp (std::string s, unsigned int n): str (s), num (n) {} + + #pragma db type ("VARCHAR(max)") + std::string str; + + unsigned int num; + + bool + operator== (const long_comp& y) const + { + return str == y.str && num == y.num; + } +}; + +#pragma db object +struct long_cont +{ + long_cont () {} + long_cont (unsigned int id): id_ (id) {} + + #pragma db id + unsigned int id_; + + std::vector v; + + bool + operator== (const long_cont& y) const + { + return id_ == y.id_ && v == y.v; + } +}; + #endif // TEST_HXX -- cgit v1.1