X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=test%2Funit%2Fprint_cmdtype_code_hash%2Fprint_cmdtype_code.c;h=d075ae469e08f3b4b604ad763b0f4e44e73c40cb;hp=71d56eb9e7eacbb1b1c6fb92d7a58dd611f30e36;hb=4ee27a568fb9222907a566e59aaefe248f08a8e4;hpb=5562b8293058464957a1f833777e187a78220ed5 diff --git a/test/unit/print_cmdtype_code_hash/print_cmdtype_code.c b/test/unit/print_cmdtype_code_hash/print_cmdtype_code.c index 71d56eb..d075ae4 100644 --- a/test/unit/print_cmdtype_code_hash/print_cmdtype_code.c +++ b/test/unit/print_cmdtype_code_hash/print_cmdtype_code.c @@ -9,18 +9,24 @@ void print_cmdtype_code() np = cmdtype_code[i]; while(np != NULL) { fprintf(stdout, "(%2d) - %s\t0%02o\t#%04X\n", - i, np->cca->cmd, np->cca->type, np->cca->code); + i, np->cmdtypecode->cmd, np->cmdtypecode->type, np->cmdtypecode->code); np = np->next; } } } int main(){ + /* エラーの初期化 */ + cerr = malloc_chk(sizeof(CERR), "cerr"); + /* ハッシュ表作成 */ create_cmdtype_code(); + /* ハッシュ表表示 */ print_cmdtype_code(); + /* ハッシュ表解放 */ free_cmdtype_code(); - if(cerrno != 0) { - printf("\terror - %d: %s\n", cerrno, cerrmsg); + /* エラーの表示 */ + if(cerr->num != 0) { + printf("\terror - %d: %s\n", cerr->num, cerr->msg); freecerr(); exit(-1); }