Skip to content

Commit

Permalink
Merge pull request #40 from catbro666/extend-check-require-macro
Browse files Browse the repository at this point in the history
extend all macros to variadic macros in order to support additional printf-style format string
  • Loading branch information
jasmcaus authored Nov 12, 2024
2 parents 37db776 + a3bb9cf commit 6b10ba8
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 70 deletions.
4 changes: 4 additions & 0 deletions docs/tau-primer.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ We recommend using `CHECK`s over `ASSERT`s unless it doesn't make sense to conti
### Adding Custom Failure Messages
We highly recommend you add a custom failure message for your macros - it makes it easier to track down bugs. `Invalid Type ID:` is much more useful than `FAILED`, which is what Tau prints by default.
The message can be a printf format string. This is pretty useful when you do the test in a loop. You can quickly know which iteration of the loop failed.
To do this, simply do the following:
```C
CHECK(i == 42, "Expected i to be 42");
CHECK(result == expected[i], "i=%d", i);
```


Expand Down
Loading

0 comments on commit 6b10ba8

Please sign in to comment.