From b1258bf8e64d1bd71bbcbd33af0e5da2262e5a78 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Sat, 3 Mar 2018 17:43:23 -0600 Subject: [PATCH] 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 --- test/unit/core/test_pbuf.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/unit/core/test_pbuf.c b/test/unit/core/test_pbuf.c index 86b90b29..57087d22 100644 --- a/test/unit/core/test_pbuf.c +++ b/test/unit/core/test_pbuf.c @@ -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);