From: j8takagi Date: Thu, 28 Jun 2018 13:22:50 +0000 (+0900) Subject: ブレークポイントを扱うハッシュ関数のテストを追加 X-Git-Tag: v0.4p1~1 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37da20d7195c1dc157074ab4fd0ddf2690c5d6db;p=YACASL2.git ブレークポイントを扱うハッシュ関数のテストを追加 --- diff --git a/test/unit/bpshash/0.txt b/test/unit/bpshash/0.txt new file mode 100644 index 0000000..a4f31b8 --- /dev/null +++ b/test/unit/bpshash/0.txt @@ -0,0 +1,10 @@ +0: 0 +1: 1 +2: 2 +3: 3 +10: 10 +250: 250 +251: 0 +254: 3 +36863: 217 +65535: 24 diff --git a/test/unit/bpshash/Makefile b/test/unit/bpshash/Makefile new file mode 100644 index 0000000..c97998b --- /dev/null +++ b/test/unit/bpshash/Makefile @@ -0,0 +1,20 @@ +include ../Define.mk +include ../Test.mk + +CC := gcc +CFLAGS := -g -Wall + +.INTERMEDIATE: $(CMD_FILE) + +CMDSRC_FILE := cmd.c +TARGETDIR := ../../../src +INCLUDEDIR := ../../../include +TESTTARGET_FILES := $(TARGETDIR)/hash.c $(TARGETDIR)/debugger.c $(TARGETDIR)/cmem.c $(TARGETDIR)/hash.c $(TARGETDIR)/cerr.c $(TARGETDIR)/word.c $(TARGETDIR)/exec.c $(TARGETDIR)/struct.c $(TARGETDIR)/debugger.c $(TARGETDIR)/dump.c # Set test target files + +$(CMD_FILE): $(CMDSRC_FILE) $(TESTTARGET_FILES) + $(CC) $(CFLAGS) -I $(INCLUDEDIR) -o $@ $^ + +clean_cmd: + @rm -rf cmd.dSYM cmd + +clean: clean_cmd diff --git a/test/unit/bpshash/cmd.c b/test/unit/bpshash/cmd.c new file mode 100644 index 0000000..0543358 --- /dev/null +++ b/test/unit/bpshash/cmd.c @@ -0,0 +1,11 @@ +#include "debugger.h" + +int main() +{ + int i; + WORD w[10] ={0, 1, 2, 3, 10, 250, 251, 254, 0x8FFF, 65535}; + for(i = 0; i < 10; i++) { + printf("%ld: %d\n", (long)w[i], adrhash(w[i])); + } + return 0; +} diff --git a/test/unit/bpshash/desc.txt b/test/unit/bpshash/desc.txt new file mode 100644 index 0000000..a9384b1 --- /dev/null +++ b/test/unit/bpshash/desc.txt @@ -0,0 +1 @@ +ブレークポイントを扱うハッシュ関数のテスト