[tarantool-patches] Re: [PATCH v1 3/4] box: introduce bitmap_majority_test routine
Vladimir Davydov
vdavydov.dev at gmail.com
Sat Dec 29 19:16:59 MSK 2018
On Sat, Dec 29, 2018 at 04:57:00PM +0300, Kirill Shcherbatov wrote:
> +/**
> + * Return sizeof(unsigned long)-words aligned size of bitmap by
> + * bit_count - count of bits to set. Size must be aligned, as
> + * bit_sit/bit_clear operations use unsigned long words to setup
> + * bit.
> + */
Changed the comment to
/**
* @brief Returns the size of memory needed to store a bitmap
* of \a bit_count bits.
* The function rounds the size up to a multiple of the word
* size, which is required by bit_set() and bit_clear().
* @param bit_count number of bits in the bitmap
* @retval bitmap size, in bytes
*/
(used doxygen, because all other comments in the file are formated in
the same way)
> +1..5
> +ok 1 - empty bitmap: have 0 expected 0
> +ok 2 - 1-item bitmap: have 8 expected 8
> +ok 3 - 4-items bitmap: have 8 expected 8
> +ok 4 - 64-items bitmap: have 8 expected 8
> +ok 5 - 65-items bitmap: have 16 expected 16
> + *** test_bitmap: done ***
OK, now I see why you used fail_unless in the previous version - because
all other tests in the file use it. Then you should've told me that
instead of blindly following my instructions - I can make mistakes too.
Changed the test back to fail_unless for consistency and pushed the
patch to 2.1.
More information about the Tarantool-patches
mailing list