diff options
author | Jose <jose@zeroc.com> | 2019-06-06 19:24:20 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-06 19:24:20 +0200 |
commit | 2dc0a8799e913bb37db8c5895f00f4dda920df62 (patch) | |
tree | 6dd9fe720314d92fecedb703132c5cf73082ca3f /php | |
parent | Do not set WindowsTargetPlatformVersion, use the default (diff) | |
download | ice-2dc0a8799e913bb37db8c5895f00f4dda920df62.tar.bz2 ice-2dc0a8799e913bb37db8c5895f00f4dda920df62.tar.xz ice-2dc0a8799e913bb37db8c5895f00f4dda920df62.zip |
Fix Incorrect generated code for class implements interface
Close #406
Diffstat (limited to 'php')
-rw-r--r-- | php/test/Ice/operations/Client.php | 14 | ||||
-rw-r--r-- | php/test/Ice/operations/Test.ice | 25 |
2 files changed, 35 insertions, 4 deletions
diff --git a/php/test/Ice/operations/Client.php b/php/test/Ice/operations/Client.php index ff9ee9357aa..8355f2d0bbd 100644 --- a/php/test/Ice/operations/Client.php +++ b/php/test/Ice/operations/Client.php @@ -5,7 +5,7 @@ require_once('Test.php'); -function twoways($communicator, $p) +function twoways($communicator, $p, $bprx) { global $NS; @@ -1058,6 +1058,11 @@ function twoways($communicator, $p) $p3 = $p->opMDict2($p1, $p2); test($p3["test"] == "test" && $p2["test"] == "test"); } + + { + $bprx->opB(); + $bprx->opIntf(); + } } function allTests($helper) @@ -1070,10 +1075,12 @@ function allTests($helper) $cl = $base->ice_checkedCast("::Test::MyClass"); $derived = $cl->ice_checkedCast("::Test::MyDerivedClass"); + $bprx = $communicator->stringToProxy(sprintf("b:%s", $helper->getTestEndpoint()))->ice_checkedCast("::M::B"); + echo "testing twoway operations... "; flush(); - twoways($communicator, $cl); - twoways($communicator, $derived); + twoways($communicator, $cl, $bprx); + twoways($communicator, $derived, $bprx); $derived->opDerived(); echo "ok\n"; @@ -1109,7 +1116,6 @@ class Client extends TestHelper { throw $ex; } - echo "ok\n"; } # Test multiple destroy calls $communicator->destroy(); diff --git a/php/test/Ice/operations/Test.ice b/php/test/Ice/operations/Test.ice index 55c142c0556..9a66e40ab57 100644 --- a/php/test/Ice/operations/Test.ice +++ b/php/test/Ice/operations/Test.ice @@ -4,6 +4,8 @@ #pragma once +[["suppress-warning:deprecated"]] // For classes with operations + module Test { @@ -340,3 +342,26 @@ interface MyDerivedClass extends Test::MyClass } } + +// +// 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(); + } +} |