• Show log

    Commit

  • Hash : 2e34efaa
    Author : Edward Thomson
    Date : 2018-10-21T13:10:06

    buf::oom tests: use custom allocator for oom failures
    
    Create a custom allocator for the `buf::oom` tests that will fail with
    out-of-memory errors in predictable ways.  We were previously trying to
    guess the way that various allocators on various platforms would fail
    in a way such that `malloc`/`realloc` would return `NULL` (instead of
    aborting the application, or appearing suspicious to various
    instrumentation or static code analysis tools like valgrind.)
    
    Introduce a fake `malloc` and `realloc` that will return `NULL` on
    allocations requesting more than 100 bytes.  Otherwise, we proxy to the
    default allocator.  (It's important to use the _default_ allocator, not
    just call `malloc`, since the default allocator on Windows CI builds may
    be the debugging C runtime allocators which would not be compatible with
    a standard `malloc`.)
    

  • 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.