diff options
| author | Joel Cunningham <[email protected]> | 2018-03-03 17:43:23 -0600 |
|---|---|---|
| committer | Joel Cunningham <[email protected]> | 2018-03-03 17:43:23 -0600 |
| commit | b1258bf8e64d1bd71bbcbd33af0e5da2262e5a78 (patch) | |
| tree | 01c9ba014bbac6d63a94a0c1c4be59d377403a9e /test | |
| parent | 91038e497907b6910e9d91b3e1e87199219b4453 (diff) | |
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
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/core/test_pbuf.c | 9 |
1 files 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); |
