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