]> j8takagi.net Git Repository - YACASL2.git/commitdiff
テストの整理
authorj8takagi <j8takagi@nifty.com>
Sun, 31 Jan 2010 15:40:22 +0000 (00:40 +0900)
committerj8takagi <j8takagi@nifty.com>
Sun, 31 Jan 2010 15:57:56 +0000 (00:57 +0900)
23 files changed:
test/.gitignore
test/Makefile.TESTGROUPS.mk
test/integration/casl2/Makefile
test/integration/casl2/TEST.mk
test/integration/comet2/CMD.mk
test/integration/comet2/Makefile
test/integration/comet2/TEST.mk
test/integration/dumpword/ARGS.txt
test/integration/dumpword/Makefile
test/integration/dumpword/a/0.txt
test/integration/dumpword/l/0.txt
test/integration/dumpword/noopt/0.txt
test/unit/.gitignore
test/unit/Makefile
test/unit/TEST.mk
test/unit/cerrtest/0.txt [new file with mode: 0644]
test/unit/h2word/0.txt [moved from test/unit/gethex/0.txt with 100% similarity]
test/unit/h2word/Makefile [moved from test/unit/gethex/Makefile with 100% similarity]
test/unit/h2word/gethex.c [moved from test/unit/gethex/gethex.c with 94% similarity]
test/unit/hash/0.txt
test/unit/n2word/0.txt [moved from test/unit/getint/0.txt with 74% similarity]
test/unit/n2word/Makefile [moved from test/unit/getint/Makefile with 100% similarity]
test/unit/n2word/getint.c [moved from test/unit/getint/getint.c with 94% similarity]

index f00c031883275b8bf83e648abfc8a53c6a1e765d..0659e1aea54c9262e5d267a784fe926fa342a2f8 100644 (file)
@@ -3,3 +3,4 @@ report.txt
 diff.txt
 err.txt
 TEST.log
+Test.log
\ No newline at end of file
index b453755f42a0d8813bcb6527fe750079f9873dc8..22dd7ecaaab39e4f1e806bde5e0755578ae97303 100644 (file)
@@ -7,7 +7,7 @@
 # make prepare : すべてのテストの、想定結果を出力
 # make create  : UNITNAMEで指定されたテストを新規に作成
 TESTS = `ls | grep "^[^A-Z].*"`
-LOGFILE = TEST.log
+LOGFILE = Test.log
 
 .PHONY: all check report clean cleanall prepare create
 all: check report
index 1600450098e5529dbbaee068356ecd082f87e1fa..05bb87a06d4b1de4b4ea39fc796d3895c3cb5b1c 100644 (file)
@@ -7,7 +7,7 @@
 # make prepare : すべてのテストの、想定結果を出力
 # make create  : UNITNAMEで指定されたテストを新規に作成
 TESTS = `ls | grep "^[^A-Z].*"`
-LOGFILE = TEST.log
+LOGFILE = Test.log
 
 .PHONY: all check report clean cleanall prepare create
 all: check report
index bb834574232e6999ff28c9233a0c2fb71295ccc5..13e4f02ceb72a7ca66a42785b938a5535b49a9a7 100644 (file)
@@ -4,7 +4,6 @@
 # make prepare : CMDで設定されたコマンドを実行した出力結果を0.txt(テストの想定結果)に出力
 # make clean   : 「make」で生成されたファイルをクリア
 # make cleanall: 「make」と「make clean」で生成されたファイルをクリア
-LOGFILE = ../TEST.log
 ERRFILE = err.txt
 UNITNAME = `pwd | xargs basename`
 
index 904b8106017320b6a75c5059070a7f6f167b4e66..77f64390a037a6633282bf1566939c0070a03e9b 100644 (file)
@@ -1,6 +1,5 @@
 YACASL2DIR=../../../..
-UNITNAME = `pwd | xargs basename`
-OBJFILE = a.o
 CASL2 = $(YACASL2DIR)/casl2
+OBJFILE = a.o
 COMET2 = $(YACASL2DIR)/comet2
 CMD = $(COMET2) $(COMET2FLAG) $(OBJFILE)
