vmg/clar — pull request #40 by arrbee (2013-09-04 20:41:31+00:00)
Title: More flexibility with cl_assert_equal_...

Replace `clar__assert_equal_s` and `clar__assert_equal_i` with a single `clar__assert_equal` that takes a format string fragment and uses varargs to accept the two items to compare. This allows pretty easy extension to display integers being compared in octal or hex format and also to support size_t or pointer comparison directly (where previously those were supported by hacks). I updated the test code to demonstrate the various use cases.

Also, I renamed the `snprintf_eq` macro to simply `p_snprintf`. I had originally chosen the `snprintf_eq` name because I was not using a variadic macro and I wanted to show that it was just used when testing if two items were equal (hence `eq`) and just took two arguments. However, I then violated that by passing extra arguments and Ben fixed it to be variadic, but the original name doesn't make sense.

While fixing the declaration of that macro, I also fixed a bunch of macro redefinition warnings that I've been seeing on Windows when compiling in the context of libgit2. I put checks around a lot of the `#define`s to avoid redefinition. I also put a warning fix in `clar/sandbox.h:find_tmp_path()` when compiling for 64-bit on Windows.