• Show log

    Commit

  • Hash : 1bf57b5a
    Author : Patrick Steinhardt
    Date : 2018-05-04T15:27:11

    tests: iterator::workdir: fix GCC warning
    
    Since GCC 8.1, the compiler performs some bounds checking when
    copying static data into arrays with a known size. In one test,
    we print a format string of "%s/sub%02d" into a buffer of 64
    bytes. The input buffer for the first "%s" is bounded to at most
    63 characters, plus four bytes for the static string "/sub" plus
    two more bytes for "%02d". Thus, our target buffer needs to be at
    least 70 bytes in size, including the NUL byte. There seems to be
    a bug in the analysis, though, because GCC will not account for
    the limiting "%02" prefix, treating it as requiring the same
    count of bytes as a "%d".
    
    Thus, we end up at 79 bytes that are required to fix the
    warning. To make it look nicer and less special, we just round
    the buffer size up to 80 bytes.
    

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