mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-28 00:41:27 +00:00
Fix gcc warning -Wsizeof-pointer-memaccess in test
This commit is contained in:
parent
46a3d82639
commit
b0e41e82e4
|
@ -159,8 +159,8 @@ START_TEST(test_decode_response)
|
||||||
memset(&buf, 0, sizeof(buf));
|
memset(&buf, 0, sizeof(buf));
|
||||||
|
|
||||||
ret = dns_decode(buf, len, &q, QR_ANSWER, answer_packet, sizeof(answer_packet)-1);
|
ret = dns_decode(buf, len, &q, QR_ANSWER, answer_packet, sizeof(answer_packet)-1);
|
||||||
fail_unless(strncmp(msgData, buf, sizeof(msgData)) == 0, "Did not extract expected data");
|
|
||||||
fail_unless(ret == strlen(msgData), "Bad data length: %d, expected %d", ret, strlen(msgData));
|
fail_unless(ret == strlen(msgData), "Bad data length: %d, expected %d", ret, strlen(msgData));
|
||||||
|
fail_unless(strncmp(msgData, buf, strlen(msgData)) == 0, "Did not extract expected data");
|
||||||
fail_unless(q.id == 0x0539);
|
fail_unless(q.id == 0x0539);
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
@ -176,8 +176,8 @@ START_TEST(test_decode_response_with_high_trans_id)
|
||||||
memset(&buf, 0, sizeof(buf));
|
memset(&buf, 0, sizeof(buf));
|
||||||
|
|
||||||
ret = dns_decode(buf, len, &q, QR_ANSWER, answer_packet_high_trans_id, sizeof(answer_packet_high_trans_id)-1);
|
ret = dns_decode(buf, len, &q, QR_ANSWER, answer_packet_high_trans_id, sizeof(answer_packet_high_trans_id)-1);
|
||||||
fail_unless(strncmp(msgData, buf, sizeof(msgData)) == 0, "Did not extract expected data");
|
|
||||||
fail_unless(ret == strlen(msgData), "Bad data length: %d, expected %d", ret, strlen(msgData));
|
fail_unless(ret == strlen(msgData), "Bad data length: %d, expected %d", ret, strlen(msgData));
|
||||||
|
fail_unless(strncmp(msgData, buf, strlen(msgData)) == 0, "Did not extract expected data");
|
||||||
fail_unless(q.id == 0x8539, "q.id was %08X instead of %08X!", q.id, 0x8539);
|
fail_unless(q.id == 0x8539, "q.id was %08X instead of %08X!", q.id, 0x8539);
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
Loading…
Reference in a new issue