Re: Runtime errors with testglib.exe (Win32 build)




On 7 Oct 2010, at 10:10, Tor Lillqvist wrote:

That is a problem in the C library then, that it generates "debug
assertions" for something that is perfectly legal like close(-1).
Calling close() on a value that is not an open file descriptor is
pointless, but not an error.

But yeah, we could check that in testglib.c and don't call close() on
-1.  Committed and pushed to master and glib-2-26.

Thanks Tor.  I've modified the code similarly at my end.  FWIW the debug version of Microsoft's close() 
function specifically checks that the file handle is non-negative and that it's equal to or less than the 
highest known file handle value.  It asserts if either condition fails.  The release version simply sets 
errno to EBADF and returns -1.

My tests are now running fine except for the "Warnings and Errors" test where I see the following output:-

Glib-Message: Not implemented: g_test_trap_fork

Again, it'd be helpful to know if this is expected behaviour or if it indicates a problem with my build.  
Thanks.

John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]