Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Recursive Optional Class Member 'k' from 'Ice/optional' Tests #2089

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions cpp/test/Ice/optional/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ allTests(Test::TestHelper* helper, bool)
mo1->h = string("test");
mo1->i = MyEnum::MyEnumMember;
mo1->j = MyInterfacePrx(communicator, "test");
mo1->k = mo1;
mo1->bs = ByteSeq();
(*mo1->bs).push_back(byte{5});
mo1->ss = StringSeq();
Expand Down Expand Up @@ -374,7 +373,6 @@ allTests(Test::TestHelper* helper, bool)
test(mo3->h == string("test"));
test(mo3->i = MyEnum::MyEnumMember);
test(mo3->j = MyInterfacePrx(communicator, "test"));
test(mo3->k == mo1);
test(mo3->bs == mo1->bs);
test(mo3->ss == mo1->ss);
test(mo3->iid == mo1->iid);
Expand Down Expand Up @@ -437,7 +435,6 @@ allTests(Test::TestHelper* helper, bool)
test(!mo4->h);
test(!mo4->i);
test(!mo4->j);
test(!mo4->k);
test(!mo4->bs);
test(!mo4->ss);
test(!mo4->iid);
Expand All @@ -460,7 +457,6 @@ allTests(Test::TestHelper* helper, bool)

test(!mo4->bos);

mo1->k = mo1;
MultiOptionalPtr mo5 = dynamic_pointer_cast<MultiOptional>(initial->pingPong(mo1));

test(mo5->a == mo1->a);
Expand All @@ -473,7 +469,6 @@ allTests(Test::TestHelper* helper, bool)
test(mo5->h == mo1->h);
test(mo5->i == mo1->i);
test(mo5->j == mo1->j);
test(mo5->k == mo5->k);
test(mo5->bs == mo1->bs);
test(mo5->ss == mo1->ss);
test(mo5->iid == mo1->iid);
Expand Down Expand Up @@ -513,7 +508,6 @@ allTests(Test::TestHelper* helper, bool)
mo6->e = nullopt;
mo6->g = nullopt;
mo6->i = nullopt;
mo6->k = nullopt;
mo6->ss = nullopt;
mo6->sid = nullopt;
mo6->vs = nullopt;
Expand All @@ -537,7 +531,6 @@ allTests(Test::TestHelper* helper, bool)
test(mo7->h == mo1->h);
test(!mo7->i);
test(mo7->j == mo1->j);
test(!mo7->k);
test(mo7->bs == mo1->bs);
test(!mo7->ss);
test(mo7->iid == mo1->iid);
Expand Down Expand Up @@ -576,7 +569,6 @@ allTests(Test::TestHelper* helper, bool)
mo8->ifsd = nullopt;
mo8->iood = nullopt;

mo8->k = mo8;
MultiOptionalPtr mo9 = dynamic_pointer_cast<MultiOptional>(initial->pingPong(mo8));
test(mo9->a == mo1->a);
test(!mo9->b);
Expand All @@ -588,7 +580,6 @@ allTests(Test::TestHelper* helper, bool)
test(!mo9->h);
test(mo9->i == mo1->i);
test(!mo9->j);
test(mo9->k == mo9);
test(!mo9->bs);
test(mo9->ss == mo1->ss);
test(!mo9->iid);
Expand Down Expand Up @@ -653,16 +644,6 @@ allTests(Test::TestHelper* helper, bool)
factory->setEnabled(false);
}

mo1->k = nullptr;
mo2->k = nullptr;
mo3->k = nullptr;
mo4->k = nullptr;
mo5->k = nullptr;
mo6->k = nullptr;
mo7->k = nullptr;
mo8->k = nullptr;
mo9->k = nullptr;

