diff options
Diffstat (limited to 'mssql/types/test.hxx')
-rw-r--r-- | mssql/types/test.hxx | 39 |
1 files changed, 38 insertions, 1 deletions
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<long_comp> v; + + bool + operator== (const long_cont& y) const + { + return id_ == y.id_ && v == y.v; + } +}; + #endif // TEST_HXX |