[PATCH 0/1] MR3678: mscoree/tests: Catch expected exception in loadpaths.exe.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54202 I don't have a Windows 7 VM available to test (and I don't see them on Win11), but this should hopefully prevent the crash dialogs from popping up. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3678
From: Esme Povirk <esme(a)codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54202 --- dlls/mscoree/tests/loadpaths.exe.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/mscoree/tests/loadpaths.exe.cs b/dlls/mscoree/tests/loadpaths.exe.cs index 22c32603c59..5d4806ddbfc 100644 --- a/dlls/mscoree/tests/loadpaths.exe.cs +++ b/dlls/mscoree/tests/loadpaths.exe.cs @@ -16,13 +16,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +using System; + namespace LoadPaths { public static class Test { static int Main(string[] args) { - return new Test2().Foo(); + try { + return new Test2().Foo(); + } + catch (Exception e) { + Console.WriteLine(e); + return 1; + } } } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3678
Still crashes on w7pro64 (64-bit exe): https://testbot.winehq.org/JobDetails.pl?Key=136810&s901=1#k901 (I'm not knowledgeable enough on mscoree so I don't know if this is actually testbot/CI problem or not.) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3678#note_43729
A StackOverflow post[^so] says `TypeLoadException` is thrown *before* the method body is even executed. Maybe you want a separate method, or even an own class? [^so]: <https://stackoverflow.com/questions/3346740/typeloadexception-is-not-caught-by-try-catch> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3678#note_43730
Oh, thanks, I didn't realize you could check that way. I'll try that. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3678#note_43731
participants (3)
-
Esme Povirk -
Esme Povirk (@madewokherd) -
Jinoh Kang (@iamahuman)