Beispiel #1
0
        public static BasicSymbolStorage ToBasicSymbolStorage(this INativeSymbolLookup lookup)
        {
            var storage = new BasicSymbolStorage();

            foreach (var name in lookup.NativeNames)
            {
                var symbol = lookup.GetGlobalSymbol(name);
                storage.Add(symbol);
            }
            return(storage);
        }
Beispiel #2
0
        public void Write(INativeSymbolLookup lookup)
        {
            foreach (var name in lookup.NativeNames)
            {
                if (name.Kind == NativeNameKind.EnumValue)
                {
                    continue;
                }

                Write(lookup.GetGlobalSymbol(name));
            }
        }
Beispiel #3
0
            internal override void Write(INativeSymbolLookup lookup)
            {
                foreach (var name in lookup.NativeNames)
                {
                    if (name.Kind == NativeNameKind.EnumValue)
                    {
                        continue;
                    }

                    _storage.Add(lookup.GetGlobalSymbol(name));
                }
            }
Beispiel #4
0
        private void TestRoundTrip(INativeSymbolLookup lookup)
        {
            foreach (var util in _utilList)
            {
                util.Write(lookup);
                var storage = util.Read();
                foreach (var name in lookup.NativeNames)
                {
                    if (name.Kind == NativeNameKind.EnumValue)
                    {
                        continue;
                    }

                    var symbol = lookup.GetGlobalSymbol(name);
                    NativeGlobalSymbol other;

                    if (!storage.TryGetGlobalSymbol(name, out other))
                    {
                    }
                    Assert.True(storage.TryGetGlobalSymbol(name, out other));
                    Assert.Equal(SymbolPrinter.Convert(symbol.Symbol), SymbolPrinter.Convert(other.Symbol));
                }
            }
        }