diff options
author | Mark Spruiell <mes@zeroc.com> | 2018-02-14 16:46:17 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2018-02-14 16:46:17 -0800 |
commit | 189a22fb6b49714de1d4f7499a1af66c13b76823 (patch) | |
tree | 2102b4def3c402a52ff77ff0d526443a3882bc83 | |
parent | Fix uninitialized variable (diff) | |
download | ice-189a22fb6b49714de1d4f7499a1af66c13b76823.tar.bz2 ice-189a22fb6b49714de1d4f7499a1af66c13b76823.tar.xz ice-189a22fb6b49714de1d4f7499a1af66c13b76823.zip |
ICE-8618 - Add marshaling test for empty class with non-empty base
29 files changed, 209 insertions, 0 deletions
diff --git a/cpp/test/Ice/objects/AllTests.cpp b/cpp/test/Ice/objects/AllTests.cpp index ecba281f2d4..977838a2948 100644 --- a/cpp/test/Ice/objects/AllTests.cpp +++ b/cpp/test/Ice/objects/AllTests.cpp @@ -370,6 +370,17 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; + cout << "setting G... " << flush; + GPtr g = ICE_MAKE_SHARED(G, s, "g"); + try + { + initial->setG(g); + } + catch(const Ice::OperationNotExistException&) + { + } + cout << "ok" << endl; + cout << "setting I... " << flush; initial->setI(i); initial->setI(j); diff --git a/cpp/test/Ice/objects/Test.ice b/cpp/test/Ice/objects/Test.ice index e56687d1d79..2d445d5573f 100644 --- a/cpp/test/Ice/objects/Test.ice +++ b/cpp/test/Ice/objects/Test.ice @@ -82,6 +82,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -197,6 +202,7 @@ interface Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/cpp/test/Ice/objects/TestI.cpp b/cpp/test/Ice/objects/TestI.cpp index 8d0a0ea2d99..c94b9c263db 100644 --- a/cpp/test/Ice/objects/TestI.cpp +++ b/cpp/test/Ice/objects/TestI.cpp @@ -233,6 +233,11 @@ InitialI::getAll(BPtr& b1, BPtr& b2, CPtr& c, DPtr& d, const Ice::Current&) d = _d; } +void +InitialI::setG(ICE_IN(Test::GPtr), const Ice::Current&) +{ +} + #ifdef ICE_CPP11_MAPPING shared_ptr<Ice::Value> InitialI::getI(const Ice::Current&) diff --git a/cpp/test/Ice/objects/TestI.h b/cpp/test/Ice/objects/TestI.h index 63e48f7903d..b577518a3eb 100644 --- a/cpp/test/Ice/objects/TestI.h +++ b/cpp/test/Ice/objects/TestI.h @@ -123,6 +123,8 @@ public: virtual Test::D1Ptr getD1(ICE_IN(Test::D1Ptr), const Ice::Current&); virtual void throwEDerived(const Ice::Current&); + virtual void setG(ICE_IN(Test::GPtr), const Ice::Current&); + #ifdef ICE_CPP11_MAPPING virtual void setI(::std::shared_ptr<::Ice::Value>, const Ice::Current&); #else diff --git a/csharp/test/Ice/objects/AllTests.cs b/csharp/test/Ice/objects/AllTests.cs index 1e331652f8b..5938b40bb39 100644 --- a/csharp/test/Ice/objects/AllTests.cs +++ b/csharp/test/Ice/objects/AllTests.cs @@ -298,6 +298,17 @@ public class AllTests : TestCommon.AllTests } WriteLine("ok"); + Write("setting G... "); + Flush(); + try + { + initial.setG(new G(new S("hello"), "g")); + } + catch(Ice.OperationNotExistException) + { + } + WriteLine("ok"); + Write("setting I... "); Flush(); initial.setI(i); diff --git a/csharp/test/Ice/objects/InitialI.cs b/csharp/test/Ice/objects/InitialI.cs index 09914a51b00..8edec1785ea 100644 --- a/csharp/test/Ice/objects/InitialI.cs +++ b/csharp/test/Ice/objects/InitialI.cs @@ -109,6 +109,10 @@ public sealed class InitialI : InitialDisp_ throw new EDerived(new A1("a1"), new A1("a2"), new A1("a3"), new A1("a4")); } + public override void setG(G theG, Ice.Current current) + { + } + public override void setI(Ice.Value theI, Ice.Current current) { } diff --git a/csharp/test/Ice/objects/Test.ice b/csharp/test/Ice/objects/Test.ice index 12fe1725e2b..86f10bf92ab 100644 --- a/csharp/test/Ice/objects/Test.ice +++ b/csharp/test/Ice/objects/Test.ice @@ -77,6 +77,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -192,6 +197,7 @@ interface Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/java-compat/test/src/main/java/test/Ice/objects/AllTests.java b/java-compat/test/src/main/java/test/Ice/objects/AllTests.java index 6d7818dae58..ba049820a5e 100644 --- a/java-compat/test/src/main/java/test/Ice/objects/AllTests.java +++ b/java-compat/test/src/main/java/test/Ice/objects/AllTests.java @@ -19,6 +19,7 @@ import test.Ice.objects.Test.D; import test.Ice.objects.Test.DHolder; import test.Ice.objects.Test.E; import test.Ice.objects.Test.F; +import test.Ice.objects.Test.G; import test.Ice.objects.Test.H; import test.Ice.objects.Test.I; import test.Ice.objects.Test.A1; @@ -227,6 +228,17 @@ public class AllTests } out.println("ok"); + out.print("setting G... "); + out.flush(); + try + { + initial.setG(new G(new S("hello"), "g")); + } + catch(Ice.OperationNotExistException ex) + { + } + out.println("ok"); + out.print("setting I... "); out.flush(); initial.setI(i); diff --git a/java-compat/test/src/main/java/test/Ice/objects/InitialI.java b/java-compat/test/src/main/java/test/Ice/objects/InitialI.java index c010e03002a..792e3d962df 100644 --- a/java-compat/test/src/main/java/test/Ice/objects/InitialI.java +++ b/java-compat/test/src/main/java/test/Ice/objects/InitialI.java @@ -18,6 +18,7 @@ import test.Ice.objects.Test.D; import test.Ice.objects.Test.DHolder; import test.Ice.objects.Test.E; import test.Ice.objects.Test.F; +import test.Ice.objects.Test.G; import test.Ice.objects.Test.I; import test.Ice.objects.Test.A1; import test.Ice.objects.Test.D1; @@ -189,6 +190,12 @@ public final class InitialI extends Initial @Override public void + setG(G theG, Ice.Current current) + { + } + + @Override + public void setI(I theI, Ice.Current current) { } diff --git a/java-compat/test/src/main/java/test/Ice/objects/Test.ice b/java-compat/test/src/main/java/test/Ice/objects/Test.ice index 8e4f3d6de8f..95da33b1578 100644 --- a/java-compat/test/src/main/java/test/Ice/objects/Test.ice +++ b/java-compat/test/src/main/java/test/Ice/objects/Test.ice @@ -78,6 +78,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -193,6 +198,7 @@ class Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/java/test/src/main/java/test/Ice/objects/AllTests.java b/java/test/src/main/java/test/Ice/objects/AllTests.java index 69871d9c12e..533f323a07f 100644 --- a/java/test/src/main/java/test/Ice/objects/AllTests.java +++ b/java/test/src/main/java/test/Ice/objects/AllTests.java @@ -16,6 +16,7 @@ import test.Ice.objects.Test.C; import test.Ice.objects.Test.D; import test.Ice.objects.Test.E; import test.Ice.objects.Test.F; +import test.Ice.objects.Test.G; import test.Ice.objects.Test.H; import test.Ice.objects.Test.I; import test.Ice.objects.Test.A1; @@ -217,6 +218,17 @@ public class AllTests } out.println("ok"); + out.print("setting G... "); + out.flush(); + try + { + initial.setG(new G(new S("hello"), "g")); + } + catch(com.zeroc.Ice.OperationNotExistException ex) + { + } + out.println("ok"); + out.print("setting I... "); out.flush(); initial.setI(i); diff --git a/java/test/src/main/java/test/Ice/objects/InitialI.java b/java/test/src/main/java/test/Ice/objects/InitialI.java index 3299cdd554e..ea12334cb8d 100644 --- a/java/test/src/main/java/test/Ice/objects/InitialI.java +++ b/java/test/src/main/java/test/Ice/objects/InitialI.java @@ -159,6 +159,11 @@ public final class InitialI implements Initial } @Override + public void setG(G theG, com.zeroc.Ice.Current current) + { + } + + @Override public void setI(com.zeroc.Ice.Value theI, com.zeroc.Ice.Current current) { } diff --git a/java/test/src/main/java/test/Ice/objects/Test.ice b/java/test/src/main/java/test/Ice/objects/Test.ice index 2d3c623da76..eefcdf650d9 100644 --- a/java/test/src/main/java/test/Ice/objects/Test.ice +++ b/java/test/src/main/java/test/Ice/objects/Test.ice @@ -78,6 +78,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -193,6 +198,7 @@ interface Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/js/test/Ice/objects/Client.js b/js/test/Ice/objects/Client.js index 4852ca2039b..c24b186c57a 100644 --- a/js/test/Ice/objects/Client.js +++ b/js/test/Ice/objects/Client.js @@ -311,6 +311,17 @@ } out.writeLine("ok"); + out.write("setting G... "); + try + { + await initial.setG(new Test.G(new Test.S("hello"), "g")); + } + catch(ex) + { + test(ex instanceof Ice.OperationNotExistException, ex); + } + out.writeLine("ok"); + out.write("setting I... "); await initial.setI(i); await initial.setI(j); diff --git a/js/test/Ice/objects/InitialI.js b/js/test/Ice/objects/InitialI.js index 5ef814b30aa..27ed739e0ed 100644 --- a/js/test/Ice/objects/InitialI.js +++ b/js/test/Ice/objects/InitialI.js @@ -264,6 +264,10 @@ throw new Test.EDerived(new Test.A1("a1"), new Test.A1("a2"), new Test.A1("a3"), new Test.A1("a4")); } + setG(theG, current) + { + } + setI(theI, current) { } diff --git a/js/test/Ice/objects/Test.ice b/js/test/Ice/objects/Test.ice index 08e23493a97..a947db8b659 100644 --- a/js/test/Ice/objects/Test.ice +++ b/js/test/Ice/objects/Test.ice @@ -77,6 +77,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { void doI(); @@ -196,6 +201,7 @@ interface Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/matlab/test/Ice/objects/AllTests.m b/matlab/test/Ice/objects/AllTests.m index fb1f62bffa7..b56be1fc9b9 100644 --- a/matlab/test/Ice/objects/AllTests.m +++ b/matlab/test/Ice/objects/AllTests.m @@ -135,6 +135,16 @@ classdef AllTests end fprintf('ok\n'); + fprintf('setting G... '); + try + initial.setG(G(S('hello'), 'g')); + catch ex + if ~isa(ex, 'Ice.OperationNotExistException') + rethrow(ex); + end + end + fprintf('ok\n'); + fprintf('setting I... '); initial.setI(i); initial.setI(j); diff --git a/matlab/test/Ice/objects/Test.ice b/matlab/test/Ice/objects/Test.ice index 59dc2ee06f2..b9e1ecc9d29 100644 --- a/matlab/test/Ice/objects/Test.ice +++ b/matlab/test/Ice/objects/Test.ice @@ -77,6 +77,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -192,6 +197,7 @@ interface Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/objective-c/test/Ice/objects/AllTests.m b/objective-c/test/Ice/objects/AllTests.m index 333a660397a..2b760e5024d 100644 --- a/objective-c/test/Ice/objects/AllTests.m +++ b/objective-c/test/Ice/objects/AllTests.m @@ -234,6 +234,19 @@ objectsAllTests(id<ICECommunicator> communicator, BOOL collocated) test(h && [h isKindOfClass:[TestObjectsH class]]); tprintf("ok\n"); + tprintf("setting G... "); + TestObjectsG *g = ICE_AUTORELEASE([[TestObjectsG alloc] init]); + g.theS = s; + g.str = @"g"; + @try + { + [initial setG:g]; + } + @catch(ICEOperationNotExistException*) + { + } + tprintf("ok\n"); + tprintf("setting I... "); [initial setI:i]; [initial setI:j]; diff --git a/objective-c/test/Ice/objects/ObjectsTest.ice b/objective-c/test/Ice/objects/ObjectsTest.ice index 3aa3c1616dd..1449a025136 100644 --- a/objective-c/test/Ice/objects/ObjectsTest.ice +++ b/objective-c/test/Ice/objects/ObjectsTest.ice @@ -84,6 +84,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -207,6 +212,7 @@ class Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/objective-c/test/Ice/objects/TestI.h b/objective-c/test/Ice/objects/TestI.h index 618eac9741a..253b50830f2 100644 --- a/objective-c/test/Ice/objects/TestI.h +++ b/objective-c/test/Ice/objects/TestI.h @@ -61,6 +61,7 @@ -(TestObjectsI *) getJ:(ICECurrent *)current; -(TestObjectsI *) getH:(ICECurrent *)current; -(TestObjectsCompact*) getCompact:(ICECurrent*)current; +-(void) setG:(TestObjectsG *)theG current:(ICECurrent *)current; -(void) setI:(TestObjectsI *)theI current:(ICECurrent *)current; -(TestObjectsObjectSeq *) getObjectSeq:(TestObjectsMutableObjectSeq *)s current:(ICECurrent *)current; -(TestObjectsObjectPrxSeq *) getObjectPrxSeq:(TestObjectsMutableObjectPrxSeq *)s current:(ICECurrent *)current; diff --git a/objective-c/test/Ice/objects/TestI.m b/objective-c/test/Ice/objects/TestI.m index 6afcfc34641..8e4238769e2 100644 --- a/objective-c/test/Ice/objects/TestI.m +++ b/objective-c/test/Ice/objects/TestI.m @@ -279,6 +279,10 @@ @throw [TestInnerSubEx ex:@"Inner::Sub::Ex"]; } +-(void) setG:(TestObjectsG*)g current:(ICECurrent*)current +{ +} + -(void) setI:(TestObjectsI*)i current:(ICECurrent*)current { } diff --git a/php/test/Ice/objects/Client.php b/php/test/Ice/objects/Client.php index 4bd59c70c8f..a96db47bbe4 100644 --- a/php/test/Ice/objects/Client.php +++ b/php/test/Ice/objects/Client.php @@ -30,6 +30,7 @@ if($NS) class Test_D1 extends Test\D1 {} abstract class Test_E extends Test\E {} abstract class Test_F extends Test\F {} + class Test_G extends Test\G {} class Test_H extends Test\H {} class Test_Recursive extends Test\Recursive {} class Ice_Value extends Ice\Value {} @@ -392,6 +393,23 @@ function allTests($communicator) } echo "ok\n"; + echo "setting G... "; + flush(); + $cls = $NS ? "Test\\S" : "Test_S"; + try + { + $initial->setG(new Test_G(new $cls("hello"), "g")); + } + catch(Exception $ex) + { + $one = $NS ? "Ice\\OperationNotExistException" : "Ice_OperationNotExistException"; + if(!($ex instanceof $one)) + { + throw $ex; + } + } + echo "ok\n"; + echo "setting I... "; flush(); $initial->setI($i); diff --git a/php/test/Ice/objects/Test.ice b/php/test/Ice/objects/Test.ice index def62b37deb..cf2d3573fc6 100644 --- a/php/test/Ice/objects/Test.ice +++ b/php/test/Ice/objects/Test.ice @@ -77,6 +77,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -162,6 +167,7 @@ interface Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/python/test/Ice/objects/AllTests.py b/python/test/Ice/objects/AllTests.py index 764e4bd8bd4..b9f00d1572a 100644 --- a/python/test/Ice/objects/AllTests.py +++ b/python/test/Ice/objects/AllTests.py @@ -132,6 +132,14 @@ def allTests(communicator): test(e.a4.name == "a4") print("ok") + sys.stdout.write("setting G... ") + sys.stdout.flush() + try: + initial.setG(Test.G(Test.S("hello"), "g")) + except Ice.OperationNotExistException: + pass + print("ok") + sys.stdout.write("setting I... ") sys.stdout.flush() initial.setI(TestI.II()) diff --git a/python/test/Ice/objects/Test.ice b/python/test/Ice/objects/Test.ice index 93dd61c3929..7f9a7ebaa62 100644 --- a/python/test/Ice/objects/Test.ice +++ b/python/test/Ice/objects/Test.ice @@ -77,6 +77,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -192,6 +197,7 @@ interface Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); diff --git a/python/test/Ice/objects/TestI.py b/python/test/Ice/objects/TestI.py index 80a6c761c22..7bdcbc6b338 100644 --- a/python/test/Ice/objects/TestI.py +++ b/python/test/Ice/objects/TestI.py @@ -159,6 +159,9 @@ class InitialI(Test.Initial): def throwEDerived(self, current=None): raise Test.EDerived(Test.A1("a1"), Test.A1("a2"), Test.A1("a3"), Test.A1("a4")) + def setG(self, g, current=None): + pass + def setI(self, i, current=None): pass diff --git a/ruby/test/Ice/objects/AllTests.rb b/ruby/test/Ice/objects/AllTests.rb index f0e3e8b853a..ff07c5106b6 100644 --- a/ruby/test/Ice/objects/AllTests.rb +++ b/ruby/test/Ice/objects/AllTests.rb @@ -241,6 +241,14 @@ def allTests(communicator) end puts "ok" + print "setting G... " + STDOUT.flush + begin + initial.setG(Test::G.new(Test::S.new("hello"), "g")) + rescue Ice::OperationNotExistException + end + puts "ok" + print "setting I... " STDOUT.flush initial.setI(i) diff --git a/ruby/test/Ice/objects/Test.ice b/ruby/test/Ice/objects/Test.ice index 03a56fb2f32..bf3d70ca9be 100644 --- a/ruby/test/Ice/objects/Test.ice +++ b/ruby/test/Ice/objects/Test.ice @@ -77,6 +77,11 @@ class F E e2; } +// Exercise empty class with non-empty base +class G extends Base +{ +} + interface I { } @@ -162,6 +167,7 @@ class Initial D1 getD1(D1 d1); void throwEDerived() throws EDerived; + void setG(G theG); void setI(I theI); BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq); |