アセンブラファイルとテストの整理
[YACASL2.git] / test / unit / cerrtest / cerrtest.c
1 #include <stdio.h>
2 #include "casl2.h"
3
4 int main(){
5     int i, j;
6     int code[] = {
7         101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
8         111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
9         121, 122, 123, 124, 201, 202, 203, 204, 205, 206, 207, 999
10     };
11     const char *str[] = {NULL, "foobar"};
12     
13     for(i = 0; i < sizeof(str)/sizeof(str[0]); i++) {
14         for(j = 0; j < sizeof(code)/sizeof(code[0]); j++) {
15             setcerr(code[j], str[i]);
16             printf("%d: %s - %d\t%s\n", code[j], str[i], cerrno, cerrmsg);
17             if(cerrno != 0) {
18                 freecerr();
19             }
20         }
21     }
22     return 0;
23 }