On 4/19/2012 10:30 PM, Elena Stepanova wrote:
Hi,
My build tool runs 'make test-unit' and the following errors appear.
[16:34:05] ../storage/maria/unittest/ma_test_all-t ..................... 73/830 Failed test '../storage/maria/unittest/../ma_test2 -s -htmp -m10000 -e4096 -K ' (loop iteration 8.) at line 316 (errcode: 256, test: 83)
From what I see, ma_test2 has the array key3[5000], used in a loop which sets n3=rnd(5000); and then reads key3[n3] == ...
while rnd(uint max_value) is return (uint) ((rand() & 32767)/32767.0*max_value);
which means with some luck it can return max_value itself. Luck happens, rnd returns 5000, key3[n3] reads something entirely wrong (in my case the value of 'silent' variable which is int and set to 1 as the unit test is launched with -s), the entire condition check with key3[n3] gets twisted, the bogus error occurs.
That patch led me in the right direction. The attached patch also lists a second possible index issue below what you pointed out. I'll file a bug to get this included in the future. Brian