ws2_32/tests: Use %u and %Iu in test_ipv6_cmsg instead of casting.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2021-09-29 00:40:52 -06:00 committed by Alexandre Julliard
parent e06f52eb00
commit f1bffc801f
1 changed files with 6 additions and 6 deletions

View File

@ -2032,11 +2032,11 @@ static void test_ipv6_cmsg(void)
ok(rc == sizeof(payload), "send failed, error %u\n", WSAGetLastError()); ok(rc == sizeof(payload), "send failed, error %u\n", WSAGetLastError());
rc = pWSARecvMsg(server, &msg, &count, NULL, NULL); rc = pWSARecvMsg(server, &msg, &count, NULL, NULL);
ok(!rc, "WSARecvMsg failed, error %u\n", WSAGetLastError()); ok(!rc, "WSARecvMsg failed, error %u\n", WSAGetLastError());
ok(count == sizeof(payload), "expected length %i, got %i\n", (INT)sizeof(payload), count); ok(count == sizeof(payload), "expected length %Iu, got %u\n", sizeof(payload), count);
ok(header->cmsg_level == IPPROTO_IPV6, "expected IPPROTO_IPV6, got %i\n", header->cmsg_level); ok(header->cmsg_level == IPPROTO_IPV6, "expected IPPROTO_IPV6, got %i\n", header->cmsg_level);
ok(header->cmsg_type == IPV6_HOPLIMIT, "expected IPV6_HOPLIMIT, got %i\n", header->cmsg_type); ok(header->cmsg_type == IPV6_HOPLIMIT, "expected IPV6_HOPLIMIT, got %i\n", header->cmsg_type);
ok(header->cmsg_len == sizeof(*header) + sizeof(INT), ok(header->cmsg_len == sizeof(*header) + sizeof(INT),
"expected length %i, got %i\n", (INT)(sizeof(*header) + sizeof(INT)), (INT)header->cmsg_len); "expected length %Iu, got %Iu\n", sizeof(*header) + sizeof(INT), header->cmsg_len);
ok(*int_data >= 32, "expected at least 32, got %i\n", *int_data); ok(*int_data >= 32, "expected at least 32, got %i\n", *int_data);
setsockopt(server, IPPROTO_IPV6, IPV6_HOPLIMIT, (const char *)&off, sizeof(off)); setsockopt(server, IPPROTO_IPV6, IPV6_HOPLIMIT, (const char *)&off, sizeof(off));
ok(!rc, "failed to clear IPV6_HOPLIMIT, error %u\n", WSAGetLastError()); ok(!rc, "failed to clear IPV6_HOPLIMIT, error %u\n", WSAGetLastError());
@ -2054,11 +2054,11 @@ static void test_ipv6_cmsg(void)
ok(rc == sizeof(payload), "send failed, error %u\n", WSAGetLastError()); ok(rc == sizeof(payload), "send failed, error %u\n", WSAGetLastError());
rc = pWSARecvMsg(server, &msg, &count, NULL, NULL); rc = pWSARecvMsg(server, &msg, &count, NULL, NULL);
ok(!rc, "WSARecvMsg failed, error %u\n", WSAGetLastError()); ok(!rc, "WSARecvMsg failed, error %u\n", WSAGetLastError());
ok(count == sizeof(payload), "expected length %i, got %i\n", (INT)sizeof(payload), count); ok(count == sizeof(payload), "expected length %Iu, got %u\n", sizeof(payload), count);
ok(header->cmsg_level == IPPROTO_IPV6, "expected IPPROTO_IPV6, got %i\n", header->cmsg_level); ok(header->cmsg_level == IPPROTO_IPV6, "expected IPPROTO_IPV6, got %i\n", header->cmsg_level);
ok(header->cmsg_type == IPV6_PKTINFO, "expected IPV6_PKTINFO, got %i\n", header->cmsg_type); ok(header->cmsg_type == IPV6_PKTINFO, "expected IPV6_PKTINFO, got %i\n", header->cmsg_type);
ok(header->cmsg_len == sizeof(*header) + sizeof(IN6_PKTINFO), ok(header->cmsg_len == sizeof(*header) + sizeof(IN6_PKTINFO),
"expected length %i, got %i\n", (INT)(sizeof(*header) + sizeof(IN6_PKTINFO)), (INT)header->cmsg_len); "expected length %Iu, got %Iu\n", sizeof(*header) + sizeof(IN6_PKTINFO), header->cmsg_len);
ok(!memcmp(&pkt_info->ipi6_addr, &localhost.sin6_addr, sizeof(IN6_ADDR)), "expected ::1\n"); ok(!memcmp(&pkt_info->ipi6_addr, &localhost.sin6_addr, sizeof(IN6_ADDR)), "expected ::1\n");
rc = setsockopt(server, IPPROTO_IPV6, IPV6_PKTINFO, (const char *)&off, sizeof(off)); rc = setsockopt(server, IPPROTO_IPV6, IPV6_PKTINFO, (const char *)&off, sizeof(off));
ok(!rc, "failed to clear IPV6_PKTINFO, error %u\n", WSAGetLastError()); ok(!rc, "failed to clear IPV6_PKTINFO, error %u\n", WSAGetLastError());
@ -2076,11 +2076,11 @@ static void test_ipv6_cmsg(void)
ok(rc == sizeof(payload), "send failed, error %u\n", WSAGetLastError()); ok(rc == sizeof(payload), "send failed, error %u\n", WSAGetLastError());
rc = pWSARecvMsg(server, &msg, &count, NULL, NULL); rc = pWSARecvMsg(server, &msg, &count, NULL, NULL);
ok(!rc, "WSARecvMsg failed, error %u\n", WSAGetLastError()); ok(!rc, "WSARecvMsg failed, error %u\n", WSAGetLastError());
ok(count == sizeof(payload), "expected length %i, got %i\n", (INT)sizeof(payload), count); ok(count == sizeof(payload), "expected length %Iu, got %u\n", sizeof(payload), count);
ok(header->cmsg_level == IPPROTO_IPV6, "expected IPPROTO_IPV6, got %i\n", header->cmsg_level); ok(header->cmsg_level == IPPROTO_IPV6, "expected IPPROTO_IPV6, got %i\n", header->cmsg_level);
ok(header->cmsg_type == IPV6_TCLASS, "expected IPV6_TCLASS, got %i\n", header->cmsg_type); ok(header->cmsg_type == IPV6_TCLASS, "expected IPV6_TCLASS, got %i\n", header->cmsg_type);
ok(header->cmsg_len == sizeof(*header) + sizeof(INT), ok(header->cmsg_len == sizeof(*header) + sizeof(INT),
"expected length %i, got %i\n", (INT)(sizeof(*header) + sizeof(INT)), (INT)header->cmsg_len); "expected length %Iu, got %Iu\n", sizeof(*header) + sizeof(INT), header->cmsg_len);
ok(*int_data == 0, "expected 0, got %i\n", *int_data); ok(*int_data == 0, "expected 0, got %i\n", *int_data);
rc = setsockopt(server, IPPROTO_IPV6, IPV6_RECVTCLASS, (const char *)&off, sizeof(off)); rc = setsockopt(server, IPPROTO_IPV6, IPV6_RECVTCLASS, (const char *)&off, sizeof(off));
ok(!rc, "failed to clear IPV6_RECVTCLASS, error %u\n", WSAGetLastError()); ok(!rc, "failed to clear IPV6_RECVTCLASS, error %u\n", WSAGetLastError());