Beispiel #1
0
        public void Dig4()
        {
            NativePointer pt = new NativePointer(BuiltinType.NativeByte);

            Assert.Same(pt, pt.DigThroughTypeDefAndNamedTypes());

            NativeTypeDef td = new NativeTypeDef("foo", pt);

            Assert.Same(pt, td.DigThroughTypeDefAndNamedTypes());
        }
Beispiel #2
0
        public void Dig1()
        {
            NativeTypeDef td = new NativeTypeDef("foo");

            td.RealType = new NativeBuiltinType(BuiltinType.NativeByte);
            Assert.Same(td.RealType, td.DigThroughTypeDefAndNamedTypes());

            NativeTypeDef outerTd = new NativeTypeDef("bar");

            outerTd.RealType = td;
            Assert.Same(td.RealType, outerTd.DigThroughTypeDefAndNamedTypes());
        }
Beispiel #3
0
        public void Dig6()
        {
            NativeNamedType named = new NativeNamedType("bar", new NativeTypeDef("td1", BuiltinType.NativeFloat));
            NativeTypeDef   td    = new NativeTypeDef("foo", named);

            Assert.Equal(NativeSymbolKind.TypeDefType, td.DigThroughTypeDefAndNamedTypesFor("foo").Kind);
            Assert.Same(td, td.DigThroughTypeDefAndNamedTypesFor("foo"));
            Assert.Equal(NativeSymbolKind.BuiltinType, td.DigThroughTypeDefAndNamedTypes().Kind);
            Assert.Equal(NativeSymbolKind.NamedType, td.DigThroughTypeDefAndNamedTypesFor("bar").Kind);

            NativeNamedType named2 = new NativeNamedType("named2", td);

            Assert.Equal(NativeSymbolKind.TypeDefType, named2.DigThroughNamedTypesFor("foo").Kind);
            Assert.Null(named2.DigThroughNamedTypesFor("bar"));
        }