Fix stress test: move reset_test_data() outside loop

- Move reset_test_data() and error count resets outside the main loop
- This prevents sent_count from being reset each iteration
- The test was incorrectly resetting counters for each packet, causing sent_count to always be 1
This commit is contained in:
jek committed 2026-01-14 15:55:58 +04:00
1 parent 74249cbeb2
commit 939bf00a0c
1 file changed
+4 -4
+4 -4
View File
@@ -290,11 +290,11 @@ static int test_stress_random(pkt_normalizer_pair* pair) {
/* Часть 1: 10000 случайных пакетов без изменения размера фрагмента */
printf("Sending %d random packets...\n", NUM_PACKETS);
reset_test_data();
pkt_normalizer_reset_error_count(pair->packer);
pkt_normalizer_reset_error_count(pair->unpacker);
for (int i = 0; i < NUM_PACKETS; i++) {
reset_test_data();
pkt_normalizer_reset_error_count(pair->packer);
pkt_normalizer_reset_error_count(pair->unpacker);
/* Случайный размер пакета от 0 до MAX_PACKET_SIZE */
size_t size = rand() % (MAX_PACKET_SIZE + 1);