X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=test%2Funit%2Fgetcmdtype%2Fgetcmdtype.c;h=2c3337c9ca74f8b6f8525fe4161f04b356c9663d;hb=bf31ea99380e3ee2198f61f6510ebe6e4a3961f5;hp=9c219940af83d64d8b65413051d6f718a0c1f2b1;hpb=fb54b1c9d2fbc3d4a62c6b4d38ff68e9d3b25c26;p=YACASL2.git diff --git a/test/unit/getcmdtype/getcmdtype.c b/test/unit/getcmdtype/getcmdtype.c index 9c21994..2c3337c 100644 --- a/test/unit/getcmdtype/getcmdtype.c +++ b/test/unit/getcmdtype/getcmdtype.c @@ -1,4 +1,3 @@ -#include #include "casl2.h" int main(){ @@ -15,12 +14,14 @@ int main(){ 0x6400, 0x6500, 0x6600, 0x7000, 0x7100, 0x8000, 0xF000, 0x8100 }; + + cerr = malloc_chk(sizeof(CERR), "cerr"); /* エラーの初期化 */ create_code_type(); - for(i = 0; i < sizeof(codelist)/sizeof(codelist[0]); i++) { + for(i = 0; i < ARRAYSIZE(codelist); i++) { type = getcmdtype(codelist[i]); - printf("0x%04x ---> 0%02o\n", codelist[i], type); - if(cerrno != 0) { - printf("\t%s", cerrmsg); + printf("#%04X ---> 0%02o\n", codelist[i], type); + if(cerr->num != 0) { + printf("\t%s", cerr->msg); freecerr(); } }