diff options
Diffstat (limited to 'cpp/test/Ice/operations/TwowaysAMI.cpp')
-rw-r--r-- | cpp/test/Ice/operations/TwowaysAMI.cpp | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index 8ec3c58a02f..f2809dda31e 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -757,6 +757,40 @@ public: typedef IceUtil::Handle<AMI_MyClass_opStringMyEnumDI> AMI_MyClass_opStringMyEnumDIPtr; +class AMI_MyClass_opMyStructMyEnumDI : public Test::AMI_MyClass_opMyStructMyEnumD, public CallbackBase +{ +public: + + virtual void ice_response(const ::Test::MyStructMyEnumD& ro, const ::Test::MyStructMyEnumD& _do) + { + Test::MyStruct s11 = { 1, 1 }; + Test::MyStruct s12 = { 1, 2 }; + Test::MyStructMyEnumD di1; + di1[s11] = Test::enum1; + di1[s12] = Test::enum2; + test(_do == di1); + Test::MyStruct s22 = { 2, 2 }; + Test::MyStruct s23 = { 2, 3 }; + test(ro.size() == 4); + test(ro.find(s11) != ro.end()); + test(ro.find(s11)->second == Test::enum1); + test(ro.find(s12) != ro.end()); + test(ro.find(s12)->second == Test::enum2); + test(ro.find(s22) != ro.end()); + test(ro.find(s22)->second == Test::enum3); + test(ro.find(s23) != ro.end()); + test(ro.find(s23)->second == Test::enum2); + called(); + } + + virtual void ice_exception(const ::Ice::Exception&) + { + test(false); + } +}; + +typedef IceUtil::Handle<AMI_MyClass_opMyStructMyEnumDI> AMI_MyClass_opMyStructMyEnumDIPtr; + class AMI_MyClass_opIntSI : public Test::AMI_MyClass_opIntS, public CallbackBase { public: @@ -1211,9 +1245,28 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) } { + Test::MyStruct s11 = { 1, 1 }; + Test::MyStruct s12 = { 1, 2 }; + Test::MyStructMyEnumD di1; + di1[s11] = Test::enum1; + di1[s12] = Test::enum2; + + Test::MyStruct s22 = { 2, 2 }; + Test::MyStruct s23 = { 2, 3 }; + Test::MyStructMyEnumD di2; + di2[s11] = Test::enum1; + di2[s22] = Test::enum3; + di2[s23] = Test::enum2; + + AMI_MyClass_opMyStructMyEnumDIPtr cb = new AMI_MyClass_opMyStructMyEnumDI; + p->opMyStructMyEnumD_async(cb, di1, di2); + test(cb->check()); + } + + { const int lengths[] = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 }; - for(int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) + for(unsigned int l = 0; l != sizeof(lengths) / sizeof(*lengths); ++l) { Test::IntS s; for(int i = 0; i < lengths[l]; ++i) |