Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/bin/expr Add a couple of new ATF expr(1) tests



details:   https://anonhg.NetBSD.org/src/rev/9dbafb29f3a0
branches:  trunk
changeset: 362841:9dbafb29f3a0
user:      kamil <kamil%NetBSD.org@localhost>
date:      Wed Jun 27 17:14:47 2018 +0000

description:
Add a couple of new ATF expr(1) tests

Some of the newly covered test-cases contained regressions.

All tests pass.

diffstat:

 tests/bin/expr/t_expr.sh |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r cce8e211f774 -r 9dbafb29f3a0 tests/bin/expr/t_expr.sh
--- a/tests/bin/expr/t_expr.sh  Wed Jun 27 17:12:49 2018 +0000
+++ b/tests/bin/expr/t_expr.sh  Wed Jun 27 17:14:47 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_expr.sh,v 1.4 2018/06/12 18:54:39 kamil Exp $
+# $NetBSD: t_expr.sh,v 1.5 2018/06/27 17:14:47 kamil Exp $
 #
 # Copyright (c) 2007 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -80,6 +80,22 @@
                  "expr: integer overflow or underflow occurred for operation '-9223372036854775808 % -1'"
        test_expr '-9223372036854775808 / -1' \
                  "expr: integer overflow or underflow occurred for operation '-9223372036854775808 / -1'"
+       test_expr '0 + -9223372036854775808' '-9223372036854775808'
+       test_expr '0 + -1' '-1'
+       test_expr '0 + 0' '0'
+       test_expr '0 + 1' '1'
+       test_expr '0 + 9223372036854775807' '9223372036854775807'
+       test_expr '-9223372036854775808 + 0' '-9223372036854775808'
+       test_expr '9223372036854775807 + 0' '9223372036854775807'
+       test_expr '4611686018427387904 \* -1' '-4611686018427387904'
+       test_expr '4611686018427387904 \* -2' '-9223372036854775808'
+       test_expr '4611686018427387904 \* -3' \
+                 "expr: integer overflow or underflow occurred for operation '4611686018427387904 * -3'"
+       test_expr '-4611686018427387904 \* -1' '4611686018427387904'
+       test_expr '-4611686018427387904 \* -2' \
+                 "expr: integer overflow or underflow occurred for operation '-4611686018427387904 * -2'"
+       test_expr '-4611686018427387904 \* -3' \
+                 "expr: integer overflow or underflow occurred for operation '-4611686018427387904 * -3'"
 }
 
 atf_test_case gtkmm



Home | Main Index | Thread Index | Old Index