diff options
author | Mark Spruiell <mes@zeroc.com> | 2010-05-25 10:41:30 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2010-05-25 10:41:30 -0700 |
commit | ff15aebd76de59b3ac8d34ecccaf3cbe4a5df01b (patch) | |
tree | 3fd2921fac9acf7751b390401767bb587dacab89 /cpp/test/Ice/stream/Client.cpp | |
parent | updating CHANGES for bug 4723 (diff) | |
download | ice-ff15aebd76de59b3ac8d34ecccaf3cbe4a5df01b.tar.bz2 ice-ff15aebd76de59b3ac8d34ecccaf3cbe4a5df01b.tar.xz ice-ff15aebd76de59b3ac8d34ecccaf3cbe4a5df01b.zip |
bug 4758 - bogus C++ streaming code for nested types
Diffstat (limited to 'cpp/test/Ice/stream/Client.cpp')
-rwxr-xr-x | cpp/test/Ice/stream/Client.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/cpp/test/Ice/stream/Client.cpp b/cpp/test/Ice/stream/Client.cpp index 7f4952be9cc..5519d9eca49 100755 --- a/cpp/test/Ice/stream/Client.cpp +++ b/cpp/test/Ice/stream/Client.cpp @@ -1023,6 +1023,68 @@ run(int argc, char** argv, const Ice::CommunicatorPtr& communicator) } } + { + out = Ice::createOutputStream(communicator); + out->write(Test2::Sub2::nestedEnum4); + out->finished(data); + in = Ice::createInputStream(communicator, data); + Test2::Sub2::NestedEnum2 e; + in->read(e); + test(e == Test2::Sub2::nestedEnum4); + } + + { + out = Ice::createOutputStream(communicator); + Test2::Sub2::NestedStruct2 s; + s.bo = true; + s.by = 1; + s.sh = 2; + s.i = 3; + s.l = 4; + s.f = 5.0; + s.d = 6.0; + s.str = "7"; + s.e = Test2::Sub2::nestedEnum5; + out->write(s); + out->finished(data); + in = Ice::createInputStream(communicator, data); + Test2::Sub2::NestedStruct2 s2; + in->read(s2); + test(s2 == s); + } + + { + out = Ice::createOutputStream(communicator); + Test2::Sub2::NestedClassStruct2Ptr s = new Test2::Sub2::NestedClassStruct2(); + s->i = 10; + out->write(s); + out->finished(data); + in = Ice::createInputStream(communicator, data); + Test2::Sub2::NestedClassStruct2Ptr s2 = new Test2::Sub2::NestedClassStruct2(); + in->read(s2); + test(s2->i == s->i); + } + + { + out = Ice::createOutputStream(communicator); + Test2::Sub2::NestedException2 ex; + ex.str = "str"; + + out->write(ex); + out->finished(data); + + in = Ice::createInputStream(communicator, data); + try + { + in->throwException(); + test(false); + } + catch(const Test2::Sub2::NestedException2& ex1) + { + test(ex1.str == ex.str); + } + } + cout << "ok" << endl; #endif |