Buffer<> swap miss ownMem #1964

This commit is contained in:
Alex Fabijanic 2017-10-30 15:23:54 -05:00
parent 59e1a11ec6
commit 4bd692ca38
2 changed files with 6 additions and 0 deletions

View File

@ -257,6 +257,7 @@ public:
swap(_ptr, other._ptr);
swap(_capacity, other._capacity);
swap(_used, other._used);
swap(_ownMem, other._ownMem);
}
bool operator == (const Buffer& other) const

View File

@ -348,6 +348,11 @@ void CoreTest::testBuffer()
k.append('d');
assert (k.size() == 15);
assert ( !std::memcmp(k.begin(), "hellohelloworld", k.size()) );
char my[16];
Poco::Buffer<char> buffer(16);
Poco::Buffer<char> wrapper(my, sizeof(my));
buffer.swap(wrapper);
}