Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The test for invalid_binary may sometimes fail #112

Open
russelldb opened this issue Jan 29, 2015 · 0 comments
Open

The test for invalid_binary may sometimes fail #112

russelldb opened this issue Jan 29, 2015 · 0 comments

Comments

@russelldb
Copy link
Member

If by chance the call to crypto:rand_bytes generates a random bitstring that starts with a data types tag (in the example below a bitstring that starts with the map ?TAG has been generated) then the test will fail for the wrong reason. Use quickcheck, or some deterministic method to generate bytes that are invalid from the start.

riak_dt_map: invalid_binary_test...*failed*
in function riak_dt_map:'-invalid_binary_test/0-fun-0-'/0 (src/riak_dt_map.erl, line 955)
**error:{assertMatch_failed,[{module,riak_dt_map},
                 {line,955},
                 {expression,"from_binary ( << ( crypto : rand_bytes ( 187 ) ) / binary >> )"},
                 {pattern,"? INVALID_BINARY"},
                 {value,{error,unsupported_version,226}}]}
@russelldb russelldb changed the title The test for invalid_binary my sometimes fail The test for invalid_binary may sometimes fail Jan 29, 2015
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

No branches or pull requests

1 participant