<HTML><BODY><div>Hi!<br><br>Sent v5 of the patch with fixes.<blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Четверг, 12 ноября 2020, 1:07 +03:00 от Vladislav Shpilevoy <v.shpilevoy@tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16051324331402517443_BODY">Hi! Thanks for the fixes!<br><br>I hope we will end this eventually :)<br><br>See 2 comments below.<br><br>> diff --git a/test/unit/random.c b/test/unit/random.c<br>> new file mode 100644<br>> index 000000000..858ff7867<br>> --- /dev/null<br>> +++ b/test/unit/random.c<br>> @@ -0,0 +1,56 @@<br>> +#include <core/random.h><br>> +<br>> +#include <stdio.h><br>> +#include <assert.h><br>> +<br>> +#include "unit.h"<br>> +<br>> +static void<br>> +test_random_in_range_one(int64_t min, int64_t max)<br>> +{<br>> + int64_t result = pseudo_random_in_range(min, max);<br>> + assert(min <= result && result <= max);<br>> + if (min == max)<br>> + printf("pseudo_random_in_range(%lld, %lld) = %lld\n",<br>> + (long long)min, (long long)max, (long long)result);<br>> +<br>> + result = real_random_in_range(min, max);<br>> + assert(min <= result && result <= max);<br>> + if (min == max)<br>> + printf("real_random_in_range(%lld, %lld) = %lld\n",<br>> + (long long)min, (long long)max, (long long)result);<br><br>1. By using printf as a checker you complicate Sergey's life in scope<br>of this <a href="https://github.com/tarantool/tarantool/issues/5000" target="_blank">https://github.com/tarantool/tarantool/issues/5000</a>. Because your<br>output is not TAP. Better not print anything except via helpers from<br>unit.h, and use ok()/is()/isnt() for actual tests.</div></div></div></div></blockquote></div><div>Thanks, didn’t really know this one.</div><div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div><div class="js-helper js-readmsg-msg"><div><div><br>> +}<br>> diff --git a/test/unit/swim_test_utils.c b/test/unit/swim_test_utils.c<br>> index 9dbd28a9f..7ac43d82d 100644<br>> --- a/test/unit/swim_test_utils.c<br>> +++ b/test/unit/swim_test_utils.c<br>> @@ -875,7 +875,8 @@ swim_run_test(const char *log_file, fiber_func test)<br>> * Print the seed to be able to reproduce a bug with the<br>> * same seed.<br>> */<br>> - say_info("Random seed = %llu", (unsigned long long) seed);<br>> + say_info("Random seed = %llu", (unsigned long long)seed);<br><br>2. Why did you change this line?</div></div></div></div></blockquote>Yes, no need to change it<div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Ilya Kosarev</div></div></div><div> </div></div></BODY></HTML>