• Show log

    Commit

  • Hash : f148258a
    Author : Patrick Steinhardt
    Date : 2017-06-12T16:19:45

    tests: odb: add tests with multiple backends
    
    Previous to pulling out and extending the fake backend, it was quite
    cumbersome to write tests for very specific scenarios regarding
    backends. But as we have made it more generic, it has become much easier
    to do so. As such, this commit adds multiple tests for scenarios with
    multiple backends for the ODB.
    
    The changes also include a test for a very targeted scenario. When one
    backend found a matching object via `read_prefix`, but the last backend
    returns `GIT_ENOTFOUND` and when object hash verification is turned off,
    we fail to reset the error code to `GIT_OK`. This causes us to segfault
    later on, when doing a double-free on the returned object.
    

  • README.md

  • Writing Clar tests for libgit2

    For information on the Clar testing framework and a detailed introduction please visit:

    https://github.com/vmg/clar

    • Write your modules and tests. Use good, meaningful names.

    • Make sure you actually build the tests by setting:

        cmake -DBUILD_CLAR=ON build/
    • Test:

        ./build/libgit2_clar
    • Make sure everything is fine.

    • Send your pull request. That’s it.