It is really unclear what this test is supposed to test. Commit 6b64af4a38 
where it was added simply states "Add some new testcases for crt."
________________________________
From: Pali Rohár <[email protected]>
Sent: Saturday, November 1, 2025 7:32 AM
To: Kirill Makurin <[email protected]>
Cc: [email protected] 
<[email protected]>
Subject: Re: [Mingw-w64-public] [PATCH] crt: Disable the program crash dialog 
for t_nullptrexception test

I agree with you that tests should pass.

I'm really not sure what was the idea behind the t_nullptrexception
test, but for me it looks like that it checks that the WinAPI raised
exception cause test failure.

On Friday 31 October 2025 22:26:38 Kirill Makurin wrote:
> I wonder if it would be more appropriate to avoid marking tests like
> this as XFAIL and instead make them PASS.
>
> Maybe we could set a signal handle for SIGSEGV and make it call
> `_exit(0)` and make `main` return 1?
>
> I'm currently writing testsuite for library I'm working on and I have
> tests which test unrecoverable situations which must terminate the
> process. The issue with marking such tests with XFAIL is that they may
> fail for another reason, but since they are XFAIL they will be
> considered to be OK.
>
> While this particular test is very simple and nothing should go wrong, I
> think it is a good idea to make tests PASS instead of XFAIL whenever
> possible.
>
> - Kirill Makurin
>
> On 10/26/2025 12:45 AM, Pali Rohár wrote:
> &gt; Test t_nullptrexception is expected to crash.
> &gt; ---
> &gt;   mingw-w64-crt/testcases/t_nullptrexception.c | 2 ++
> &gt;   1 file changed, 2 insertions(+)
> &gt;
> &gt; diff --git a/mingw-w64-crt/testcases/t_nullptrexception.c 
> b/mingw-w64-crt/testcases/t_nullptrexception.c
> &gt; index 3c2c47adee7a..cc93c49745ff 100644
> &gt; --- a/mingw-w64-crt/testcases/t_nullptrexception.c
> &gt; +++ b/mingw-w64-crt/testcases/t_nullptrexception.c
> &gt; @@ -1,9 +1,11 @@
> &gt;   #include
> &gt; +#include
> &gt;
> &gt;   char *p = NULL;
> &gt;
> &gt;   int main()
> &gt;   {
> &gt; +  SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
> &gt;     printf ("Raise uncaught NULL pointer exception...\n");
> &gt;     *p = 0;
> &gt;     return 0;

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to