From 37da20d7195c1dc157074ab4fd0ddf2690c5d6db Mon Sep 17 00:00:00 2001 From: j8takagi Date: Thu, 28 Jun 2018 22:22:50 +0900 Subject: [PATCH] =?utf8?q?=E3=83=96=E3=83=AC=E3=83=BC=E3=82=AF=E3=83=9D?= =?utf8?q?=E3=82=A4=E3=83=B3=E3=83=88=E3=82=92=E6=89=B1=E3=81=86=E3=83=8F?= =?utf8?q?=E3=83=83=E3=82=B7=E3=83=A5=E9=96=A2=E6=95=B0=E3=81=AE=E3=83=86?= =?utf8?q?=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- test/unit/bpshash/0.txt | 10 ++++++++++ test/unit/bpshash/Makefile | 20 ++++++++++++++++++++ test/unit/bpshash/cmd.c | 11 +++++++++++ test/unit/bpshash/desc.txt | 1 + 4 files changed, 42 insertions(+) create mode 100644 test/unit/bpshash/0.txt create mode 100644 test/unit/bpshash/Makefile create mode 100644 test/unit/bpshash/cmd.c create mode 100644 test/unit/bpshash/desc.txt 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 @@ +ブレークポイントを扱うハッシュ関数のテスト -- 2.18.0