libgit2/libgit2 — pull request #2455 by ethomson (2014-07-01 18:16:03+00:00)
Title: Introduce `cl_assert_equal_oid`

Introduce a new macro to test OID equality. We previously used a variety of mechanisms for asserting OID equality, usually `cl_assert`ing that `git_oid_equal` or `git_oid_cmp == 0`. Or, my favorite:

cl_assert_equal_i(true, git_oid_cmp(a, b)) == 0);

This provides a superior failure message. Was:

````
1) Failure:
repo::hashfile::filtered [/Users/ethomson/git/libgit2-3/tests/repo/hashfile.c:71]
Expression is not true: git_oid_cmp(&a, &b) == 0
````

Is:

````
OID mismatch: &a != &b
"32e6f59c4ff525b643babb090c9043cb227c648b" != "d95f3ad14dee633a758d2e331151e950dd13e4ed"
````

The second commit updates the revwalk::simplify test, which did not appear to be testing the values coming out of the revwalk (and the expected IDs were not in line with the repository; two IDs were transposed.)