Spdk/test/unit/lib/util
Shuhei Matsumoto ded6d2c7f2 lib/util: Add spdk_sn32_lt/gt() to compare two numbers based on serial number arithmetic
Previously the macro SN32_LT and SN32_GT had been added to iSCSI
library. But such comparisons may be used in other libraries.
So add two inline helper functions spdk_sn32_lt() and spdk_sn32_gt()
to include/spdk/util.h.

Add unit test for these functions. These functions are located in
header file but math.c is the place if they are located in source file.
Hence add unit test as the one for math.c.

The next patch replaces the macro SN32_LT and SN32_GT by
spdk_sn32_lt() and spdk_sn32_gt() in iSCSI library, respectively.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id3e4d80fea98ad4ae1516e27b9c9e8ec6f37e7a8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1346
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-19 08:51:31 +00:00
..
base64.c util/base64: Extend b64 decode to calculate exact len 2020-02-03 11:39:49 +00:00
bit_array.c test: use test_env for bit_array_ut 2019-02-11 09:30:27 +00:00
cpuset.c test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
crc16.c test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
crc32_ieee.c test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
crc32c.c test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
dif.c dif: Add spdk_dix_remap_ref_tag to remap ref. tag for separate metadata payload 2019-07-11 11:14:22 +00:00
iov.c util: Add spdk_iovcpy, an iovec to iovec copy function. 2019-11-20 09:35:32 +00:00
math.c lib/util: Add spdk_sn32_lt/gt() to compare two numbers based on serial number arithmetic 2020-03-19 08:51:31 +00:00
pipe.c pipe: Add a utility for buffering data from sockets 2019-11-20 09:35:32 +00:00
string.c test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
Makefile lib/util: Add spdk_sn32_lt/gt() to compare two numbers based on serial number arithmetic 2020-03-19 08:51:31 +00:00