ユニットテストの修正
[YACASL2.git] / test / unit / n2word / getint.c
index 945db38..8d1d04e 100644 (file)
@@ -9,14 +9,18 @@ int main(){
         "0", "01", "1a", "-5G", "123", "32767", "32768", "32769",
         "-1", "-2345", "-32768", "-32769", "-32770"
     };
+
+    cerr = malloc_chk(sizeof(CERR), "cerr");    /* エラーの初期化 */
+    addcerrlist_word();
     for(i = 0; i < sizeof(str)/sizeof(str[0]); i++) {
+        cerr->num = 0;
         r = n2word(str[i]);
         printf("%s\t0x%04x", str[i], r);
-        if(cerrno > 0) {
-            printf("\tError - %d\t%s", cerrno, cerrmsg);
-            freecerr();
+        if(cerr->num > 0) {
+            printf("\tError - %d\t%s", cerr->num, cerr->msg);
         }
         printf("\n");
     }
+    freecerr();
     return 0;
 }