Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
 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));
 }
Exemplo n.º 4
0
 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));
 }