diff options
author | Bernard Normier <bernard@zeroc.com> | 2018-11-13 15:52:14 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2018-11-13 15:52:14 -0500 |
commit | a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c (patch) | |
tree | 58b9f74f2132985fe15913f1a7f65e82121b8eba /objective-c/test | |
parent | Fix failure related to Slice Scanner fixes (diff) | |
download | ice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.tar.bz2 ice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.tar.xz ice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.zip |
More bidir tests. Fixes #51.
Diffstat (limited to 'objective-c/test')
-rw-r--r-- | objective-c/test/Ice/ami/AMITest.ice | 2 | ||||
-rw-r--r-- | objective-c/test/Ice/ami/AllTests.m | 31 | ||||
-rw-r--r-- | objective-c/test/Ice/ami/TestI.m | 6 |
3 files changed, 36 insertions, 3 deletions
diff --git a/objective-c/test/Ice/ami/AMITest.ice b/objective-c/test/Ice/ami/AMITest.ice index a25f435f9a0..d259556cdd2 100644 --- a/objective-c/test/Ice/ami/AMITest.ice +++ b/objective-c/test/Ice/ami/AMITest.ice @@ -52,7 +52,7 @@ interface TestIntf bool supportsAMD(); bool supportsFunctionalTests(); - void pingBiDir(Ice::Identity id); + void pingBiDir(PingReply* reply); } interface TestIntfController diff --git a/objective-c/test/Ice/ami/AllTests.m b/objective-c/test/Ice/ami/AllTests.m index edf2d18fc61..0cd9fd647d1 100644 --- a/objective-c/test/Ice/ami/AllTests.m +++ b/objective-c/test/Ice/ami/AllTests.m @@ -13,6 +13,23 @@ #import <Foundation/Foundation.h> +@interface TestAMIPingReplyI : TestAMIPingReply<TestAMIPingReply> +{ + BOOL _received; +} +@end + +@implementation TestAMIPingReplyI +-(void) reply:(ICECurrent*)__unused current +{ + _received = YES; +} +-(BOOL) checkReceived +{ + return _received; +} +@end + @interface TestAMICallback : NSObject { BOOL called; @@ -848,5 +865,19 @@ amiAllTests(id<ICECommunicator> communicator, BOOL collocated) tprintf("ok\n"); + if([p ice_getConnection]) + { + tprintf("testing bidir... "); + id<ICEObjectAdapter> adapter = [communicator createObjectAdapter:@""]; + TestAMIPingReplyI* replyI = [TestAMIPingReplyI pingReply]; + id<TestAMIPingReplyPrx> reply = [TestAMIPingReplyPrx uncheckedCast:[adapter addWithUUID:replyI]]; + [adapter activate]; + + [[p ice_getConnection] setAdapter:adapter]; + [p pingBiDir:reply]; + test([replyI checkReceived]); + [adapter destroy]; + tprintf("ok\n"); + } [p shutdown]; } diff --git a/objective-c/test/Ice/ami/TestI.m b/objective-c/test/Ice/ami/TestI.m index c4ccd9fac70..d4fcd89356b 100644 --- a/objective-c/test/Ice/ami/TestI.m +++ b/objective-c/test/Ice/ami/TestI.m @@ -138,9 +138,11 @@ return NO; } --(void) pingBiDir:(ICEIdentity*)id_ current:(ICECurrent *)current +-(void) pingBiDir:(id<TestAMIPingReplyPrx>)reply current:(ICECurrent *)current { - [[TestAMIPingReplyPrx uncheckedCast:[current.con createProxy:id_]] reply]; + reply = [reply ice_fixed:current.con]; + id<ICEAsyncResult> result = [reply begin_reply]; + [reply end_reply:result]; } @end |