ユニットテストに、最新版のAutotest.mkを反映
[YACASL2.git] / test / unit / h2word / cmd.c
1 #include <stdio.h>
2 #include "casl2.h"
3 #include "assemble.h"
4 #include "exec.h"
5
6 int main(){
7     int i;
8     WORD r;
9     char *str[] = {
10         "#32768", "#-1", "#G", "#FFFF", "#0", "#1", "#ab", "#AB", "#20"
11     };
12
13     cerr = malloc_chk(sizeof(CERR), "cerr");    /* エラーの初期化 */
14     addcerrlist_word();
15     for(i = 0; i < sizeof(str)/sizeof(str[0]); i++) {
16         cerr->num = 0;
17         r = h2word(str[i]);
18         printf("%s\t#%04X", str[i], r);
19         if(cerr->num > 0) {
20             printf("\tError - %d\t%s", cerr->num, cerr->msg);
21         }
22         printf("\n");
23     }
24     freecerr();
25     return 0;
26 }