diff options
author | Brian Taylor <brian.taylor@unity3d.com> | 2019-11-20 17:38:21 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2019-11-20 19:44:34 +0300 |
commit | 3b329b9481e300bcf4fb88a2eebf8cb5ef8b323b (patch) | |
tree | 91ff4cfb38f4eace3d359df0d14022c1fe4fe9ff /test/Mono.Linker.Tests | |
parent | e7a196d3bd5a8ec64f617674e5d0f8de61b1ac81 (diff) |
Resolve interfaces when checking KeptInterface attribute so that generic interfaces can be marked. First check unresolved interface type, if not found, check resolved interface type.
Diffstat (limited to 'test/Mono.Linker.Tests')
-rw-r--r-- | test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs b/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs index 1e262efa0..11fae84e6 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs @@ -171,8 +171,10 @@ namespace Mono.Linker.Tests.TestCasesRunner { if (expectedInterfaces.Count == 0) { Assert.IsFalse (linked.HasInterfaces, $"Type `{src}' has unexpected interfaces"); } else { - foreach (var iface in linked.Interfaces) { - Assert.IsTrue (expectedInterfaces.Remove (iface.InterfaceType.FullName), $"Type `{src}' interface `{iface.InterfaceType.FullName}' should have been removed"); + foreach (var iface in linked.Interfaces) { + if (!expectedInterfaces.Remove(iface.InterfaceType.FullName)) { + Assert.IsTrue (expectedInterfaces.Remove (iface.InterfaceType.Resolve().FullName), $"Type `{src}' interface `{iface.InterfaceType.Resolve().FullName}' should have been removed"); + } } Assert.IsEmpty (expectedInterfaces, $"Unexpected interfaces on {src}"); |