Add 2 new expr(1) ATF tests

Assert that -9223372036854775808 % -1 and -9223372036854775808 / -1 return
message about overflow / underflow detected.

These tests pass correctly.

Sponsored by <The NetBSD Foundation>
This commit is contained in:
kamil 2018-06-12 18:54:39 +00:00
parent 7806b47917
commit 00a8c5e713

View File

@ -1,4 +1,4 @@
# $NetBSD: t_expr.sh,v 1.3 2012/03/27 07:23:06 jruoho Exp $
# $NetBSD: t_expr.sh,v 1.4 2018/06/12 18:54:39 kamil Exp $
#
# Copyright (c) 2007 The NetBSD Foundation, Inc.
# All rights reserved.
@ -76,6 +76,10 @@ overflow_body() {
"expr: integer overflow or underflow occurred for operation '4611686018427387904 * 2'"
test_expr '4611686018427387904 \* 3' \
"expr: integer overflow or underflow occurred for operation '4611686018427387904 * 3'"
test_expr '-9223372036854775808 % -1' \
"expr: integer overflow or underflow occurred for operation '-9223372036854775808 % -1'"
test_expr '-9223372036854775808 / -1' \
"expr: integer overflow or underflow occurred for operation '-9223372036854775808 / -1'"
}
atf_test_case gtkmm