revise ODBC Unicode string functions

http://support.microsoft.com/kb/294169
added Buffer::size/capacityBytes returning length of buffer in bytes
only windows Unicode ODBC tested
reverting the SF #506 fix (non-conforming driver, causes problems with
other ODBC drivers)
This commit is contained in:
Aleksandar Fabijanic
2012-12-15 13:47:22 -06:00
parent e4db0abc68
commit 031302469f
7 changed files with 67 additions and 61 deletions

View File

@@ -128,10 +128,10 @@ void CoreTest::testFixedLength()
assert (sizeof(Poco::UInt16) == 2);
assert (sizeof(Poco::Int32) == 4);
assert (sizeof(Poco::UInt32) == 4);
#if defined(POCO_HAVE_INT64)
#if defined(POCO_HAVE_INT64)
assert (sizeof(Poco::Int64) == 8);
assert (sizeof(Poco::UInt64) == 8);
#endif
#endif
assert (sizeof(Poco::IntPtr) == sizeof(void*));
assert (sizeof(Poco::UIntPtr) == sizeof(void*));
}
@@ -201,7 +201,9 @@ void CoreTest::testBuffer()
std::size_t s = 10;
Buffer<int> b(s);
assert (b.size() == s);
assert (b.sizeBytes() == s * sizeof(int));
assert (b.capacity() == s);
assert (b.capacityBytes() == s * sizeof(int));
std::vector<int> v;
for (int i = 0; i < s; ++i)
v.push_back(i);