Kevin Wolf <kw...@redhat.com> writes:

> Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben:
>> Signed-off-by: Markus Armbruster <arm...@redhat.com>
>
>> +static void test_keyval_visit_size(void)
>> +{
>> +    Error *err = NULL;
>> +    Visitor *v;
>> +    QDict *qdict;
>> +    uint64_t sz;
>> +
>> +    /* Lower limit zero */
>> +    qdict = keyval_parse("sz1=0", NULL, &error_abort);
>> +    v = qobject_input_visitor_new_keyval(QOBJECT(qdict));
>> +    QDECREF(qdict);
>> +    visit_start_struct(v, NULL, NULL, 0, &error_abort);
>> +    visit_type_size(v, "sz1", &sz, &error_abort);
>> +    g_assert_cmpuint(sz, ==, 0);
>> +    visit_check_struct(v, &error_abort);
>> +    visit_end_struct(v, NULL);
>> +    visit_free(v);
>> +
>> +    /* Note: precision is 53 bits since we're parsing with strtod() */
>> +
>> +    /* Around limit of precision: 2^53-1, 2^53, 2^54 */
>> +    qdict = keyval_parse("sz1=9007199254740991,"
>> +                         "sz2=9007199254740992,"
>> +                         "sz3=9007199254740993",
>
> That's 2^53+1, not 2^54. With the comment fixed:

D'oh!

> Reviewed-by: Kevin Wolf <kw...@redhat.com>

Thanks!

Reply via email to