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

test/bufferlist: Avoid false-positive tests #7955

Merged
merged 1 commit into from Mar 11, 2016

Commits on Mar 7, 2016

  1. test/bufferlist: Avoid false-positive tests

    The current code is using the length of ptr to determine if the string is
    correct.
    
    As 'ptr' is a copy of the original 'str', it sounds safer to compare against the
    original string size of the consider the actual size of the string : if 'ptr' is
    shorter than 'str', the actual code will PASS while 'ptr' is broken.
    
    This patch offer to use the same testing logic as per "ptr(const ptr& p,
    unsigned o, unsigned l)" test by using a memcmp against the original string
    length.
    
    Signed-off-by: Erwan Velu <erwan@redhat.com>
    Erwan Velu committed Mar 7, 2016
    Copy the full SHA
    a565d33 View commit details
    Browse the repository at this point in the history