public void HasNoCoincidentFields() { StructureType s = new StructureType(null, 0); s.Fields.Add(4, new TypeVariable(1)); s.Fields.Add(5, PrimitiveType.Word16); Assert.AreEqual(2, s.Fields.Count); TypeTransformer trans = new TypeTransformer(factory, null, null); Assert.IsFalse(trans.HasCoincidentFields(s)); }
public void HasCoincidentFields() { StructureType s = new StructureType(null, 0); s.Fields.Add(4, new TypeVariable(1)); s.Fields.Add(4, PrimitiveType.Word16); Assert.AreEqual(2, s.Fields.Count); TypeTransformer trans = new TypeTransformer(factory, null, null); Assert.IsTrue(trans.HasCoincidentFields(s)); }
public void HasCoincidentUnion() { var eq = new EquivalenceClass( new TypeVariable(42), new UnionType(null, null, PrimitiveType.SegPtr32, PrimitiveType.Word16)); var s = new StructureType(null, 0) { Fields = { { 0, eq }, { 0, PrimitiveType.SegmentSelector } } }; TypeTransformer trans = new TypeTransformer(factory, null, null); Assert.IsTrue(trans.HasCoincidentFields(s)); }