Skip to content

CASSANDRA-21398: Add agent skills for property / stateful testing#4837

Open
dcapwell wants to merge 13 commits into
apache:trunkfrom
dcapwell:CASSANDRA-21398
Open

CASSANDRA-21398: Add agent skills for property / stateful testing#4837
dcapwell wants to merge 13 commits into
apache:trunkfrom
dcapwell:CASSANDRA-21398

Conversation

@dcapwell
Copy link
Copy Markdown
Contributor

No description provided.

* Generates a random byte array whose size is determined by the given size generator.
* Fills 8 bytes at a time using {@code nextLong()} for efficiency, then fills any remaining bytes individually.
*/
public static Gen<byte[]> byteArray(Gen.IntGen sizeGen)
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.

didn't have a good place to put this... i really need to get rid of QuickTheories...

for (int i = start ; i < end ; ++i)
{
char c = hex.charAt(i);
result |= (long)(c - (c >= 'a' ? 'a' - 10 : '0')) << shift;
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.

hex includes upper case but this method doesn't handle that. This is fine in existing usage as we use Long.toHexString(lsb); which explicitly documents that its lower case only (if you want upper case it says to do toUpperCase).

So this bug fix isn't for any existing logic, but more defensive to make sure future logic works correctly

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