diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-11-09 16:22:47 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-11-09 16:22:47 -0800 |
commit | 493caea19fd83663eb03b4eeaf7714f99ac07b97 (patch) | |
tree | 39f8b7dc983394288cb25961a0907ebe0b0f5847 /php/test | |
parent | ICE-4914 - Update Database/Oracle demos (diff) | |
download | ice-493caea19fd83663eb03b4eeaf7714f99ac07b97.tar.bz2 ice-493caea19fd83663eb03b4eeaf7714f99ac07b97.tar.xz ice-493caea19fd83663eb03b4eeaf7714f99ac07b97.zip |
ICE-4930 - fixes for scripting languages
Diffstat (limited to 'php/test')
-rw-r--r-- | php/test/Ice/objects/Client.php | 9 | ||||
-rw-r--r-- | php/test/Ice/objects/Test.ice | 21 | ||||
-rw-r--r-- | php/test/Ice/optional/Client.php | 27 | ||||
-rw-r--r-- | php/test/Ice/optional/Test.ice | 7 |
4 files changed, 63 insertions, 1 deletions
diff --git a/php/test/Ice/objects/Client.php b/php/test/Ice/objects/Client.php index 5af9c43ce11..82961397cae 100644 --- a/php/test/Ice/objects/Client.php +++ b/php/test/Ice/objects/Client.php @@ -354,6 +354,15 @@ function allTests($communicator) $initial->setI($h); echo "ok\n"; + echo "testing sequences... "; + flush(); + $outS = null; + $initial->opBaseSeq(array(), $outS); + + $retS = $initial->opBaseSeq(array(new Test_Base()), $outS); + test(count($retS) == 1 && count($outS) == 1); + echo "ok\n"; + echo "testing UnexpectedObjectException... "; flush(); $ref = "uoet:default -p 12010"; diff --git a/php/test/Ice/objects/Test.ice b/php/test/Ice/objects/Test.ice index 1758598a2ca..5768ef51606 100644 --- a/php/test/Ice/objects/Test.ice +++ b/php/test/Ice/objects/Test.ice @@ -12,6 +12,22 @@ module Test { +struct S +{ + string str; +}; + +class Base +{ + S theS; + string str; +}; + +class AbstractBase extends Base +{ + void op(); +}; + class B; class C; @@ -75,10 +91,11 @@ class H implements I { }; +sequence<Base> BaseSeq; + class Initial { void shutdown(); - B getB1(); B getB2(); C getC(); @@ -93,6 +110,8 @@ class Initial I getH(); void setI(I theI); + + BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); }; class Empty diff --git a/php/test/Ice/optional/Client.php b/php/test/Ice/optional/Client.php index f3f8b469da4..cdd0a032d5e 100644 --- a/php/test/Ice/optional/Client.php +++ b/php/test/Ice/optional/Client.php @@ -32,6 +32,7 @@ function test($b) function allTests($communicator) { global $NS; + global $Ice_Encoding_1_0; $enum = $NS ? constant("Test\\MyEnum::MyEnumMember") : constant("Test_MyEnum::MyEnumMember"); @@ -325,6 +326,18 @@ function allTests($communicator) test($mo9->bos == Ice_Unset); + // + // Use the 1.0 encoding with operations whose only class parameters are optional. + // + $oo = new $oocls(53); + $initial->sendOptionalClass(true, $oo); + $initial->ice_encodingVersion($Ice_Encoding_1_0)->sendOptionalClass(true, $oo); + + $initial->returnOptionalClass(true, $oo); + test($oo != Ice_Unset); + $initial->ice_encodingVersion($Ice_Encoding_1_0)->returnOptionalClass(true, $oo); + test($oo == Ice_Unset); + echo "ok\n"; echo "testing marshaling of large containers with fixed size elements... "; @@ -670,6 +683,20 @@ function allTests($communicator) try { + // + // Use the 1.0 encoding with an exception whose only class members are optional. + // + $initial->ice_encodingVersion($Ice_Encoding_1_0)->opOptionalException(30, "test", new $oocls(53)); + } + catch(Exception $ex) + { + test($ex->a == Ice_Unset); + test($ex->b == Ice_Unset); + test($ex->o == Ice_Unset); + } + + try + { $initial->opDerivedException(Ice_Unset, Ice_Unset, Ice_Unset); } catch(Exception $ex) diff --git a/php/test/Ice/optional/Test.ice b/php/test/Ice/optional/Test.ice index 7f0342b8df4..8cc213df42c 100644 --- a/php/test/Ice/optional/Test.ice +++ b/php/test/Ice/optional/Test.ice @@ -136,6 +136,7 @@ class WD exception OptionalException { + bool req = false; optional(1) int a = 5; optional(2) string b; optional(50) OneOptional o; @@ -230,12 +231,18 @@ class Initial optional(1) VarStructSeq opVarStructSeq(optional(2) VarStructSeq p1, out optional(3) VarStructSeq p3); + optional(1) Serializable opSerializable(optional(2) Serializable p1, out optional(3) Serializable p3); + optional(1) IntIntDict opIntIntDict(optional(2) IntIntDict p1, out optional(3) IntIntDict p3); optional(1) StringIntDict opStringIntDict(optional(2) StringIntDict p1, out optional(3) StringIntDict p3); void opClassAndUnknownOptional(A p); + void sendOptionalClass(bool req, optional(1) OneOptional o); + + void returnOptionalClass(bool req, out optional(1) OneOptional o); + bool supportsRequiredParams(); bool supportsJavaSerializable(); |