[Test] //mapping(uint=>mapping(uint=>SimpleStruct)) complexMap; //8 public void TestComplexMap() { /* * complexMap[1][2] = SimpleStruct(12, "complex struct 1 2"); * complexMap[2][2] = SimpleStruct(22, "complex struct 2 2"); */ TestUtility.CheckMapItem("1,2", TestUtility.StructCheckFunction, variableList[8 + startInd], new TestUtility.CheckValues { parentName = "complexMap", nameValues = new List <TestUtility.NameValues> { { new TestUtility.NameValues { Name = "simpleStructVal", Value = "12" } }, { new TestUtility.NameValues { Name = "simpleStructString", Value = "complex struct 1 2" } } } }); TestUtility.CheckMapItem("2,2", TestUtility.StructCheckFunction, variableList[8 + startInd], new TestUtility.CheckValues { parentName = "complexMap", nameValues = new List <TestUtility.NameValues> { { new TestUtility.NameValues { Name = "simpleStructVal", Value = "22" } }, { new TestUtility.NameValues { Name = "simpleStructString", Value = "complex struct 2 2" } } } }); }
[Test]// mapping(uint=>uint) simpleMap; //6 public void TestSimpleMap() { /* * simpleMap[4] = 42; * simpleMap[8] = 42; * simpleMap[10] = 42;*/ TestUtility.CheckMapItem("4", TestUtility.CheckValueFunction, variableList[6 + startInd], new TestUtility.CheckValues { parentName = "simpleMap", value = "42" }); TestUtility.CheckMapItem("8", TestUtility.CheckValueFunction, variableList[6 + startInd], new TestUtility.CheckValues { parentName = "simpleMap", value = "42" }); TestUtility.CheckMapItem("10", TestUtility.CheckValueFunction, variableList[6 + startInd], new TestUtility.CheckValues { parentName = "simpleMap", value = "42" }); }
[Test] //mapping(uint=>SimpleStruct) structMap; //7 public void TestStructMap() { TestUtility.CheckMapItem("4", TestUtility.StructCheckFunction, variableList[7 + startInd], new TestUtility.CheckValues { parentName = "structMap", nameValues = new List <TestUtility.NameValues> { { new TestUtility.NameValues { Name = "simpleStructVal", Value = "14" } }, { new TestUtility.NameValues { Name = "simpleStructString", Value = "mapping struct 1" } } } }); TestUtility.CheckMapItem("1", TestUtility.StructCheckFunction, variableList[7 + startInd], new TestUtility.CheckValues { parentName = "structMap", nameValues = new List <TestUtility.NameValues> { { new TestUtility.NameValues { Name = "simpleStructVal", Value = "21" } }, { new TestUtility.NameValues { Name = "simpleStructString", Value = "mapping struct 2" } } } }); }