コード例 #1
0
        public void SaveAndLoad4()
        {
            NativeTypeDef t1 = new NativeTypeDef("t1");

            t1.RealType = new NativeBuiltinType(BuiltinType.NativeByte);

            var ns = new BasicSymbolStorage();

            ns.AddTypeDef(t1);

            NativeType rett1 = null;

            Assert.True(ns.TryGetType(t1.Name, out rett1));
            Assert.True(NativeTypeEqualityComparer.AreEqualRecursive(rett1, t1));
        }
コード例 #2
0
        public void SaveAndLoad1()
        {
            NativeStruct s1 = new NativeStruct("s1");

            s1.Members.Add(new NativeMember("m1", new NativeBuiltinType(BuiltinType.NativeFloat)));

            NativeStruct s2 = new NativeStruct("s2");

            s2.Members.Add(new NativeMember("m1", s1));

            var ns = new BasicSymbolStorage();

            ns.AddDefinedType(s2);

            NativeDefinedType rets2 = null;

            Assert.True(ns.TryGetGlobalSymbol(s2.Name, out rets2));
            Assert.NotNull(rets2);
            Assert.True(NativeTypeEqualityComparer.AreEqualRecursive(s2, rets2));
            Assert.True(NativeTypeEqualityComparer.AreEqualTopLevel(s2, rets2));
        }