summaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-07-30 12:45:29 +0200
committerJose <jose@zeroc.com>2019-07-31 13:13:40 +0200
commit3e71d9e1a29bc8169452b039bb723406ff8ef0fe (patch)
treecfde39529b1a21d6f4c4e87b2a92a366eafc9993 /ruby
parentUpdate .npmignore to ignore .tgz files (diff)
downloadice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.tar.bz2
ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.tar.xz
ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.zip
Fixes for C++ & Swift generated code - Close #458
Diffstat (limited to 'ruby')
-rw-r--r--ruby/test/Ice/scope/AllTests.rb11
-rw-r--r--ruby/test/Ice/scope/Test.ice35
2 files changed, 45 insertions, 1 deletions
diff --git a/ruby/test/Ice/scope/AllTests.rb b/ruby/test/Ice/scope/AllTests.rb
index 3d339869b15..78797e5bd7f 100644
--- a/ruby/test/Ice/scope/AllTests.rb
+++ b/ruby/test/Ice/scope/AllTests.rb
@@ -4,7 +4,7 @@
def allTests(helper, communicator)
- print "test same Slice type name in different scopes... "
+ print "test using same type name in different Slice modules... "
STDOUT.flush
i1 = Test::IPrx::checkedCast(communicator.stringToProxy("i1:#{helper.getTestEndpoint()}"))
@@ -41,6 +41,15 @@ def allTests(helper, communicator)
test(cmap2["a"].s == s1)
test(cmap3["a"].s == s1)
+ e = i1.opE1(Test::E1::V1)
+ test(e == Test::E1::V1)
+
+ s = i1.opS1(Test::S1.new("S1"))
+ test(s.s == "S1")
+
+ c = i1.opC1(Test::C1.new("C1"))
+ test(c.s == "C1")
+
i2 = Test::Inner::Inner2::IPrx::checkedCast(communicator.stringToProxy("i2:#{helper.getTestEndpoint()}"))
s1 = Test::Inner::Inner2::S.new(0)
diff --git a/ruby/test/Ice/scope/Test.ice b/ruby/test/Ice/scope/Test.ice
index e2197329562..011badcf15b 100644
--- a/ruby/test/Ice/scope/Test.ice
+++ b/ruby/test/Ice/scope/Test.ice
@@ -22,6 +22,37 @@ module Test
dictionary<string, C> CMap;
sequence<C> CSeq;
+ enum E1
+ {
+ v1,
+ v2,
+ v3
+ }
+
+ struct S1
+ {
+ string s;
+ }
+
+ class C1
+ {
+ string s;
+ }
+
+ struct S2
+ {
+ E1 E1;
+ S1 S1;
+ C1 C1;
+ }
+
+ class C2
+ {
+ E1 E1;
+ S1 S1;
+ C1 C1;
+ }
+
interface I
{
S opS(S s1, out S s2);
@@ -32,6 +63,10 @@ module Test
CSeq opCSeq(CSeq s1, out CSeq s2);
CMap opCMap(CMap c1, out CMap c2);
+ E1 opE1(E1 E1);
+ S1 opS1(S1 S1);
+ C1 opC1(C1 C1);
+
void shutdown();
}