diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-01-27 14:28:02 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-01-27 14:28:02 +0100 |
commit | 798aac2c962c569ab04b7025b39b26065f3b156f (patch) | |
tree | 679548db044f251efffabab11d222c24b534d84a /cpp/test/Ice/udp/AllTests.cpp | |
parent | 3.3.1 update (diff) | |
download | ice-798aac2c962c569ab04b7025b39b26065f3b156f.tar.bz2 ice-798aac2c962c569ab04b7025b39b26065f3b156f.tar.xz ice-798aac2c962c569ab04b7025b39b26065f3b156f.zip |
Fixed bug 3672 - test/Ice/udp memory limit exception
Diffstat (limited to 'cpp/test/Ice/udp/AllTests.cpp')
-rw-r--r-- | cpp/test/Ice/udp/AllTests.cpp | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/cpp/test/Ice/udp/AllTests.cpp b/cpp/test/Ice/udp/AllTests.cpp index 19b79b0c2c2..2965004ec56 100644 --- a/cpp/test/Ice/udp/AllTests.cpp +++ b/cpp/test/Ice/udp/AllTests.cpp @@ -80,35 +80,43 @@ allTests(const CommunicatorPtr& communicator) bool ret = replyI->waitReply(3, IceUtil::Time::seconds(2)); test(ret == true); - Test::ByteSeq seq; - try + if(communicator->getProperties()->getPropertyAsInt("Ice.Override.Compress") == 0) { - seq.resize(1024); - while(true) + // + // Only run this test if compression is disabled, the test expect fixed message size + // to be sent over the wire. + // + + Test::ByteSeq seq; + try + { + seq.resize(1024); + while(true) + { + seq.resize(seq.size() * 2 + 10); + replyI->reset(); + obj->sendByteSeq(seq, reply); + replyI->waitReply(1, IceUtil::Time::seconds(10)); + } + } + catch(const DatagramLimitException&) + { + test(seq.size() > 16384); + } + + communicator->getProperties()->setProperty("Ice.UDP.SndSize", "64000"); + seq.resize(50000); + try { - seq.resize(seq.size() * 2 + 10); replyI->reset(); obj->sendByteSeq(seq, reply); - replyI->waitReply(1, IceUtil::Time::seconds(10)); + test(!replyI->waitReply(1, IceUtil::Time::milliSeconds(500))); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + test(false); } - } - catch(const DatagramLimitException&) - { - test(seq.size() > 16384); - } - - communicator->getProperties()->setProperty("Ice.UDP.SndSize", "64000"); - seq.resize(50000); - try - { - replyI->reset(); - obj->sendByteSeq(seq, reply); - test(!replyI->waitReply(1, IceUtil::Time::milliSeconds(500))); - } - catch(const Ice::LocalException& ex) - { - cerr << ex << endl; - test(false); } cout << "ok" << endl; |