tests: fix bihash unittest error reporting 23/35923/2
authorJing Peng <[email protected]>
Fri, 8 Apr 2022 18:19:32 +0000 (14:19 -0400)
committerDamjan Marion <[email protected]>
Mon, 11 Apr 2022 10:07:19 +0000 (10:07 +0000)
commitc520dcb49fa07d30de4944344b66fc325b44f17d
tree20d1d85252da29e9e7123b23112dc5e4c2ac7f3c
parentc73984a0fcc8229e698c315524067e8aa3673b48
tests: fix bihash unittest error reporting

This patch fixes test_bihash_unittest in two ways:

1. The number of searches, namely tm->search_iter, defaults to 0,
thus disabling the test. This patch changes the default to 1.

2. Test errors are reported by clib_warning() instead of being
returned, thus the caller test/test_bihash.py  is never aware of them.
This patch returns the errors constructed by clib_error_return().

Type: fix

Signed-off-by: Jing Peng <[email protected]>
Change-Id: I60e99a829ebe6aa2a56e7a9332cf973afa100311
src/plugins/unittest/bihash_test.c