You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Adrien Grand (JIRA)" <ji...@apache.org> on 2012/06/15 16:52:42 UTC

[jira] [Created] (LUCENE-4148) _TestUtil should be able to generate random longs

Adrien Grand created LUCENE-4148:
------------------------------------

             Summary: _TestUtil should be able to generate random longs
                 Key: LUCENE-4148
                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
             Project: Lucene - Java
          Issue Type: Improvement
          Components: general/test
            Reporter: Adrien Grand
            Priority: Trivial


It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Comment Edited] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Adrien Grand (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295720#comment-13295720 ] 

Adrien Grand edited comment on LUCENE-4148 at 6/15/12 3:20 PM:
---------------------------------------------------------------

bq. Try RandomInts from randomizedtesting

Thanks, it fixes the problem for large range of ints, but I would also like to be able to generate random longs (> Integer.MAX_VALUE) in a fixed range. For {{PackedInts}}, I always need longs between 0 and a power of 2, but I thought it would be more useful to add a general-purpose {{long nextLong(Random, long, long)}} to {{_TestUtil}}.

Since {{Random.nextLong(long)}} doesn't exist, it would be tempting to implement it by ourselves by using the same logic as {{Random.nextInt(int)}} (described here: http://docs.oracle.com/javase/7/docs/api/java/util/Random.html#nextInt(int) ), but I am afraid there would be copyright issues, so we should probably do it otherwise ( ? ).

By the way, the code of {{randomIntBetween}} makes me curious, are all values as likely when the range of values is {{>= Integer.MAX_VALUE}} (ie. when the else block gets executed)?
                
      was (Author: jpountz):
    bq. Try RandomInts from randomizedtesting

Thanks, it fixes the problem for large range of ints, but I would also like to be able to generate random longs (> Integer.MAX_VALUE) in a fixed range. For {{PackedInts}}, I always need longs between 0 and a power of 2, but I thought it would be more useful to add a general-purpose {{long nextLong(Random, long, long)}} to {{_TestUtil}}.

Since {{Random.nextLong(long)}} doesn't exist, it would be tempting to implement it by ourselves by using the same logic as {{Random.nextInt(int)}}, but I am afraid there would be copyright issues, so we should probably do it otherwise (?).

By the way, the code of {{randomIntBetween}} makes me curious, are all values as likely when the range of values is {{>= Integer.MAX_VALUE}} (ie. when the else block gets executed)?
                  
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Adrien Grand (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295720#comment-13295720 ] 

Adrien Grand commented on LUCENE-4148:
--------------------------------------

bq. Try RandomInts from randomizedtesting

Thanks, it fixes the problem for large range of ints, but I would also like to be able to generate random longs (> Integer.MAX_VALUE) in a fixed range. For {{PackedInts}}, I always need longs between 0 and a power of 2, but I thought it would be more useful to add a general-purpose {{long nextLong(Random, long, long)}} to {{_TestUtil}}.

Since {{Random.nextLong(long)}} doesn't exist, it would be tempting to implement it by ourselves by using the same logic as {{Random.nextInt(int)}}, but I am afraid there would be copyright issues, so we should probably do it otherwise (?).

By the way, the code of {{randomIntBetween}} makes me curious, are all values as likely when the range of values is {{>= Integer.MAX_VALUE}} (ie. when the else block gets executed)?
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13395487#comment-13395487 ] 

Dawid Weiss commented on LUCENE-4148:
-------------------------------------

I didn't check _TestUtil, to be honest -- I think it did have a bug with range overflow passed to nextInt (which is not a problem in practice, but was my example on how randomized testing can explore unexpected things). 

Anyway, as for randomLongBetween -- here you'd need to be more careful about double's representation so simple scaling won't work (there are ranges of double that transform to NaNs for example). I am not so strong in numerical analysis to be able to prove something is a correct solution to the problem. My (naive) take at this would be to calculate the range and then if split into a few cases:

1) if it doesn't exceed a positive int, use nextInt()
2) if it doesn't exceed a positive long, use nextLong()
3) if it does exceed positive long, use BigDecimal? :) 

