Test case for verify.h.
[gnulib.git] / tests / test-verify.c
1 #include "verify.h"
2
3 int x;
4 enum { a, b, c };
5
6 verify (x >= 0);                  /* should give ERROR: non-constant expression */
7 verify (c == 2);                  /* should be ok */
8 verify (1 + 1 == 3);              /* should give ERROR */
9 verify (1 == 1); verify (1 == 1); /* should be ok */
10
11 int function (int n)
12 {
13   verify (n >= 0);                  /* should give ERROR: non-constant expression */
14   verify (c == 2);                  /* should be ok */
15   verify (1 + 1 == 3);              /* should give ERROR */
16   verify (1 == 1); verify (1 == 1); /* should be ok */
17
18   if (n)
19     return (verify_expr (1 == 1), verify_expr (1 == 1), 7); /* should be ok */
20   else
21     return (verify_expr (1 == 2), 5); /* should give ERROR */
22 }