summaryrefslogtreecommitdiff
path: root/tests/kwset-abuse
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2016-10-30 11:51:34 -0700
committerJim Meyering <meyering@fb.com>2016-11-14 19:12:22 -0800
commit1569ee170b8eb3e5a03ca3d7d53e71fd05fd08e5 (patch)
treeda31c08048a0f959ab8bd0ab7503264a8d3fc69c /tests/kwset-abuse
parent735085b7935ef12a9e6b7c42a99450f9e5497491 (diff)
downloadgrep-1569ee170b8eb3e5a03ca3d7d53e71fd05fd08e5.tar.gz
tests: use "returns_" rather than explicit comparison with "$?"
* tests/sjis-mb (encode): Rearrange to emit desired input into a file, rather than piping directly into grep. That permits the use of returns_ 1 to verify timeout's exit status. * tests/euc-mb: Use "returns_ 1" rather than testing $? = 1 * tests/char-class-multibyte: Likewise. * tests/dfa-heap-overrun: Likewise. * tests/encoding-error: Likewise. * tests/fedora: Likewise. * tests/grep-dev-null: Likewise. * tests/init.cfg (envvar_check_fail): Likewise. * tests/kwset-abuse: Likewise. * tests/mb-non-UTF8-overrun: Likewise. * tests/multibyte-white-space: Likewise. * tests/pcre-infloop: Likewise. * tests/surrogate-pair: Likewise. * tests/warn-char-classes: Likewise. Do the same for other values: * tests/backref-multibyte-slow: Likewise. * tests/euc-mb: Likewise. * tests/pcre-abort: Likewise. * tests/pcre-jitstack: Likewise. * tests/repetition-overflow: Likewise. * tests/reversed-range-endpoints: Likewise. * tests/warn-char-classes: Likewise.
Diffstat (limited to 'tests/kwset-abuse')
-rwxr-xr-xtests/kwset-abuse5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/kwset-abuse b/tests/kwset-abuse
index 84e9416f..a8680f81 100755
--- a/tests/kwset-abuse
+++ b/tests/kwset-abuse
@@ -25,8 +25,7 @@ fail=0
# with gdb showed a reallocation slightly larger than that in fillbuf.
# To reach the buggy code, the needle must have length < 1/11 that of
# the haystack, and 10,000 is a nice round number that fits the bill.
-printf '%0260000dXy\n' 0 | grep -F $(printf %010000dy 0)
-
-test $? = 1 || fail=1
+printf '%0260000dXy\n' 0 | returns_ 1 grep -F $(printf %010000dy 0) \
+ || fail=1
Exit $fail