Maybe this can be done faster without keeping the uniform distribution requirement so strong (i.e. use a modulo from a combination of two concatenated longs as BigDecimal or something like that).
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Adrien Grand (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13393632#comment-13393632 ] 

Adrien Grand commented on LUCENE-4148:
--------------------------------------

It seems to me that {{min}} and {{max}} are inclusive in both methods.

@Dawid could RandomInts have a similar method to generate longs? Something like 
{code}
  public static long randomLongBetween(Random r, long min, long max);
{code}
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Adrien Grand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrien Grand updated LUCENE-4148:
---------------------------------

    Attachment: LUCENE-4148.patch

Here is a patch proposition:
 * {{_TestUtil.nextInt}} forwards calls to {{RandomInts.randomIntBetween}}, as Robert suggested,
 * A new {{_TestUtil.nextLong}} uses {{Random.nextInt(int)}} when the range does not exceed {{Integer.MAX_VALUE}} and scales {{Double.nextDouble}} into the expected range of values otherwise using {{BigDecimal}} arithmetic.

I also updated a few tests to use this new method (especially a call to {{Math.abs(random.nextLong())}} in {{TestIndexInput}}, which is buggy since {{random.nextLong()}} might return Long.MIN_VALUE whose absolute value cannot be represented by a long).
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>         Attachments: LUCENE-4148.patch
>
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13395992#comment-13395992 ] 

Dawid Weiss commented on LUCENE-4148:
-------------------------------------

This looks good to me, although I'm wondering how much randomness do we really need -- those BigIntegers are worrying. I think this can be improved later if somebody wishes to dive into it.

Btw. an interesting random number generator -- 
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>         Attachments: LUCENE-4148.patch
>
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295765#comment-13295765 ] 

Dawid Weiss commented on LUCENE-4148:
-------------------------------------

@Robert: sure we could (noting the subtle difference that the range is inclusive on both min and max).

As for distribution... I think it should be uniform over all of the range's values assuming r.nextDouble() yields uniform value from [0,1]? It's simple scaling after all. I didn't really consider nuances of floating point representation here but I think within 2^32 a double should cover everything fairly well. 
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Comment Edited] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13395992#comment-13395992 ] 

Dawid Weiss edited comment on LUCENE-4148 at 6/18/12 4:10 PM:
--------------------------------------------------------------

This looks good to me, although I'm wondering how much randomness do we really need -- those BigIntegers are worrying. I think this can be improved later if somebody wishes to dive into it.

Btw. an interesting random number generator -- 
http://home.southernct.edu/~pasqualonia1/ca/report.html
                
      was (Author: dweiss):
    This looks good to me, although I'm wondering how much randomness do we really need -- those BigIntegers are worrying. I think this can be improved later if somebody wishes to dive into it.

Btw. an interesting random number generator -- 
                  
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>         Attachments: LUCENE-4148.patch
>
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Resolved] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Adrien Grand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrien Grand resolved LUCENE-4148.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0
                   4.0
         Assignee: Adrien Grand

Committed (r1351718 on trunk and r1351728 on branch 4.x). Thanks Robert and Dawid!
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Trivial
>             Fix For: 4.0, 5.0
>
>         Attachments: LUCENE-4148.patch
>
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295713#comment-13295713 ] 

Dawid Weiss commented on LUCENE-4148:
-------------------------------------

Try RandomInts from randomizedtesting, it does what you need:
{code}
  /** 
   * A random integer from <code>min</code> to <code>max</code> (inclusive).
   */
  public static int     randomIntBetween(Random r, int min, int max) {
    assert max >= min : "max must be >= min: " + min + ", " + max;
    long range = (long) max - (long) min;
    if (range < Integer.MAX_VALUE) {
      return min + r.nextInt(1 + (int) range);
    } else {
      return min + (int) Math.round(r.nextDouble() * range);
    }
  } 
{code}
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-4148) _TestUtil should be able to generate random longs

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295715#comment-13295715 ] 

Robert Muir commented on LUCENE-4148:
-------------------------------------

can we just switch _TestUtil.nextInt to use this then?
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>
> It would be helpful in TestPackedInts at least, in order to generate random values (as a workaround, we currently generate a random int between 0 and {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org