Skip to content

CASSANALYTICS-195: Make QuickTheories tests reproducible from a single seed - #240

Open
yifan-c wants to merge 2 commits into
apache:trunkfrom
yifan-c:CASSANALYTICS-195/qt-test-fix
Open

CASSANALYTICS-195: Make QuickTheories tests reproducible from a single seed#240
yifan-c wants to merge 2 commits into
apache:trunkfrom
yifan-c:CASSANALYTICS-195/qt-test-fix

Conversation

@yifan-c

@yifan-c yifan-c commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Introduces QTRandom to bridge QT's RandomnessSource into Java Random API

Patch by Yifan Cai; Reviewed by TBD for CASSANALYTICS-195

…e seed

Introduces QTRandom to bridge QT's RandomnessSource into Java Random API

Patch by Yifan Cai; Reviewed by TBD for CASSANALYTICS-195
Comment on lines +34 to +48
public final class QTRandom extends Random
{
private final RandomnessSource source;

public QTRandom(RandomnessSource source)
{
this.source = source;
}

@Override
protected int next(int bits)
{
return (int) source.next(Constraint.between(0, (1L << bits) - 1));
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is the core of the patch. The other test code are modified to take QTRandom instead of Random.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant