[DTrace-devel] [PATCH 3/5] Fix size for typecast tuple (and aggregation key) components

Eugene Loh eugene.loh at oracle.com
Thu Sep 8 21:07:13 UTC 2022


On 9/8/22 16:31, Kris Van Hees wrote:

> On Thu, Sep 08, 2022 at 02:10:25PM -0400, Eugene Loh via DTrace-devel wrote:
>
>> Also, the patch should have a test.  Here is a suggestion:
> Test added (different from the one you suggested because a single case is quite
> sufficient).

A single case is sufficient for catching one, already known error. More 
test cases are helpful for checking a little more broadly for errors one 
has not yet thought of.  The additional cases are cheap and better 
resemble "test coverage."  No cost.  Greater confidence.

> v2 posted.

In any case, it appears that v2 has no tests at all.

>> BEGIN {
>>    @a[11111111, 22222222,        0x7fff7fff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +1);
>>    @a[11111111, 22222222, (int  )0x7fff7fff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +2);
>>    @a[11111111, 22222222, (short)0x7fff7fff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +4);
>>    @a[11111111, 22222222, (long )0x7fff7fff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +8);
>>    @a[11111111, 22222222,        0x7fffffff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +16);
>>    @a[11111111, 22222222, (int  )0x7fffffff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +32);
>>    @a[11111111, 22222222, (short)0x7fffffff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +64);
>>    @a[11111111, 22222222, (long )0x7fffffff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +128);
>>    @a[11111111, 22222222,        0xffff7fff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +256);
>>    @a[11111111, 22222222, (int  )0xffff7fff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +512);
>>    @a[11111111, 22222222, (short)0xffff7fff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +1024);
>>    @a[11111111, 22222222, (long )0xffff7fff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +2048);
>>    @a[11111111, 22222222,        0xffffffff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +4096);
>>    @a[11111111, 22222222, (int  )0xffffffff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +8192);
>>    @a[11111111, 22222222, (short)0xffffffff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +16384);
>>    @a[11111111, 22222222, (long )0xffffffff, 44444444, 55555555] =
>> lquantize(3, 0, 10, 1, +32768);
>>    exit(0);
>> }



More information about the DTrace-devel mailing list