summaryrefslogtreecommitdiff
path: root/js
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 /js
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 'js')
-rw-r--r--js/test/Ice/scope/Client.js11
-rw-r--r--js/test/Ice/scope/Test.ice35
-rw-r--r--js/test/typescript/Ice/scope/Client.ts11
-rw-r--r--js/test/typescript/Ice/scope/Test.ice35
4 files changed, 90 insertions, 2 deletions
diff --git a/js/test/Ice/scope/Client.js b/js/test/Ice/scope/Client.js
index c65a92dd13e..e409baf9719 100644
--- a/js/test/Ice/scope/Client.js
+++ b/js/test/Ice/scope/Client.js
@@ -16,7 +16,7 @@
const out = this.getWriter();
const communicator = this.communicator();
- out.write("test same Slice type name in different scopes... ");
+ out.write("test using same type name in different Slice modules... ");
{
const i1 = await Test.IPrx.checkedCast(communicator.stringToProxy("i1:" + this.getTestEndpoint()));
@@ -49,6 +49,15 @@
const [cmap2, cmap3] = await i1.opCMap(cmap1);
test(cmap2.get("a").s.equals(s1));
test(cmap3.get("a").s.equals(s1));
+
+ const e = await i1.opE1(Test.E1.v1);
+ test(e == Test.E1.v1);
+
+ const s = await i1.opS1(new Test.S1("S1"));
+ test(s.s == "S1");
+
+ const c = await i1.opC1(new Test.C1("C1"));
+ test(c.s == "C1");
}
{
diff --git a/js/test/Ice/scope/Test.ice b/js/test/Ice/scope/Test.ice
index e2197329562..011badcf15b 100644
--- a/js/test/Ice/scope/Test.ice
+++ b/js/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();
}
diff --git a/js/test/typescript/Ice/scope/Client.ts b/js/test/typescript/Ice/scope/Client.ts
index ddcbdd99edc..afa9ef32e17 100644
--- a/js/test/typescript/Ice/scope/Client.ts
+++ b/js/test/typescript/Ice/scope/Client.ts
@@ -15,7 +15,7 @@ export class Client extends TestHelper
const out = this.getWriter();
const communicator = this.communicator();
- out.write("test same Slice type name in different scopes... ");
+ out.write("test using same type name in different Slice modules... ");
{
const i1 = await Test.IPrx.checkedCast(communicator.stringToProxy("i1:" + this.getTestEndpoint()));
@@ -48,6 +48,15 @@ export class Client extends TestHelper
const [cmap2, cmap3] = await i1.opCMap(cmap1);
test(cmap2.get("a").s.equals(s1));
test(cmap3.get("a").s.equals(s1));
+
+ const e = await i1.opE1(Test.E1.v1);
+ test(e == Test.E1.v1);
+
+ const s = await i1.opS1(new Test.S1("S1"));
+ test(s.s == "S1");
+
+ const c = await i1.opC1(new Test.C1("C1"));
+ test(c.s == "C1");
}
{
diff --git a/js/test/typescript/Ice/scope/Test.ice b/js/test/typescript/Ice/scope/Test.ice
index 83ee03f6073..6dbe43bfdaa 100644
--- a/js/test/typescript/Ice/scope/Test.ice
+++ b/js/test/typescript/Ice/scope/Test.ice
@@ -24,6 +24,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);
@@ -34,6 +65,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();
}