diff options
author | Kim van der Riet <kpvdr@apache.org> | 2012-08-03 12:13:32 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2012-08-03 12:13:32 +0000 |
commit | d43d1912b376322e27fdcda551a73f9ff5487972 (patch) | |
tree | ce493e10baa95f44be8beb5778ce51783463196d /cpp/src/tests/Uuid.cpp | |
parent | 04877fec0c6346edec67072d7f2d247740cf2af5 (diff) | |
download | qpid-python-d43d1912b376322e27fdcda551a73f9ff5487972.tar.gz |
QPID-3858: Updated branch - merged from trunk r.1368650
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1368910 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/Uuid.cpp')
-rw-r--r-- | cpp/src/tests/Uuid.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cpp/src/tests/Uuid.cpp b/cpp/src/tests/Uuid.cpp index f85a297adc..aa9580e25e 100644 --- a/cpp/src/tests/Uuid.cpp +++ b/cpp/src/tests/Uuid.cpp @@ -19,7 +19,6 @@ #include "qpid/framing/Uuid.h" #include "qpid/framing/Buffer.h" #include "qpid/types/Uuid.h" -#include "qpid/sys/alloca.h" #include "unit_test.h" @@ -52,6 +51,11 @@ boost::array<uint8_t, 16> sample = {{0x1b, 0x4e, 0x28, 0xba, 0x2f, 0xa1, 0x11, const string sampleStr("1b4e28ba-2fa1-11d2-883f-b9a761bde3fb"); const string zeroStr("00000000-0000-0000-0000-000000000000"); +QPID_AUTO_TEST_CASE(testUuidStr) { + Uuid uuid(sampleStr); + BOOST_CHECK(uuid == sample); +} + QPID_AUTO_TEST_CASE(testUuidIstream) { Uuid uuid; istringstream in(sampleStr); @@ -92,12 +96,12 @@ QPID_AUTO_TEST_CASE(testUuidIOstream) { } QPID_AUTO_TEST_CASE(testUuidEncodeDecode) { - char* buff = static_cast<char*>(::alloca(Uuid::size())); - Buffer wbuf(buff, Uuid::size()); + std::vector<char> buff(Uuid::size()); + Buffer wbuf(&buff[0], Uuid::size()); Uuid uuid(sample.c_array()); uuid.encode(wbuf); - Buffer rbuf(buff, Uuid::size()); + Buffer rbuf(&buff[0], Uuid::size()); Uuid decoded; decoded.decode(rbuf); BOOST_CHECK_EQUAL(string(sample.begin(), sample.end()), |