Skip to content

The test for invalid_binary may sometimes fail #112

@russelldb

Description

@russelldb

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}}]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions