From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sat, 29 Dec 2018 19:16:59 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH v1 3/4] box: introduce bitmap_majority_test routine Message-ID: <20181229161659.7iuzitab2zq2bomw@esperanza> References: <20181227185906.redzzw3hbugxasb6@esperanza> <220114e4-6639-fbe0-e5ff-0c1e1b9705fb@tarantool.org> <20181229131953.z6mkaif2p5zwou2g@esperanza> <25613688-02dd-7fa8-c200-1b3a9be20972@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25613688-02dd-7fa8-c200-1b3a9be20972@tarantool.org> To: Kirill Shcherbatov Cc: tarantool-patches@freelists.org List-ID: 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.