diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-03-24 11:45:18 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-03-24 11:45:18 +0100 |
commit | 06a08ecf28e205277336a97a6173db7ccbed1adc (patch) | |
tree | a369a5044a63f8cdba9e7c0a461e24ae344486b4 /cpp/test/Ice/operations | |
parent | Merge branch 'R3_3_branch' (diff) | |
parent | Bug 3924: slice2py missing from VC60 installer (diff) | |
download | ice-06a08ecf28e205277336a97a6173db7ccbed1adc.tar.bz2 ice-06a08ecf28e205277336a97a6173db7ccbed1adc.tar.xz ice-06a08ecf28e205277336a97a6173db7ccbed1adc.zip |
Merge commit 'origin/R3_3_branch'
Conflicts:
CHANGES
cpp/demo/Freeze/backup/.depend
cpp/demo/Freeze/bench/.depend
cpp/demo/Freeze/casino/.depend
cpp/demo/Freeze/customEvictor/.depend
cpp/demo/Freeze/library/.depend
cpp/demo/Freeze/phonebook/.depend
cpp/demo/Freeze/transform/.depend
cpp/demo/Glacier2/callback/.depend
cpp/demo/Glacier2/chat/.depend
cpp/demo/Ice/async/.depend
cpp/demo/Ice/bidir/.depend
cpp/demo/Ice/callback/.depend
cpp/demo/Ice/converter/.depend
cpp/demo/Ice/hello/.depend
cpp/demo/Ice/invoke/.depend
cpp/demo/Ice/latency/.depend
cpp/demo/Ice/minimal/.depend
cpp/demo/Ice/multicast/.depend
cpp/demo/Ice/nested/.depend
cpp/demo/Ice/nrvo/.depend
cpp/demo/Ice/session/.depend
cpp/demo/Ice/throughput/.depend
cpp/demo/Ice/value/.depend
cpp/demo/IceBox/hello/.depend
cpp/demo/IceGrid/allocate/.depend
cpp/demo/IceGrid/icebox/.depend
cpp/demo/IceGrid/replication/.depend
cpp/demo/IceGrid/sessionActivation/.depend
cpp/demo/IceGrid/simple/.depend
cpp/demo/IceStorm/clock/.depend
cpp/demo/IceStorm/counter/.depend
cpp/demo/IceStorm/replicated/.depend
cpp/demo/IceStorm/replicated2/.depend
cpp/demo/book/freeze_filesystem/.depend
cpp/demo/book/lifecycle/.depend
cpp/demo/book/printer/.depend
cpp/demo/book/simple_filesystem/.depend
cpp/src/Freeze/.depend
cpp/src/FreezeScript/.depend
cpp/src/Ice/.depend
cpp/src/Ice/UdpTransceiver.cpp
cpp/src/Ice/UdpTransceiver.h
cpp/src/IceBox/.depend
cpp/src/IceGrid/.depend
cpp/src/IceGridLib/.depend
cpp/src/IcePatch2/.depend
cpp/src/IceStorm/.depend
cpp/src/slice2freeze/.depend
cpp/test/Freeze/complex/.depend
cpp/test/Freeze/dbmap/.depend
cpp/test/Freeze/evictor/.depend
cpp/test/Freeze/oldevictor/.depend
cpp/test/FreezeScript/dbmap/.depend
cpp/test/FreezeScript/evictor/.depend
cpp/test/Glacier2/attack/.depend
cpp/test/Glacier2/dynamicFiltering/.depend
cpp/test/Glacier2/router/.depend
cpp/test/Glacier2/sessionControl/.depend
cpp/test/Glacier2/ssl/.depend
cpp/test/Glacier2/staticFiltering/.depend
cpp/test/Ice/adapterDeactivation/.depend
cpp/test/Ice/background/.depend
cpp/test/Ice/binding/.depend
cpp/test/Ice/checksum/.depend
cpp/test/Ice/checksum/server/.depend
cpp/test/Ice/custom/.depend
cpp/test/Ice/exceptions/.depend
cpp/test/Ice/facets/.depend
cpp/test/Ice/faultTolerance/.depend
cpp/test/Ice/gc/.depend
cpp/test/Ice/hold/.depend
cpp/test/Ice/inheritance/.depend
cpp/test/Ice/interceptor/.depend
cpp/test/Ice/location/.depend
cpp/test/Ice/objects/.depend
cpp/test/Ice/operations/.depend
cpp/test/Ice/proxy/.depend
cpp/test/Ice/retry/.depend
cpp/test/Ice/servantLocator/.depend
cpp/test/Ice/slicing/exceptions/.depend
cpp/test/Ice/slicing/objects/.depend
cpp/test/Ice/stream/.depend
cpp/test/Ice/stringConverter/.depend
cpp/test/Ice/timeout/.depend
cpp/test/Ice/udp/.depend
cpp/test/IceBox/configuration/.depend
cpp/test/IceGrid/activation/.depend
cpp/test/IceGrid/allocation/.depend
cpp/test/IceGrid/deployer/.depend
cpp/test/IceGrid/distribution/.depend
cpp/test/IceGrid/replicaGroup/.depend
cpp/test/IceGrid/replication/.depend
cpp/test/IceGrid/session/.depend
cpp/test/IceGrid/simple/.depend
cpp/test/IceGrid/update/.depend
cpp/test/IceSSL/configuration/.depend
cpp/test/IceStorm/federation/.depend
cpp/test/IceStorm/federation2/.depend
cpp/test/IceStorm/rep1/.depend
cpp/test/IceStorm/repgrid/.depend
cpp/test/IceStorm/repstress/.depend
cpp/test/IceStorm/single/.depend
cpp/test/IceStorm/stress/.depend
cpp/test/Slice/keyword/.depend
cs/src/Ice/Instance.cs
cs/src/IceSSL/ConnectorI.cs
java/demo/book/simple_filesystem/Filesystem/DirectoryI.java
java/demo/book/simple_filesystem/Filesystem/FileI.java
java/src/IceInternal/TcpConnector.java
java/src/IceSSL/ConnectorI.java
py/modules/IcePy/.depend
rb/src/IceRuby/.depend
Diffstat (limited to 'cpp/test/Ice/operations')
-rw-r--r-- | cpp/test/Ice/operations/Makefile | 8 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Oneways.cpp | 3 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Test.ice | 10 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMD.ice | 10 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMDI.cpp | 12 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMDI.h | 4 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestI.cpp | 12 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestI.h | 4 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Twoways.cpp | 27 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TwowaysAMI.cpp | 55 |
10 files changed, 137 insertions, 8 deletions
diff --git a/cpp/test/Ice/operations/Makefile b/cpp/test/Ice/operations/Makefile index 241830419fd..d3b7650d124 100644 --- a/cpp/test/Ice/operations/Makefile +++ b/cpp/test/Ice/operations/Makefile @@ -56,18 +56,18 @@ CPPFLAGS := -I. -I../../include $(CPPFLAGS) $(CLIENT): $(COBJS) rm -f $@ - $(CXX) $(LDFLAGS) $(STATICLIBSTDFLAG) -o $@ $(COBJS) $(LIBS) + $(CXX) $(LDFLAGS) -o $@ $(COBJS) $(LIBS) $(SERVER): $(SOBJS) rm -f $@ - $(CXX) $(LDFLAGS) $(STATICLIBSTDFLAG) -o $@ $(SOBJS) $(LIBS) + $(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(CXX) $(LDFLAGS) $(STATICLIBSTDFLAG) -o $@ $(SAMDOBJS) $(LIBS) + $(CXX) $(LDFLAGS) -o $@ $(SAMDOBJS) $(LIBS) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(CXX) $(LDFLAGS) $(STATICLIBSTDFLAG) -o $@ $(COLOBJS) $(LIBS) + $(CXX) $(LDFLAGS) -o $@ $(COLOBJS) $(LIBS) include .depend diff --git a/cpp/test/Ice/operations/Oneways.cpp b/cpp/test/Ice/operations/Oneways.cpp index 84f1f4cf826..9e385e31ae6 100644 --- a/cpp/test/Ice/operations/Oneways.cpp +++ b/cpp/test/Ice/operations/Oneways.cpp @@ -24,11 +24,10 @@ oneways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& proxy) { Ice::Byte b; - Ice::Byte r; try { - r = p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b); + p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b); test(false); } catch(const Ice::TwowayOnlyException&) diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice index 447b3c8b17b..ea771c12ff3 100644 --- a/cpp/test/Ice/operations/Test.ice +++ b/cpp/test/Ice/operations/Test.ice @@ -60,11 +60,18 @@ sequence<MyClassS> MyClassSS; sequence<StringSS> StringSSS; +struct MyStruct +{ + int i; + int j; +}; + dictionary<byte, bool> ByteBoolD; dictionary<short, int> ShortIntD; dictionary<long, float> LongFloatD; dictionary<string, string> StringStringD; dictionary<string, MyEnum> StringMyEnumD; +dictionary<MyStruct, MyEnum> MyStructMyEnumD; ["ami"] class MyClass { @@ -143,6 +150,9 @@ dictionary<string, MyEnum> StringMyEnumD; StringMyEnumD opStringMyEnumD(StringMyEnumD p1, StringMyEnumD p2, out StringMyEnumD p3); + MyStructMyEnumD opMyStructMyEnumD(MyStructMyEnumD p1, MyStructMyEnumD p2, + out MyStructMyEnumD p3); + IntS opIntS(IntS s); void opByteSOneway(ByteS s); diff --git a/cpp/test/Ice/operations/TestAMD.ice b/cpp/test/Ice/operations/TestAMD.ice index 384a7d3c4e4..a44c923e1fa 100644 --- a/cpp/test/Ice/operations/TestAMD.ice +++ b/cpp/test/Ice/operations/TestAMD.ice @@ -60,11 +60,18 @@ sequence<MyClassS> MyClassSS; sequence<StringSS> StringSSS; +struct MyStruct +{ + int i; + int j; +}; + dictionary<byte, bool> ByteBoolD; dictionary<short, int> ShortIntD; dictionary<long, float> LongFloatD; dictionary<string, string> StringStringD; dictionary<string, MyEnum> StringMyEnumD; +dictionary<MyStruct, MyEnum> MyStructMyEnumD; ["ami", "amd"] class MyClass { @@ -143,6 +150,9 @@ dictionary<string, MyEnum> StringMyEnumD; StringMyEnumD opStringMyEnumD(StringMyEnumD p1, StringMyEnumD p2, out StringMyEnumD p3); + MyStructMyEnumD opMyStructMyEnumD(MyStructMyEnumD p1, MyStructMyEnumD p2, + out MyStructMyEnumD p3); + IntS opIntS(IntS s); void opByteSOneway(ByteS s); diff --git a/cpp/test/Ice/operations/TestAMDI.cpp b/cpp/test/Ice/operations/TestAMDI.cpp index f79c036a9e1..fd56b7f596a 100644 --- a/cpp/test/Ice/operations/TestAMDI.cpp +++ b/cpp/test/Ice/operations/TestAMDI.cpp @@ -361,6 +361,18 @@ MyDerivedClassI::opStringMyEnumD_async(const Test::AMD_MyClass_opStringMyEnumDPt } void +MyDerivedClassI::opMyStructMyEnumD_async(const Test::AMD_MyClass_opMyStructMyEnumDPtr& cb, + const Test::MyStructMyEnumD& p1, + const Test::MyStructMyEnumD& p2, + const Ice::Current&) +{ + Test::MyStructMyEnumD p3 = p1; + Test::MyStructMyEnumD r = p1; + std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end())); + cb->ice_response(r, p3); +} + +void MyDerivedClassI::opIntS_async(const Test::AMD_MyClass_opIntSPtr& cb, const Test::IntS& s, const Ice::Current&) { Test::IntS r; diff --git a/cpp/test/Ice/operations/TestAMDI.h b/cpp/test/Ice/operations/TestAMDI.h index 66221ddbede..efbcf319e7e 100644 --- a/cpp/test/Ice/operations/TestAMDI.h +++ b/cpp/test/Ice/operations/TestAMDI.h @@ -119,6 +119,10 @@ public: const Test::StringMyEnumD&, const Test::StringMyEnumD&, const Ice::Current&); + virtual void opMyStructMyEnumD_async(const Test::AMD_MyClass_opMyStructMyEnumDPtr&, + const Test::MyStructMyEnumD&, const Test::MyStructMyEnumD&, + const Ice::Current&); + virtual void opIntS_async(const Test::AMD_MyClass_opIntSPtr&, const Test::IntS&, const Ice::Current&); virtual void opByteSOneway_async(const Test::AMD_MyClass_opByteSOnewayPtr&, const Test::ByteS&, diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index a12e1ee1f38..09c9ab409c1 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -336,6 +336,18 @@ MyDerivedClassI::opStringMyEnumD(const Test::StringMyEnumD& p1, return r; } +Test::MyStructMyEnumD +MyDerivedClassI::opMyStructMyEnumD(const Test::MyStructMyEnumD& p1, + const Test::MyStructMyEnumD& p2, + Test::MyStructMyEnumD& p3, + const Ice::Current&) +{ + p3 = p1; + Test::MyStructMyEnumD r = p1; + std::set_union(p1.begin(), p1.end(), p2.begin(), p2.end(), std::inserter(r, r.end())); + return r; +} + Test::IntS MyDerivedClassI::opIntS(const Test::IntS& s, const Ice::Current&) { diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index 9aba20231aa..fc374a02c17 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -144,6 +144,10 @@ public: Test::StringMyEnumD&, const Ice::Current&); + virtual Test::MyStructMyEnumD opMyStructMyEnumD(const Test::MyStructMyEnumD&, const Test::MyStructMyEnumD&, + Test::MyStructMyEnumD&, + const Ice::Current&); + virtual Test::IntS opIntS(const Test::IntS&, const Ice::Current&); virtual void opByteSOneway(const Test::ByteS&, const Ice::Current&); diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index d91636c0458..ed6945dc735 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -627,9 +627,34 @@ twoways(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; + + Test::MyStructMyEnumD _do; + Test::MyStructMyEnumD ro = p->opMyStructMyEnumD(di1, di2, _do); + + test(_do == di1); + test(ro.size() == 4); + test(ro[s11] == Test::enum1); + test(ro[s12] == Test::enum2); + test(ro[s22] == Test::enum3); + test(ro[s23] == Test::enum2); + } + + { 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) 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) |