//
// Use the 1.0 encoding with operations whose only class parameters are optional.
//
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class MultiOptional
optional(8) string h;
optional(9) MyEnum i;
optional(10) MyInterface* j;
optional(11) MultiOptional k;
optional(12) ByteSeq bs;
optional(13) StringSeq ss;
optional(14) IntIntDict iid;
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Ice/optional/TestAMD.ice
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class MultiOptional
optional(8) string h;
optional(9) MyEnum i;
optional(10) MyInterface* j;
optional(11) MultiOptional k;
optional(12) ByteSeq bs;
optional(13) StringSeq ss;
optional(14) IntIntDict iid;
Expand Down
5 changes: 0 additions & 5 deletions cpp/test/Ice/optional/TestAMDI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ InitialI::pingPongAsync(
const Ice::Current&)
{
response(obj);
if (dynamic_pointer_cast<MultiOptional>(obj))
{
// Break cyclic reference count
dynamic_pointer_cast<MultiOptional>(obj)->k = shared_ptr<MultiOptional>();
}
}

void
Expand Down
8 changes: 1 addition & 7 deletions cpp/test/Ice/optional/TestI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ InitialI::shutdown(const Current& current)
Test::Initial::PingPongMarshaledResult
InitialI::pingPong(shared_ptr<Value> obj, const Current& current)
{
auto result = PingPongMarshaledResult(obj, current);
if (dynamic_pointer_cast<MultiOptional>(obj))
{
// Break cyclic reference count
dynamic_pointer_cast<MultiOptional>(obj)->k = shared_ptr<MultiOptional>();
}
return result;
return PingPongMarshaledResult(obj, current);
}

