summaryrefslogtreecommitdiff
path: root/ruby/test
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-11-19 16:27:16 +0100
committerJose <jose@zeroc.com>2015-11-19 16:27:16 +0100
commit87fc4e46d3108554762c44aa2fc46cb3a151f7e6 (patch)
treec3bc9f31e465fbc2d092100a63e7cf00abe963ed /ruby/test
parentFixed bug in Java/C# class data member generated patcher (diff)
downloadice-87fc4e46d3108554762c44aa2fc46cb3a151f7e6.tar.bz2
ice-87fc4e46d3108554762c44aa2fc46cb3a151f7e6.tar.xz
ice-87fc4e46d3108554762c44aa2fc46cb3a151f7e6.zip
Objects test updates to sync with Java/C#
Diffstat (limited to 'ruby/test')
-rw-r--r--ruby/test/Ice/objects/AllTests.rb22
-rw-r--r--ruby/test/Ice/objects/Test.ice32
2 files changed, 54 insertions, 0 deletions
diff --git a/ruby/test/Ice/objects/AllTests.rb b/ruby/test/Ice/objects/AllTests.rb
index cb009438b80..56fb00a02b1 100644
--- a/ruby/test/Ice/objects/AllTests.rb
+++ b/ruby/test/Ice/objects/AllTests.rb
@@ -192,6 +192,28 @@ def allTests(communicator)
h = initial.getH()
test(i)
puts "ok"
+
+ print "getting D1... "
+ STDOUT.flush
+ d1 = initial.getD1(Test::D1.new(Test::A1.new("a1"), Test::A1.new("a2"), Test::A1.new("a3"), Test::A1.new("a4")))
+ test(d1.a1.name == "a1")
+ test(d1.a2.name == "a2")
+ test(d1.a3.name == "a3")
+ test(d1.a4.name == "a4")
+ puts "ok"
+
+ print "throw EDerived... "
+ STDOUT.flush
+ begin
+ initial.throwEDerived()
+ test(false)
+ rescue Test::EDerived => e
+ test(e.a1.name == "a1")
+ test(e.a2.name == "a2")
+ test(e.a3.name == "a3")
+ test(e.a4.name == "a4")
+ end
+ puts "ok"
print "setting I... "
STDOUT.flush
diff --git a/ruby/test/Ice/objects/Test.ice b/ruby/test/Ice/objects/Test.ice
index 42852d1f75c..484cfdee59a 100644
--- a/ruby/test/Ice/objects/Test.ice
+++ b/ruby/test/Ice/objects/Test.ice
@@ -105,6 +105,35 @@ class CompactExt(CompactExtId) extends Compact
{
};
+class A1
+{
+ string name;
+};
+
+class B1
+{
+ A1 a1;
+ A1 a2;
+};
+
+class D1 extends B1
+{
+ A1 a3;
+ A1 a4;
+};
+
+exception EBase
+{
+ A1 a1;
+ A1 a2;
+};
+
+exception EDerived extends EBase
+{
+ A1 a3;
+ A1 a4;
+};
+
class Initial
{
void shutdown();
@@ -121,6 +150,9 @@ class Initial
I getJ();
I getH();
+ D1 getD1(D1 d1);
+ void throwEDerived() throws EDerived;
+
void setI(I theI);
BaseSeq opBaseSeq(BaseSeq inSeq, out BaseSeq outSeq);