Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/coreclr/tools/ILVerification.Tests/VerificationResultTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Globalization;
using System.Linq;
using System.Resources;
using ILVerify;
using Xunit;

Expand All @@ -17,5 +21,16 @@ public static void ArgumentLookupOnResultWithoutArguments()
Assert.Equal(0, offset);
Assert.Equal(0, result.GetArgumentValue<int>("Offset"));
}

[Fact]
public static void EveryErrorHasMessage()
{
// Verifier looks up the message of an error by its name, and falls back to the name.
var strings = new ResourceManager("ILVerification.Strings", typeof(Verifier).Assembly);
VerifierError[] missing = Enum.GetValues<VerifierError>()
.Where(e => e != VerifierError.None && string.IsNullOrEmpty(strings.GetString(e.ToString(), CultureInfo.InvariantCulture)))
.ToArray();
Assert.Empty(missing);
}
}
}
5 changes: 4 additions & 1 deletion src/coreclr/tools/ILVerification/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
<data name="InitOnly" xml:space="preserve">
<value>Cannot change initonly field outside its .ctor.</value>
</data>
<data name="LdftnConstructor" xml:space="preserve">
<data name="LdftnCtor" xml:space="preserve">
<value>ldftn/ldvirtftn not allowed on .ctor.</value>
</data>
<data name="LdftnNonFinalVirtual" xml:space="preserve">
Expand Down Expand Up @@ -408,6 +408,9 @@
<data name="TailRetVoid" xml:space="preserve">
<value>Void ret type expected for tail call.</value>
</data>
<data name="TailStackEmpty" xml:space="preserve">
<value>Stack not empty after tail call.</value>
</data>
<data name="ThisMismatch" xml:space="preserve">
<value>The 'this' parameter to the call must be the calling method's 'this' parameter.</value>
</data>
Expand Down
Loading