void
Expand Down
7 changes: 0 additions & 7 deletions csharp/test/Ice/optional/AllTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class AllTests : global::Test.AllTests
mo1.h = "test";
mo1.i = Test.MyEnum.MyEnumMember;
mo1.j = new Ice.Optional<Test.MyInterfacePrx>(Test.MyInterfacePrxHelper.uncheckedCast(communicator.stringToProxy("test")));
mo1.k = mo1;
mo1.bs = new byte[] { 5 };
mo1.ss = new string[] { "test", "test2" };
mo1.iid = new Dictionary<int, int>();
Expand Down Expand Up @@ -93,7 +92,6 @@ public class AllTests : global::Test.AllTests
test(mo1.h.Value == "test");
test(mo1.i.Value == Test.MyEnum.MyEnumMember);
test(mo1.j.Value.Equals(communicator.stringToProxy("test")));
test(mo1.k.Value == mo1);
test(ArraysEqual(mo1.bs.Value, new byte[] { (byte)5 }));
test(ArraysEqual(mo1.ss.Value, new String[] { "test", "test2" }));
test(mo1.iid.Value[4] == 3);
Expand Down Expand Up @@ -138,7 +136,6 @@ public class AllTests : global::Test.AllTests
test(!mo4.h.HasValue);
test(!mo4.i.HasValue);
test(!mo4.j.HasValue);
test(!mo4.k.HasValue);
test(!mo4.bs.HasValue);
test(!mo4.ss.HasValue);
test(!mo4.iid.HasValue);
Expand Down Expand Up @@ -172,7 +169,6 @@ public class AllTests : global::Test.AllTests
test(mo5.h.Value.Equals(mo1.h.Value));
test(mo5.i.Value == mo1.i.Value);
test(mo5.j.Value.Equals(mo1.j.Value));
test(mo5.k.Value == mo5);
test(ArraysEqual(mo5.bs.Value, mo1.bs.Value));
test(ArraysEqual(mo5.ss.Value, mo1.ss.Value));
test(mo5.iid.Value[4] == 3);
Expand Down Expand Up @@ -222,7 +218,6 @@ public class AllTests : global::Test.AllTests
test(mo7.h.Equals(mo1.h));
test(!mo7.i.HasValue);
test(mo7.j.Equals(mo1.j));
test(!mo7.k.HasValue);
test(ArraysEqual(mo7.bs.Value, mo1.bs.Value));
test(!mo7.ss.HasValue);
test(mo7.iid.Value[4] == 3);
Expand Down Expand Up @@ -252,7 +247,6 @@ public class AllTests : global::Test.AllTests
mo8.e = mo5.e;
mo8.g = mo5.g;
mo8.i = mo5.i;
mo8.k = mo8;
mo8.ss = mo5.ss;
mo8.sid = mo5.sid;
mo8.vs = mo5.vs;
Expand All @@ -276,7 +270,6 @@ public class AllTests : global::Test.AllTests
test(!mo9.h.HasValue);
test(mo9.i.Equals(mo1.i));
test(!mo9.j.HasValue);
test(mo9.k.Value == mo9);
test(!mo9.bs.HasValue);
test(ArraysEqual(mo9.ss.Value, mo1.ss.Value));
test(!mo9.iid.HasValue);
Expand Down
1 change: 0 additions & 1 deletion csharp/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class MultiOptional
optional(8) string h;
optional(9) MyEnum i;
optional(10) MyInterface* j;
optional(11) MultiOptional k;
optional(12) ByteSeq bs;
optional(13) StringSeq ss;
optional(14) IntIntDict iid;
Expand Down
1 change: 0 additions & 1 deletion csharp/test/Ice/optional/TestAMD.ice
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class MultiOptional
optional(8) string h;
optional(9) MyEnum i;
optional(10) MyInterface* j;
optional(11) MultiOptional k;
optional(12) ByteSeq bs;
optional(13) StringSeq ss;
optional(14) IntIntDict iid;
Expand Down
7 changes: 0 additions & 7 deletions java/test/src/main/java/test/Ice/optional/AllTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public static InitialPrx allTests(test.TestHelper helper, boolean collocated) {
mo1.setH("test");
mo1.setI(MyEnum.MyEnumMember);
mo1.setJ(MyInterfacePrx.uncheckedCast(communicator.stringToProxy("test")));
mo1.setK(mo1);
mo1.setBs(new byte[] {(byte) 5});
mo1.setSs(new String[] {"test", "test2"});
mo1.setIid(new java.util.HashMap<>());
Expand Down Expand Up @@ -117,7 +116,6 @@ public static InitialPrx allTests(test.TestHelper helper, boolean collocated) {
test(mo1.getH().equals("test"));
test(mo1.getI() == MyEnum.MyEnumMember);
test(mo1.getJ().equals(communicator.stringToProxy("test")));
test(mo1.getK() == mo1);
test(java.util.Arrays.equals(mo1.getBs(), new byte[] {(byte) 5}));
test(java.util.Arrays.equals(mo1.getSs(), new String[] {"test", "test2"}));
test(mo1.getIid().get(4) == 3);
Expand Down Expand Up @@ -164,7 +162,6 @@ public static InitialPrx allTests(test.TestHelper helper, boolean collocated) {
test(!mo4.hasH());
test(!mo4.hasI());
test(!mo4.hasJ());
test(!mo4.hasK());
test(!mo4.hasBs());
test(!mo4.hasSs());
test(!mo4.hasIid());
Expand Down Expand Up @@ -205,7 +202,6 @@ public static InitialPrx allTests(test.TestHelper helper, boolean collocated) {
test(mo5.getH().equals(mo1.getH()));
test(mo5.getI() == mo1.getI());
test(mo5.getJ().equals(mo1.getJ()));
test(mo5.getK() == mo5);
test(java.util.Arrays.equals(mo5.getBs(), mo1.getBs()));
test(java.util.Arrays.equals(mo5.getSs(), mo1.getSs()));
test(mo5.getIid().get(4) == 3);
Expand Down Expand Up @@ -259,7 +255,6 @@ public static InitialPrx allTests(test.TestHelper helper, boolean collocated) {
test(mo7.getH().equals(mo1.getH()));
test(!mo7.hasI());
test(mo7.getJ().equals(mo1.getJ()));
test(!mo7.hasK());
test(java.util.Arrays.equals(mo7.getBs(), mo1.getBs()));
test(!mo7.hasSs());
test(mo7.getIid().get(4) == 3);
Expand Down Expand Up @@ -289,7 +284,6 @@ public static InitialPrx allTests(test.TestHelper helper, boolean collocated) {
mo8.setE(mo5.getE());
mo8.setG(mo5.getG());
mo8.setI(mo5.getI());
mo8.setK(mo8);
mo8.setSs(mo5.getSs());
mo8.setSid(mo5.getSid());
mo8.setVs(mo5.getVs());
Expand All @@ -313,7 +307,6 @@ public static InitialPrx allTests(test.TestHelper helper, boolean collocated) {
test(!mo9.hasH());
test(mo9.getI() == mo1.getI());
test(!mo9.hasJ());
test(mo9.getK() == mo9);
test(!mo9.hasBs());
test(java.util.Arrays.equals(mo9.getSs(), mo1.getSs()));
test(!mo9.hasIid());
Expand Down
1 change: 0 additions & 1 deletion java/test/src/main/java/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class MultiOptional
optional(8) string h;
optional(9) MyEnum i;
optional(10) MyInterface* j;
optional(11) MultiOptional k;
optional(12) ByteSeq bs;
optional(13) StringSeq ss;
optional(14) IntIntDict iid;
Expand Down
1 change: 0 additions & 1 deletion java/test/src/main/java/test/Ice/optional/TestAMD.ice
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class MultiOptional
optional(8) string h;
optional(9) MyEnum i;
optional(10) MyInterface* j;
optional(11) MultiOptional k;
optional(12) ByteSeq bs;
optional(13) StringSeq ss;
optional(14) IntIntDict iid;
Expand Down
6 changes: 0 additions & 6 deletions js/test/Ice/optional/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
test(mo4.h === undefined);
test(mo4.i === undefined);
test(mo4.j === undefined);
test(mo4.k === undefined);
test(mo4.bs === undefined);
test(mo4.ss === undefined);
test(mo4.iid === undefined);
Expand Down Expand Up @@ -88,7 +87,6 @@
mo1.h = "test";
mo1.i = Test.MyEnum.MyEnumMember;
mo1.j = communicator.stringToProxy("test");
mo1.k = mo1;
mo1.bs = new Uint8Array([5]);
mo1.ss = ["test", "test2"];
mo1.iid = new Map();
Expand Down Expand Up @@ -132,7 +130,6 @@
test(mo1.h == mo5.h);
test(mo1.i == mo5.i);
test(mo1.j.equals(mo5.j));
test(mo5.k == mo5);
test(ArrayUtil.equals(mo5.bs, mo1.bs));
test(ArrayUtil.equals(mo5.ss, mo1.ss));
test(mo5.iid.get(4) == 3);
Expand Down Expand Up @@ -182,7 +179,6 @@
test(mo7.h == mo1.h);
test(mo7.i === undefined);
test(mo7.j.equals(mo1.j));
test(mo7.k === undefined);
test(ArrayUtil.equals(mo7.bs, mo1.bs));
test(mo7.ss === undefined);
test(mo7.iid.get(4) == 3);
Expand Down Expand Up @@ -211,7 +207,6 @@
mo8.e = mo1.e;
mo8.g = mo1.g;
mo8.i = mo1.i;
mo8.k = mo8;
mo8.ss = mo1.ss;
mo8.sid = mo1.sid;
mo8.vs = mo1.vs;
Expand All @@ -236,7 +231,6 @@
test(mo9.h === undefined);
test(mo9.i == mo1.i);
test(mo9.j === undefined);
test(mo9.k == mo9);
test(mo9.bs === undefined);
test(ArrayUtil.equals(mo9.ss, mo1.ss));
test(mo9.iid === undefined);
Expand Down
1 change: 0 additions & 1 deletion js/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class MultiOptional
optional(8) string h;
optional(9) MyEnum i;
optional(10) MyInterface* j;
optional(11) MultiOptional k;
optional(12) ByteSeq bs;
optional(13) StringSeq ss;
optional(14) IntIntDict iid;
Expand Down
11 changes: 1 addition & 10 deletions matlab/test/Ice/optional/AllTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
assert(mo1.h == Ice.Unset);
assert(mo1.i == Ice.Unset);
assert(mo1.j == Ice.Unset);
assert(mo1.k == Ice.Unset);
assert(mo1.bs == Ice.Unset);
assert(mo1.ss == Ice.Unset);
assert(mo1.iid == Ice.Unset);
Expand Down Expand Up @@ -77,7 +76,7 @@
imipd(5) = MyInterfacePrx.uncheckedCast(communicator.stringToProxy('test'));
mo1 = MultiOptional(15, true, 19, 78, 99, 5.5, 1.0, 'test', MyEnum.MyEnumMember, ...
MyInterfacePrx.uncheckedCast(communicator.stringToProxy('test')), ...
[], [5], {'test', 'test2'}, iid, sid, fs, vs, [1], ...
[5], {'test', 'test2'}, iid, sid, fs, vs, [1], ...
[MyEnum.MyEnumMember, MyEnum.MyEnumMember], ...
[ fs ], [ vs ], oos, { MyInterfacePrx.uncheckedCast(communicator.stringToProxy('test')) }, ...
ied, ifsd, ivsd, iood, imipd, [false, true, false], []);
Expand All @@ -92,7 +91,6 @@
assert(strcmp(mo1.h, 'test'));
assert(mo1.i == MyEnum.MyEnumMember);
assert(mo1.j == communicator.stringToProxy('test'));
assert(isempty(mo1.k));
assert(mo1.bs == [5])
assert(isequal(mo1.ss, {'test', 'test2'}));
assert(mo1.iid(4) == 3);
Expand Down Expand Up @@ -144,7 +142,6 @@
assert(mo4.h == Ice.Unset);
assert(mo4.i == Ice.Unset);
% assert(mo4.j == Ice.Unset);
assert(mo4.k == Ice.Unset);
assert(mo4.bs == Ice.Unset);
assert(mo4.ss == Ice.Unset);
assert(mo4.iid == Ice.Unset);
Expand Down Expand Up @@ -178,9 +175,6 @@
assert(strcmp(mo5.h, mo1.h));
assert(mo5.i == mo1.i);
assert(mo5.j == mo1.j);
% With the Swift mapping you cannot distinguish null from an
% unset optional, so we test for both to support cross-testing.
assert(isempty(mo5.k) || mo5.k == Ice.Unset);
assert(mo5.bs(1) == 5);
assert(isequal(mo5.ss, mo1.ss));
assert(mo5.iid(4) == 3);
Expand Down Expand Up @@ -230,7 +224,6 @@
assert(strcmp(mo7.h, mo1.h));
assert(mo7.i == Ice.Unset);
assert(mo7.j == mo1.j);
assert(mo7.k == Ice.Unset);
assert(mo7.bs(1) == 5);
assert(mo7.ss == Ice.Unset);
assert(mo7.iid(4) == 3);
Expand Down Expand Up @@ -260,7 +253,6 @@
mo8.e = mo5.e;
mo8.g = mo5.g;
mo8.i = mo5.i;
mo8.k = mo8;
mo8.ss = mo5.ss;
mo8.sid = mo5.sid;
mo8.vs = mo5.vs;
Expand All @@ -284,7 +276,6 @@
assert(mo9.h == Ice.Unset);
assert(mo9.i == mo1.i);
% assert(mo9.j == Ice.Unset);
assert(mo9.k == mo9);
assert(mo9.bs == Ice.Unset);
assert(isequal(mo9.ss, mo1.ss));
assert(mo9.iid == Ice.Unset);
Expand Down
Loading
Loading