index d60aaa162c70e484f5ec0b718a26b9e9394aa5c3..e7e747d8c379ed4a545e48b18ab8b653618377dc 100644 (file)
@@ -7,7 +7,7 @@
 # make prepare : すべてのテストの、想定結果を出力
 # make create  : UNITNAMEで指定されたテストを新規に作成
 TESTS = `ls | grep "^[^A-Z].*"`
-LOGFILE = TEST.log
+LOGFILE = Test.log
 
 .PHONY: all check report clean cleanall prepare create
 all: check report
index 3ec7fed70e1f42c80c0300d56a63cd5f3df74fc3..0a386cb5babf17b67812748cca16dca06b079260 100644 (file)
@@ -4,8 +4,9 @@
 # make prepare : CMDで設定されたコマンドを実行した出力結果を0.txt(テストの想定結果)に出力
 # make clean   : 「make」で生成されたファイルをクリア
 # make cleanall: 「make」と「make report」で生成されたファイルをクリア
-LOGFILE = ../TEST.log
+# 要設定: CASL2, OBJFILE, COMET2, CMD
 ERRFILE = err.txt
+UNITNAME = `pwd | xargs basename`
 
 .PHPNY: check prepare clean cleanall
 check: clean report.txt
index f86899da789b958b7fa67fd95be8773462c7e2c2..9886259440f2eba58c6bc8c5d949a2927dfd080e 100644 (file)
@@ -23,3 +23,5 @@
 \'#FFFF\'
 \'#00001\'
 \'#G\'
+G
+g
index c453c20e4df91bcd3e2b642a7398cc313ede212a..745a8a401d5ae508f4f96a299a4479a4777f4e5c 100644 (file)
@@ -7,7 +7,7 @@
 # make prepare : すべてのテストの、想定結果を出力
 # make create  : UNITNAMEで指定されたテストを新規に作成
 TESTS = `ls | grep "^[^A-Z].*"`
-LOGFILE = TEST.log
+LOGFILE = Test.log
 
 .PHONY: all check report clean cleanall prepare create
 all: check report
index 47be5ae2bd5bcfedafd8141e72d36da0d4bfb2f8..1f4da4d189bbfb7a1887c365ed0ffb7501f35d34 100644 (file)
@@ -23,3 +23,5 @@
  #FFFF:     -1 = #FFFF = 1111111111111111
 Dumpword Error - 116: #00001: out of hex range
 Dumpword Error - 115: #G: not hex
+Dumpword Error - 114: G: not integer
+Dumpword Error - 114: g: not integer
index a39a28eab11adfede532aef516f4761acfde10ac..629f2012905990c78e41c58a8f3618bbdb7a8a74 100644 (file)
@@ -23,3 +23,5 @@
  #FFFF:  65535 = #FFFF = 1111111111111111
 Dumpword Error - 116: #00001: out of hex range
 Dumpword Error - 115: #G: not hex
+Dumpword Error - 114: G: not integer
+Dumpword Error - 114: g: not integer
index 47be5ae2bd5bcfedafd8141e72d36da0d4bfb2f8..1f4da4d189bbfb7a1887c365ed0ffb7501f35d34 100644 (file)
@@ -23,3 +23,5 @@
  #FFFF:     -1 = #FFFF = 1111111111111111
 Dumpword Error - 116: #00001: out of hex range
 Dumpword Error - 115: #G: not hex
+Dumpword Error - 114: G: not integer
+Dumpword Error - 114: g: not integer
index cba7efc8efd27eebb82aa22d38d6dabc0b6e903b..d7756c255cff24d5574076babac93d231312b644 100644 (file)
@@ -1 +1,2 @@
 a.out
+*.o
index 7f6bd86c9810de9f52494541f807808ecf8e12a6..e1a3dff528fce4e7374bd4db679de108ffdae63c 100644 (file)
@@ -7,7 +7,7 @@
 # make prepare : すべてのテストの、想定結果を出力
 # make create  : UNITNAMEで指定されたテストを新規に作成
 TESTS = `ls | grep "^[^A-Z].*"`
-LOGFILE = TEST.log
+LOGFILE = Test.log
 
 .PHONY: all check report clean cleanall prepare create
 all: check report
