-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the invariant.cpp documentation to match
- Loading branch information
thk123
committed
May 30, 2018
1 parent
655f220
commit 3bf7d6c
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,18 @@ Author: Martin Brain, [email protected] | |
** evaluate to a boolean. | ||
** | ||
** As well as the condition they have a text argument that should be | ||
** used to say why they are true. The reason should be a string literals. | ||
** used to say why they are true. The reason should be a string literals | ||
** starting with a lower case character. | ||
** Longer diagnostics should be output to error(). For example: | ||
** | ||
** INVARIANT(x > 0, "x negative and zero case handled by other branches"); | ||
** INVARIANT( | ||
** x > 0, | ||
** "x should have a positive value as others are handled by other branches"); | ||
** | ||
** Use "should" style statements for messages in invariants (e.g. "array | ||
** should have a non-zero size") to make both the violation and the | ||
** expected behavior clear. (As opposed to "no zero size arrays" where it | ||
** isn't clear if the zero-size array is the problem, or the lack of it). | ||
** | ||
** To help classify different kinds of invariants, various short-hand | ||
** macros are provided. | ||
|