// ********************************************************************** // // Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** using System.Collections.Generic; using Test; class Twoways { private static void test(bool b) { if(!b) { throw new System.Exception(); } } internal static void twoways(Ice.Communicator communicator, Test.MyClassPrx p) { { Dictionary i = new Dictionary(); i[0] = 1; i[1] = 0; Dictionary o; Dictionary r; r = p.opNV(i, out o); test(Ice.CollectionComparer.Equals(i, o)); test(Ice.CollectionComparer.Equals(i, r)); } { Dictionary i = new Dictionary(); i["a"] = "b"; i["b"] = "a"; Dictionary o; Dictionary r; r = p.opNR(i, out o); test(Ice.CollectionComparer.Equals(i, o)); test(Ice.CollectionComparer.Equals(i, r)); } { Dictionary> i = new Dictionary>(); Dictionary id = new Dictionary(); id[0] = 1; id[1] = 0; i["a"] = id; i["b"] = id; Dictionary> o; Dictionary> r; r = p.opNDV(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { Dictionary> i = new Dictionary>(); Dictionary id = new Dictionary(); id["a"] = "b"; id["b"] = "a"; i["a"] = id; i["b"] = id; Dictionary> o; Dictionary> r; r = p.opNDR(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { OV i = new OV(); i[0] = 1; i[1] = 0; OV o; OV r; r = p.opOV(i, out o); test(OV.Equals(i, o)); test(OV.Equals(i, r)); } { OR i = new OR(); i["a"] = "b"; i["b"] = "a"; OR o; OR r; r = p.opOR(i, out o); test(OR.Equals(i, o)); test(OR.Equals(i, r)); } { ODV i = new ODV(); OV id = new OV(); id[0] = 1; id[1] = 0; i["a"] = id; i["b"] = id; ODV o; ODV r; r = p.opODV(i, out o); test(ODV.Equals(i, o)); test(ODV.Equals(i, r)); } { ODR i = new ODR(); OR id = new OR(); id["a"] = "b"; id["b"] = "a"; i["a"] = id; i["b"] = id; ODR o; ODR r; r = p.opODR(i, out o); test(ODR.Equals(i, o)); test(ODR.Equals(i, r)); } { Dictionary i = new Dictionary(); OV iid = new OV(); iid[0] = 1; iid[1] = 0; ODV id = new ODV(); id["a"] = iid; id["b"] = iid; i["a"] = id; i["b"] = id; Dictionary o; Dictionary r; r = p.opNODV(i, out o); test(Ice.CollectionComparer.Equals(i, o)); test(Ice.CollectionComparer.Equals(i, r)); } { Dictionary i = new Dictionary(); OR iid = new OR(); iid["a"] = "b"; iid["a"] = "b"; ODR id = new ODR(); id["a"] = iid; id["b"] = iid; i["a"] = id; i["b"] = id; Dictionary o; Dictionary r; r = p.opNODR(i, out o); test(Ice.CollectionComparer.Equals(i, o)); test(Ice.CollectionComparer.Equals(i, r)); } { ONDV i = new ONDV(); Dictionary iid = new Dictionary(); iid[0] = 1; iid[1] = 0; Dictionary> id = new Dictionary>(); id["a"] = iid; id["b"] = iid; i["a"] = id; i["b"] = id; ONDV o; ONDV r; r = p.opONDV(i, out o); foreach(string key in i.Keys) { foreach(string s in i[key].Keys) { test(Ice.CollectionComparer.Equals(i[key][s], o[key][s])); test(Ice.CollectionComparer.Equals(i[key][s], r[key][s])); } } } { ONDR i = new ONDR(); Dictionary iid = new Dictionary(); iid["a"] = "b"; iid["b"] = "a"; Dictionary> id = new Dictionary>(); id["a"] = iid; id["b"] = iid; i["a"] = id; i["b"] = id; ONDR o; ONDR r; r = p.opONDR(i, out o); foreach(string key in i.Keys) { foreach(string s in i[key].Keys) { test(Ice.CollectionComparer.Equals(i[key][s], o[key][s])); test(Ice.CollectionComparer.Equals(i[key][s], r[key][s])); } } } { int[] ii = new int[] { 1, 2 }; Dictionary i = new Dictionary(); i["a"] = ii; i["b"] = ii; Dictionary o; Dictionary r; r = p.opNDAIS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { CIS ii = new CIS(); ii.Add(1); ii.Add(2); Dictionary i = new Dictionary(); i["a"] = ii; i["b"] = ii; Dictionary o; Dictionary r; r = p.opNDCIS(i, out o); test(Ice.CollectionComparer.Equals(i, o)); test(Ice.CollectionComparer.Equals(i, r)); } { List ii = new List(); ii.Add(1); ii.Add(2); Dictionary> i = new Dictionary>(); i["a"] = ii; i["b"] = ii; Dictionary> o; Dictionary> r; r = p.opNDGIS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { string[] ii = new string[] { "a", "b" }; Dictionary i = new Dictionary(); i["a"] = ii; i["b"] = ii; Dictionary o; Dictionary r; r = p.opNDASS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { CSS ii = new CSS(); ii.Add("a"); ii.Add("b"); Dictionary i = new Dictionary(); i["a"] = ii; i["b"] = ii; Dictionary o; Dictionary r; r = p.opNDCSS(i, out o); test(Ice.CollectionComparer.Equals(i, o)); test(Ice.CollectionComparer.Equals(i, r)); } { List ii = new List(); ii.Add("a"); ii.Add("b"); Dictionary> i = new Dictionary>(); i["a"] = ii; i["b"] = ii; Dictionary> o; Dictionary> r; r = p.opNDGSS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { int[] ii = new int[] { 1, 2 }; ODAIS i = new ODAIS(); i["a"] = ii; i["b"] = ii; ODAIS o; ODAIS r; r = p.opODAIS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { CIS ii = new CIS(); ii.Add(1); ii.Add(2); ODCIS i = new ODCIS(); i["a"] = ii; i["b"] = ii; ODCIS o; ODCIS r; r = p.opODCIS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { List ii = new List(); ii.Add(1); ii.Add(2); ODGIS i = new ODGIS(); i["a"] = ii; i["b"] = ii; ODGIS o; ODGIS r; r = p.opODGIS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { string[] ii = new string[] { "a", "b" }; ODASS i = new ODASS(); i["a"] = ii; i["b"] = ii; ODASS o; ODASS r; r = p.opODASS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { CSS ii = new CSS(); ii.Add("a"); ii.Add("b"); ODCSS i = new ODCSS(); i["a"] = ii; i["b"] = ii; ODCSS o; ODCSS r; r = p.opODCSS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } { List ii = new List(); ii.Add("a"); ii.Add("b"); ODGSS i = new ODGSS(); i["a"] = ii; i["b"] = ii; ODGSS o; ODGSS r; r = p.opODGSS(i, out o); foreach(string key in i.Keys) { test(Ice.CollectionComparer.Equals(i[key], o[key])); test(Ice.CollectionComparer.Equals(i[key], r[key])); } } } }