index b08dd027ee4a9c7f5913e22c1a608d3630d62978..96c908d7771a11d95c84149200fd8747a1d9ece3 100644 (file)
@@ -4,17 +4,16 @@
 # make prepare : CMDで設定されたコマンドを実行した出力結果を0.txt(テストの想定結果)に出力
 # make clean   : 「make」で生成されたファイルをクリア
 # make cleanall: 「make」と「make clean」で生成されたファイルをクリア
-LOGFILE = ../TEST.log
 ERRFILE = err.txt
 UNITNAME = `pwd | xargs basename`
 
+SRCDIR = ../../../src
 INCLUDE = ../../../include
 CC = gcc
 CFLAGS = -g -Wall -I $(INCLUDE)
-SRCDIR = ../../../src
-COMMONSRC = $(SRCDIR)/struct.o $(SRCDIR)/hash.o $(SRCDIR)/cmd.o $(SRCDIR)/cerr.o $(SRCDIR)/dump.o
+COMMONSRC = $(SRCDIR)/word.o $(SRCDIR)/struct.o $(SRCDIR)/hash.o $(SRCDIR)/cmd.o $(SRCDIR)/cerr.o
 ASSRC = $(SRCDIR)/assemble.o $(SRCDIR)/token.o $(SRCDIR)/label.o $(SRCDIR)/macro.o
-EXECSRC = $(SRCDIR)/exec.o
+EXECSRC = $(SRCDIR)/exec.o $(SRCDIR)/dump.o
 
 ifeq "$(UCLASS)" "AS"
   SRC = $(COMMONSRC) $(ASSRC)
@@ -33,10 +32,10 @@ clean:
        @rm -f a.out 1.txt diff.txt report.txt
 cleanall: clean
        @rm -f 0.txt
-a.out: $(SRC) $(TESTSRCFILE)
-       @gcc $(CFLAGS) $(SRC) $(TESTSRCFILE)
 $(SRCDIR)/%.o: $(SRCDIR)/%.c
        @$(CC) -c $(CFLAGS) $<
+a.out: $(SRC) $(TESTSRCFILE)
+       @gcc $(CFLAGS) $(SRC) $(TESTSRCFILE)
 0.txt 1.txt: a.out
        @./a.out >$@ 2>&1
 diff.txt: 1.txt
