summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-06-07 11:10:34 +0200
committerJose <jose@zeroc.com>2019-06-07 11:10:34 +0200
commitf257620afed9be1e4e6ce07aec8a30a8ae361614 (patch)
treec884172e4fb4bf7644d10e95bb0b1ab70dd8c457
parentFix for Xamarin builds (diff)
downloadice-f257620afed9be1e4e6ce07aec8a30a8ae361614.tar.bz2
ice-f257620afed9be1e4e6ce07aec8a30a8ae361614.tar.xz
ice-f257620afed9be1e4e6ce07aec8a30a8ae361614.zip
Sync objetice-c Ice/operations test
-rw-r--r--cpp/test/Ice/operations/Test.ice2
-rw-r--r--objective-c/test/Ice/operations/AllTests.m8
-rw-r--r--objective-c/test/Ice/operations/Collocated.m1
-rw-r--r--objective-c/test/Ice/operations/OperationsTest.ice27
-rw-r--r--objective-c/test/Ice/operations/Server.m1
-rw-r--r--objective-c/test/Ice/operations/TestI.h5
-rw-r--r--objective-c/test/Ice/operations/TestI.m14
-rw-r--r--objective-c/test/Ice/operations/Twoways.m7
8 files changed, 61 insertions, 4 deletions
diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice
index e152939fbdd..dbd6bccde34 100644
--- a/cpp/test/Ice/operations/Test.ice
+++ b/cpp/test/Ice/operations/Test.ice
@@ -437,6 +437,8 @@ interface MyDerivedClass extends Test::MyClass
}
+
+
//
// Test proxy inheritance for class with operations
// see: https://github.com/zeroc-ice/ice/issues/406
diff --git a/objective-c/test/Ice/operations/AllTests.m b/objective-c/test/Ice/operations/AllTests.m
index 9a11a26fb63..52613b2e068 100644
--- a/objective-c/test/Ice/operations/AllTests.m
+++ b/objective-c/test/Ice/operations/AllTests.m
@@ -13,11 +13,13 @@ operationsAllTests(id<ICECommunicator> communicator)
id<ICEObjectPrx> base = [communicator stringToProxy:(ref)];
id<TestOperationsMyClassPrx> cl = [TestOperationsMyClassPrx checkedCast:base];
id<TestOperationsMyDerivedClassPrx> derived = [TestOperationsMyDerivedClassPrx checkedCast:cl];
+ id<TestOperationsMBPrx> bprx =
+ [TestOperationsMBPrx checkedCast:[communicator stringToProxy: @"b:default -p 12010"]];
tprintf("testing twoway operations... ");
- void twoways(id<ICECommunicator>, id<TestOperationsMyClassPrx>);
- twoways(communicator, cl);
- twoways(communicator, derived);
+ void twoways(id<ICECommunicator>, id<TestOperationsMyClassPrx>, id<TestOperationsMBPrx>);
+ twoways(communicator, cl, bprx);
+ twoways(communicator, derived, bprx);
[derived opDerived];
tprintf("ok\n");
diff --git a/objective-c/test/Ice/operations/Collocated.m b/objective-c/test/Ice/operations/Collocated.m
index d4c66690c47..0de36c20a52 100644
--- a/objective-c/test/Ice/operations/Collocated.m
+++ b/objective-c/test/Ice/operations/Collocated.m
@@ -13,6 +13,7 @@ run(id<ICECommunicator> communicator)
id<ICEObjectAdapter> adapter = [communicator createObjectAdapter:@"TestOperationsAdapter"];
id<ICEObjectPrx> prx = [adapter add:[TestOperationsMyDerivedClassI myDerivedClass]
identity:[ICEUtil stringToIdentity:@"test"]];
+ [adapter add:[TestOperationsBI b] identity:[ICEUtil stringToIdentity:@"b"]];
//[adapter activate]; // Don't activate OA to ensure collocation is used.
test(![prx ice_getConnection]);
diff --git a/objective-c/test/Ice/operations/OperationsTest.ice b/objective-c/test/Ice/operations/OperationsTest.ice
index 7e5ddbce33b..7ec74544070 100644
--- a/objective-c/test/Ice/operations/OperationsTest.ice
+++ b/objective-c/test/Ice/operations/OperationsTest.ice
@@ -6,6 +6,8 @@
#include <Ice/Current.ice>
+[["suppress-warning:deprecated"]] // For classes with operations
+
["objc:prefix:TestOperations"]
module Test
{
@@ -406,3 +408,28 @@ interface MyDerivedClass extends Test::MyClass
}
}
+
+["objc:prefix:TestOperationsM"]
+
+//
+// Test proxy inheritance for class with operations
+// see: https://github.com/zeroc-ice/ice/issues/406
+//
+module M
+{
+ class A
+ {
+ int x;
+ // void opA();
+ }
+
+ interface Intf
+ {
+ void opIntf();
+ }
+
+ class B extends A implements Intf
+ {
+ void opB();
+ }
+}
diff --git a/objective-c/test/Ice/operations/Server.m b/objective-c/test/Ice/operations/Server.m
index d4baa538ba0..c8f1712c56f 100644
--- a/objective-c/test/Ice/operations/Server.m
+++ b/objective-c/test/Ice/operations/Server.m
@@ -13,6 +13,7 @@ run(id<ICECommunicator> communicator)
id<ICEObjectAdapter> adapter = [communicator createObjectAdapter:@"TestOperationsAdapter"];
[adapter add:[TestOperationsMyDerivedClassI myDerivedClass]
identity:[ICEUtil stringToIdentity:@"test"]];
+ [adapter add:[TestOperationsBI b] identity:[ICEUtil stringToIdentity:@"b"]];
[adapter activate];
serverReady(communicator);
diff --git a/objective-c/test/Ice/operations/TestI.h b/objective-c/test/Ice/operations/TestI.h
index 2609c1bb03f..8d58a95fad2 100644
--- a/objective-c/test/Ice/operations/TestI.h
+++ b/objective-c/test/Ice/operations/TestI.h
@@ -14,3 +14,8 @@
NSCondition* _cond;
}
@end
+
+@interface TestOperationsBI : TestOperationsMB<TestOperationsMB>
+{
+}
+@end
diff --git a/objective-c/test/Ice/operations/TestI.m b/objective-c/test/Ice/operations/TestI.m
index 8c279ee4069..a61bf84f388 100644
--- a/objective-c/test/Ice/operations/TestI.m
+++ b/objective-c/test/Ice/operations/TestI.m
@@ -854,3 +854,17 @@
return YES;
}
@end
+
+
+
+@implementation TestOperationsBI
+
+-(void) opB:(ICECurrent*)__unused current
+{
+}
+
+-(void) opIntf:(ICECurrent*)__unused current
+{
+}
+
+@end
diff --git a/objective-c/test/Ice/operations/Twoways.m b/objective-c/test/Ice/operations/Twoways.m
index 8c4177e7551..8cc9825a59a 100644
--- a/objective-c/test/Ice/operations/Twoways.m
+++ b/objective-c/test/Ice/operations/Twoways.m
@@ -73,7 +73,7 @@
@end
void
-twoways(id<ICECommunicator> communicator, id<TestOperationsMyClassPrx> p)
+twoways(id<ICECommunicator> communicator, id<TestOperationsMyClassPrx> p, id<TestOperationsMBPrx> bprx)
{
{
TestOperationsStringS *literals = [p opStringLiterals];
@@ -1908,4 +1908,9 @@ twoways(id<ICECommunicator> communicator, id<TestOperationsMyClassPrx> p)
{
// Client is talking to non-Objective-C server.
}
+
+ {
+ [bprx opB];
+ [bprx opIntf];
+ }
}