ユニットテストをソースに合わせて修正
[YACASL2.git] / test / unit / nh2word / cmd.c
similarity index 64%
rename from test/unit/n2word/cmd.c
rename to test/unit/nh2word/cmd.c
index 8d1d04e..06d68e5 100644 (file)
@@ -1,21 +1,23 @@
 #include <stdio.h>
-#include "casl2.h"
 #include "assemble.h"
+#include "test_h2word.h"
+#include "cerr.h"
+#include "word.h"
 
 int main(){
     int i;
     WORD r;
     char *str[] = {
+        "#32768", "#-1", "#G", "#FFFF", "#0", "#1", "#ab", "#AB", "#20"
         "0", "01", "1a", "-5G", "123", "32767", "32768", "32769",
         "-1", "-2345", "-32768", "-32769", "-32770"
     };
 
-    cerr = malloc_chk(sizeof(CERR), "cerr");    /* エラーの初期化 */
-    addcerrlist_word();
+    cerr_init();    /* エラーの初期化 */
     for(i = 0; i < sizeof(str)/sizeof(str[0]); i++) {
         cerr->num = 0;
-        r = n2word(str[i]);
-        printf("%s\t0x%04x", str[i], r);
+        r = nh2word(str[i]);
+        printf("%s\t#%04X", str[i], r);
         if(cerr->num > 0) {
             printf("\tError - %d\t%s", cerr->num, cerr->msg);
         }