diff --git a/test/unit/cerrtest/0.txt b/test/unit/cerrtest/0.txt
new file mode 100644 (file)
index 0000000..0183602
--- /dev/null
@@ -0,0 +1,64 @@
+101: (null) - 101      label already defined
+102: (null) - 102      label table is full
+103: (null) - 103      label not found
+104: (null) - 104      label length is too long
+105: (null) - 105      no command in the line
+106: (null) - 106      operand count mismatch
+107: (null) - 107      no label in START
+108: (null) - 108      not command of operand "r"
+109: (null) - 109      not command of operand "r1,r2"
+110: (null) - 110      not command of operand "r,adr[,x]"
+111: (null) - 111      not command of operand "adr[,x]"
+112: (null) - 112      not command of no operand
+113: (null) - 113      command not defined
+114: (null) - 114      not integer
+115: (null) - 115      not hex
+116: (null) - 116      out of hex range
+117: (null) - 117      operand is too many
+118: (null) - 118      operand length is too long
+119: (null) - 119      out of COMET II memory
+120: (null) - 120      GR0 in operand x
+121: (null) - 121      cannot get operand token
+122: (null) - 122      cannot create hash table
+123: (null) - 123      unkown error
+124: (null) - 124      unkown error
+201: (null) - 201      execute - out of COMET II memory
+202: (null) - 202      SVC input - out of Input memory
+203: (null) - 203      SVC output - out of COMET II memory
+204: (null) - 204      Program Register (PR) - out of COMET II memory
+205: (null) - 205      Stack Pointer (SP) - cannot allocate stack buffer
+206: (null) - 206      Address - out of COMET II memory
+207: (null) - 207      Stack Pointer (SP) - out of COMET II memory
+999: (null) - 999      unkown error
+101: foobar - 101      foobar: label already defined
+102: foobar - 102      foobar: label table is full
+103: foobar - 103      foobar: label not found
+104: foobar - 104      foobar: label length is too long
+105: foobar - 105      foobar: no command in the line
+106: foobar - 106      foobar: operand count mismatch
+107: foobar - 107      foobar: no label in START
+108: foobar - 108      foobar: not command of operand "r"
+109: foobar - 109      foobar: not command of operand "r1,r2"
+110: foobar - 110      foobar: not command of operand "r,adr[,x]"
+111: foobar - 111      foobar: not command of operand "adr[,x]"
+112: foobar - 112      foobar: not command of no operand
+113: foobar - 113      foobar: command not defined
+114: foobar - 114      foobar: not integer
+115: foobar - 115      foobar: not hex
+116: foobar - 116      foobar: out of hex range
+117: foobar - 117      foobar: operand is too many
+118: foobar - 118      foobar: operand length is too long
+119: foobar - 119      foobar: out of COMET II memory
+120: foobar - 120      foobar: GR0 in operand x
+121: foobar - 121      foobar: cannot get operand token
+122: foobar - 122      foobar: cannot create hash table
+123: foobar - 123      foobar: unkown error
+124: foobar - 124      foobar: unkown error
+201: foobar - 201      foobar: execute - out of COMET II memory
+202: foobar - 202      foobar: SVC input - out of Input memory
+203: foobar - 203      foobar: SVC output - out of COMET II memory
+204: foobar - 204      foobar: Program Register (PR) - out of COMET II memory
+205: foobar - 205      foobar: Stack Pointer (SP) - cannot allocate stack buffer
+206: foobar - 206      foobar: Address - out of COMET II memory
+207: foobar - 207      foobar: Stack Pointer (SP) - out of COMET II memory
+999: foobar - 999      foobar: unkown error
similarity index 94%
rename from test/unit/gethex/gethex.c
rename to test/unit/h2word/gethex.c
index b69610fe3353f668e9fe1ca816fa670aecd80410..a4c34f8b6b1b36787eb33242bffb8a22d9b183cc 100644 (file)
@@ -10,7 +10,7 @@ int main(){
         "#32768", "#-1", "#G", "#FFFF", "#0", "#1", "#ab", "#AB", "#20"
     };
     for(i = 0; i < sizeof(str)/sizeof(str[0]); i++) {
-        r = gethex(str[i]);
+        r = h2word(str[i]);
         printf("%s\t#%04X", str[i], r);
         if(cerrno > 0) {
             printf("\tError - %d\t%s", cerrno, cerrmsg);
index 766dc2d7db2e4b4ee9e91181335f8d0fa7dc24f1..b35644c5ea30296ca53b9ed971a3da7be1301ed0 100644 (file)
@@ -1,3 +1,3 @@
 HASH VALUE: 20
 HASH VALUE: 11
-HASH VALUE: 23
+HASH VALUE: 3
similarity index 74%
rename from test/unit/getint/0.txt
rename to test/unit/n2word/0.txt
index c3db13f23d3454b9dde90fd5e3bd70b7445712df..e56aa1f870ca78d2e460863296c690bd35197992 100644 (file)
@@ -4,10 +4,10 @@
 -5G    0x0000  Error - 114     -5G: not integer
 123    0x007b
 32767  0x7fff
-32768  0x0000
-32769  0x0001
+32768  0x8000
+32769  0x8001
 -1     0xffff
 -2345  0xf6d7
 -32768 0x8000
--32769 0xffff
--32770 0xfffe
+-32769 0x7fff
+-32770 0x7ffe
similarity index 94%
rename from test/unit/getint/getint.c
rename to test/unit/n2word/getint.c
index 8e1b9948ce38aca8d997067c4070152663f2005b..945db38e5ad10f837b57fb744db802a2fab39b8e 100644 (file)
@@ -10,7 +10,7 @@ int main(){
         "-1", "-2345", "-32768", "-32769", "-32770"
     };
     for(i = 0; i < sizeof(str)/sizeof(str[0]); i++) {
-        r = getint(str[i]);
+        r = n2word(str[i]);
         printf("%s\t0x%04x", str[i], r);
         if(cerrno > 0) {
             printf("\tError - %d\t%s", cerrno, cerrmsg);