From 8b7cb8893c99f05135a480de66e11bd2fe0033f1 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 15 Sep 2017 15:11:38 -0700 Subject: [PATCH] Add wen test (#954) --- README.md | 2 +- t/cmd_write | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d31a938c..38de35fc 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ run_tests.sh exits with the following exit codes: Reporting Radare2 Bugs ---------------------- -Please to not post Radare2 bugs on the r2-regressions github tracker. Instead +Please do not post Radare2 bugs on the r2-regressions github tracker. Instead use the official r2 tracker: https://github.com/radare/radare2/issues?state=open diff --git a/t/cmd_write b/t/cmd_write index 682d188a..b564d7f7 100755 --- a/t/cmd_write +++ b/t/cmd_write @@ -232,7 +232,6 @@ e.src.null=true rm -rf $TMPDIR/ run_test -## "wen" - insert null bytes NAME='wx pcache' FILE=../bins/pe/b.exe BROKEN= @@ -271,3 +270,33 @@ EXPECT='a/b 0|1 ' run_test + +## "wen" - insert null bytes + +NAME='wen' +FILE=malloc://4 +ARGS= +CMDS=' +wx 01020304 +wen 2 @ 1 +wen 1 @ 6 +p8 7 +' +EXPECT='01000002030400 +' +run_test + +NAME='wen should insert X null bytes even if io.cache=false' +FILE=malloc://8 +ARGS= +EXPECT='216607 +216608 +' +CMDS=' +cp ../bins/pe/b.exe .b.exe +o+ .b.exe +r +s 0x200 +wen 1 +r +rm .b.exe