unit: speed up test_pbuf_queueing_bigger_than_64k

Speed up test_pbuf_queueing_bigger_than_64k by using memcmp rather than
a byte by byte comparision. This allows using word aligned compares
within the memcmp implementation

This fixes a unit test timeout on my Windows 10 box with WSL which was
taking longer than 4 seconds for the unix port unit test to complete

See failure details in https://savannah.nongnu.org/patch/index.php?9579
This commit is contained in:
Joel Cunningham 2018-03-03 17:43:23 -06:00
parent 91038e4979
commit b1258bf8e6

View File

@ -161,12 +161,9 @@ START_TEST(test_pbuf_queueing_bigger_than_64k)
pbuf_copy_partial(p1, testbuf_1a, TESTBUFSIZE_1, 0);
pbuf_copy_partial(rest2, testbuf_2a, TESTBUFSIZE_2, 0);
pbuf_copy_partial(rest3, testbuf_3a, TESTBUFSIZE_3, 0);
for(i = 0; i < TESTBUFSIZE_1; i++)
fail_unless(testbuf_1[i] == testbuf_1a[i]);
for(i = 0; i < TESTBUFSIZE_2; i++)
fail_unless(testbuf_2[i] == testbuf_2a[i]);
for(i = 0; i < TESTBUFSIZE_3; i++)
fail_unless(testbuf_3[i] == testbuf_3a[i]);
fail_if(memcmp(testbuf_1, testbuf_1a, TESTBUFSIZE_1));
fail_if(memcmp(testbuf_2, testbuf_2a, TESTBUFSIZE_2));
fail_if(memcmp(testbuf_3, testbuf_3a, TESTBUFSIZE_3));
pbuf_free(p1);
pbuf_free(rest2);