Exemplo n.º 1
0
        public void AddTypeDef2()
        {
            NativeSymbolBag bag = new NativeSymbolBag();
            NativeTypeDef   td1 = new NativeTypeDef("td1");
            NativeTypeDef   td2 = new NativeTypeDef("td2");

            bag.AddTypeDef(td1);
            bag.AddTypeDef(td2);

            NativeType ret1 = null;
            NativeType ret2 = null;

            Assert.True(bag.TryGetType(td1.DisplayName, out ret1));
            Assert.Same(ret1, td1);
            Assert.True(bag.TryGetType(td2.DisplayName, out ret2));
            Assert.Same(ret2, td2);
        }
Exemplo n.º 2
0
        public void AddDefinedTypeTest2()
        {
            NativeSymbolBag bag        = new NativeSymbolBag();
            NativeStruct    definedNt1 = new NativeStruct("s1");
            NativeStruct    definedNt2 = new NativeStruct("s2");

            bag.AddDefinedType(definedNt1);
            bag.AddDefinedType(definedNt2);

            NativeType ret1 = null;
            NativeType ret2 = null;

            Assert.True(bag.TryGetType(definedNt1.DisplayName, out ret1));
            Assert.True(bag.TryGetType(definedNt2.DisplayName, out ret2));
            Assert.Same(ret1, definedNt1);
            Assert.Same(ret2, definedNt2);
        }
Exemplo n.º 3
0
        public void Storage1()
        {
            NativeSymbolBag bag = new NativeSymbolBag(StorageFactory.CreateStandard());

            NativeType nt = null;

            Assert.True(bag.TryGetType("RecursiveStruct", out nt));
        }
Exemplo n.º 4
0
        public void AddMixed2()
        {
            NativeSymbolBag bag        = new NativeSymbolBag();
            NativeStruct    definedNt1 = new NativeStruct("s1");

            bag.AddDefinedType(definedNt1);
            NativeTypeDef td1 = new NativeTypeDef("s1");

            bag.AddTypeDef(td1);

            NativeType ret = null;

            Assert.True(bag.TryGetType(definedNt1.DisplayName, out ret));
            Assert.Same(definedNt1, ret);
            Assert.True(bag.TryGetType(td1.DisplayName, out ret));
            Assert.Same(definedNt1, ret);
        }