diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2015-03-23 12:34:52 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2015-03-23 12:34:52 -0230 |
commit | f505f9258d9bc793723122471d654322a2db19e9 (patch) | |
tree | 5671ac14c29b78420733445365a56bdcf0de20c9 /objective-c/test | |
parent | Some fixes to demoscripts to deal with directory renaming (diff) | |
download | ice-f505f9258d9bc793723122471d654322a2db19e9.tar.bz2 ice-f505f9258d9bc793723122471d654322a2db19e9.tar.xz ice-f505f9258d9bc793723122471d654322a2db19e9.zip |
ICE-6392 operations cross test with objc fails
Diffstat (limited to 'objective-c/test')
-rw-r--r-- | objective-c/test/Ice/operations/OperationsTest.ice | 42 | ||||
-rw-r--r-- | objective-c/test/Ice/operations/TestI.m | 66 | ||||
-rw-r--r-- | objective-c/test/Ice/operations/Twoways.m | 27 |
3 files changed, 128 insertions, 7 deletions
diff --git a/objective-c/test/Ice/operations/OperationsTest.ice b/objective-c/test/Ice/operations/OperationsTest.ice index 7f8a084184b..1014c86f54a 100644 --- a/objective-c/test/Ice/operations/OperationsTest.ice +++ b/objective-c/test/Ice/operations/OperationsTest.ice @@ -252,19 +252,31 @@ class MyClass MyEnumMyEnumSD opMyEnumMyEnumSD(MyEnumMyEnumSD p1, MyEnumMyEnumSD p2, out MyEnumMyEnumSD p3); - IntS opIntS(IntS s); + IntS opIntS(IntS s); - void opByteSOneway(ByteS s); + void opByteSOneway(ByteS s); - int opByteSOnewayCallCount(); + int opByteSOnewayCallCount(); - Ice::Context opContext(); + Ice::Context opContext(); - void opDoubleMarshaling(double p1, DoubleS p2); + void opDoubleMarshaling(double p1, DoubleS p2); - idempotent void opIdempotent(); + idempotent void opIdempotent(); - ["nonmutating"] idempotent void opNonmutating(); + ["nonmutating"] idempotent void opNonmutating(); + + byte opByte1(byte opByte1); + short opShort1(short opShort1); + int opInt1(int opInt1); + long opLong1(long opLong1); + float opFloat1(float opFloat1); + double opDouble1(double opDouble1); + string opString1(string opString1); + StringS opStringS1(StringS opStringS1); + ByteBoolD opByteBoolD1(ByteBoolD opByteBoolD1); + StringS opStringS2(StringS stringS); + ByteBoolD opByteBoolD2(ByteBoolD byteBoolD); // // Operations below are specific to Objective-C @@ -281,9 +293,25 @@ class MyClass void putNSNullStringMyEnumDict(StringMyEnumD d); }; +struct MyStruct1 +{ + string tesT; // Same name as the enclosing module + MyClass myClass; // Same name as an already defined class + string myStruct1; // Same name as the enclosing struct +}; + +class MyClass1 +{ + string tesT; // Same name as the enclosing module + MyClass myClass; // Same name as an already defined class + string myClass1; // Same name as the enclosing class +}; + class MyDerivedClass extends MyClass { void opDerived(); + MyClass1 opMyClass1(MyClass1 c); + MyStruct1 opMyStruct1(MyStruct1 c); }; }; diff --git a/objective-c/test/Ice/operations/TestI.m b/objective-c/test/Ice/operations/TestI.m index e04a68e8c37..a84fff8ad15 100644 --- a/objective-c/test/Ice/operations/TestI.m +++ b/objective-c/test/Ice/operations/TestI.m @@ -663,6 +663,72 @@ test([current mode] == ICENonmutating); } +-(ICEByte) opByte1:(ICEByte)p current:(ICECurrent*)current +{ + return p; +} + +-(ICEShort) opShort1:(ICEShort)p current:(ICECurrent*)current +{ + return p; +} + +-(ICEInt) opInt1:(ICEInt)p current:(ICECurrent*)current +{ + return p; +} + +-(ICELong) opLong1:(ICELong)p current:(ICECurrent*)current +{ + return p; +} + + +-(ICEFloat) opFloat1:(ICEFloat)p current:(ICECurrent*)current +{ + return p; +} + +-(ICEDouble) opDouble1:(ICEDouble)p current:(ICECurrent*)current +{ + return p; +} + +-(NSString*) opString1:(NSString*)p current:(ICECurrent*)current +{ + return p; +} + +-(TestOperationsStringS*) opStringS1:(TestOperationsStringS*)p current:(ICECurrent*)current +{ + return p; +} + +-(TestOperationsByteBoolD*) opByteBoolD1:(TestOperationsByteBoolD*)p current:(ICECurrent*)current +{ + return p; +} + +-(TestOperationsStringS*) opStringS2:(TestOperationsStringS*)p current:(ICECurrent*)current +{ + return p; +} + +-(TestOperationsByteBoolD*) opByteBoolD2:(TestOperationsByteBoolD*)p current:(ICECurrent*)current +{ + return p; +} + +-(TestOperationsMyClass1*) opMyClass1:(TestOperationsMyClass1*)p current:(ICECurrent*)current +{ + return p; +} + +-(TestOperationsMyStruct1*) opMyStruct1:(TestOperationsMyStruct1*)p current:(ICECurrent*)current +{ + return p; +} + -(TestOperationsStringS *) getNSNullStringSeq:(ICECurrent *)current { return [NSArray arrayWithObjects:@"first", [NSNull null], nil]; diff --git a/objective-c/test/Ice/operations/Twoways.m b/objective-c/test/Ice/operations/Twoways.m index f067dbe0159..55c5a702989 100644 --- a/objective-c/test/Ice/operations/Twoways.m +++ b/objective-c/test/Ice/operations/Twoways.m @@ -1679,6 +1679,33 @@ twoways(id<ICECommunicator> communicator, id<TestOperationsMyClassPrx> p) [p opNonmutating]; + test([p opByte1:0xFF] == 0xFF); + test([p opShort1:0x7FFF] == 0x7FFF); + test([p opInt1:0x7FFFFFFF] == 0x7FFFFFFF); + test([p opLong1:0x7FFFFFFFFFFFFFFF] == 0x7FFFFFFFFFFFFFFF); + test([p opFloat1:1.0] == 1.0); + test([p opDouble1:1.0] == 1.0); + test([[p opString1:@"opString1"] isEqualToString:@"opString1"]); + + id<TestOperationsMyDerivedClassPrx> d = [TestOperationsMyDerivedClassPrx uncheckedCast:p]; + + TestOperationsMyStruct1* s = + [TestOperationsMyStruct1 myStruct1:@"Test::MyStruct1::s" myClass:nil myStruct1:@"Test::MyStruct1::myStruct1"]; + s = [d opMyStruct1:s]; + test([s.tesT isEqualToString:@"Test::MyStruct1::s"]); + test(s.myClass == 0); + test([s.myStruct1 isEqualToString:@"Test::MyStruct1::myStruct1"]); + + TestOperationsMyClass1* c = + [TestOperationsMyClass1 myClass1:@"Test::MyClass1::testT" myClass:nil myClass1:@"Test::MyClass1::myClass1"]; + c = [d opMyClass1:c]; + test([c.tesT isEqualToString:@"Test::MyClass1::testT"]); + test(c.myClass == nil); + test([c.myClass1 isEqualToString:@"Test::MyClass1::myClass1"]); + + [p opStringS1:[TestOperationsStringS array]]; + [p opByteBoolD1:[TestOperationsByteBoolD dictionary]]; + // // TestOperationss below are for Objective-C only. They test that we do the right thing if NSNull // is passed as part of the sequence or dictionary. |