On Mo, 2009-04-27 at 20:48 +1000, Jeff Latimer wrote:
Do not use sizeof() in a test.
There is no reason, that the reader must guess from the log, if the result is a failure or an expected behavior. You should detect, that IPv6 is not available and handle that case nice.
if ((v6 == INVALID_SOCKET) && (WSAGetLastError() == WSAEAFNOSUPPORT)) { skip("IPv6 not supported on this system\n"); goto end; }
ok(v6 !== INVALID_SOCKET, "create an IPv6 socket failed with %d\n", WSAGetLastError());
if (v6 == INVALID_SOCKET) { skip("No IPv6 socket\n"); goto end; }
I know, that the same message is already in the current logs. That should be handled the same way.
Thanks for pick up IPv6
Hi Jeff, I just wanted to clarify one of Detlef's comments:
Using sizeof is okay, but printing the result of it is not, due to compile warnings this will introduce on some platforms. Basically, omit this change from your patch.
Thanks, --Juan