From owner-svn-src-all@freebsd.org Sat Dec 3 02:47:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACDC7C633FE; Sat, 3 Dec 2016 02:47:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5108683F; Sat, 3 Dec 2016 02:47:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB32lHAU059394; Sat, 3 Dec 2016 02:47:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32lGtU059384; Sat, 3 Dec 2016 02:47:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030247.uB32lGtU059384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309466 - in stable/11: bin/cat/tests contrib/netbsd-tests contrib/netbsd-tests/bin/cat contrib/netbsd-tests/bin/sh contrib/netbsd-tests/bin/sh/dotcmd contrib/netbsd-tests/crypto/opencr... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:47:18 -0000 Author: ngie Date: Sat Dec 3 02:47:16 2016 New Revision: 309466 URL: https://svnweb.freebsd.org/changeset/base/309466 Log: MFC r305358: Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox Added: stable/11/contrib/netbsd-tests/bin/cat/d_se_output.in - copied unchanged from r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.in stable/11/contrib/netbsd-tests/bin/cat/d_se_output.out - copied unchanged from r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.out stable/11/contrib/netbsd-tests/bin/sh/t_arith.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_arith.sh stable/11/contrib/netbsd-tests/bin/sh/t_cmdsub.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_cmdsub.sh stable/11/contrib/netbsd-tests/bin/sh/t_option.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_option.sh stable/11/contrib/netbsd-tests/bin/sh/t_redir.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_redir.sh stable/11/contrib/netbsd-tests/bin/sh/t_redircloexec.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_redircloexec.sh stable/11/contrib/netbsd-tests/bin/sh/t_shift.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_shift.sh stable/11/contrib/netbsd-tests/bin/sh/t_varval.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_varval.sh stable/11/contrib/netbsd-tests/dev/fss/ - copied from r305358, head/contrib/netbsd-tests/dev/fss/ stable/11/contrib/netbsd-tests/dev/usb/ - copied from r305358, head/contrib/netbsd-tests/dev/usb/ stable/11/contrib/netbsd-tests/include/sys/t_pslist.c - copied unchanged from r305358, head/contrib/netbsd-tests/include/sys/t_pslist.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c - copied unchanged from r305358, head/contrib/netbsd-tests/kernel/kqueue/t_vnode.c stable/11/contrib/netbsd-tests/lib/libc/db/h_lfsr.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/db/h_lfsr.c stable/11/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c stable/11/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c stable/11/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c stable/11/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc stable/11/contrib/netbsd-tests/lib/libc/sys/t_bind.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sys/t_bind.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_wait.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sys/t_wait.c stable/11/contrib/netbsd-tests/lib/libm/t_fenv.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libm/t_fenv.c stable/11/contrib/netbsd-tests/lib/libm/t_hypot.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libm/t_hypot.c stable/11/contrib/netbsd-tests/lib/libusbhid/ - copied from r305358, head/contrib/netbsd-tests/lib/libusbhid/ stable/11/contrib/netbsd-tests/net/arp/ - copied from r305358, head/contrib/netbsd-tests/net/arp/ stable/11/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh stable/11/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh stable/11/contrib/netbsd-tests/net/if/ifconf.c - copied unchanged from r305358, head/contrib/netbsd-tests/net/if/ifconf.c stable/11/contrib/netbsd-tests/net/if/t_ifconf.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/if/t_ifconf.sh stable/11/contrib/netbsd-tests/net/if/t_ifconfig.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/if/t_ifconfig.sh stable/11/contrib/netbsd-tests/net/if_gif/ - copied from r305358, head/contrib/netbsd-tests/net/if_gif/ stable/11/contrib/netbsd-tests/net/if_pppoe/ - copied from r305358, head/contrib/netbsd-tests/net/if_pppoe/ stable/11/contrib/netbsd-tests/net/if_tap/ - copied from r305358, head/contrib/netbsd-tests/net/if_tap/ stable/11/contrib/netbsd-tests/net/in_cksum/ - copied from r305358, head/contrib/netbsd-tests/net/in_cksum/ stable/11/contrib/netbsd-tests/net/mcast/ - copied from r305358, head/contrib/netbsd-tests/net/mcast/ stable/11/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh stable/11/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh stable/11/contrib/netbsd-tests/net/ndp/ - copied from r305358, head/contrib/netbsd-tests/net/ndp/ stable/11/contrib/netbsd-tests/net/net/t_forwarding.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/net/t_forwarding.sh stable/11/contrib/netbsd-tests/net/net/t_ipaddress.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/net/t_ipaddress.sh stable/11/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh stable/11/contrib/netbsd-tests/net/net/t_ipv6address.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/net/t_ipv6address.sh stable/11/contrib/netbsd-tests/net/route/t_flags.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/route/t_flags.sh stable/11/contrib/netbsd-tests/net/route/t_flags6.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/route/t_flags6.sh stable/11/contrib/netbsd-tests/net/route/t_route.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/route/t_route.sh stable/11/contrib/netbsd-tests/sbin/gpt/ - copied from r305358, head/contrib/netbsd-tests/sbin/gpt/ stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh - copied unchanged from r305358, head/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh stable/11/contrib/netbsd-tests/sys/net/ - copied from r305358, head/contrib/netbsd-tests/sys/net/ stable/11/contrib/netbsd-tests/sys/netatalk/ - copied from r305358, head/contrib/netbsd-tests/sys/netatalk/ stable/11/contrib/netbsd-tests/sys/netinet/ - copied from r305358, head/contrib/netbsd-tests/sys/netinet/ stable/11/contrib/netbsd-tests/sys/netinet6/ - copied from r305358, head/contrib/netbsd-tests/sys/netinet6/ stable/11/contrib/netbsd-tests/usr.bin/config/d_min - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/config/d_min stable/11/contrib/netbsd-tests/usr.bin/gdb/ - copied from r305358, head/contrib/netbsd-tests/usr.bin/gdb/ stable/11/contrib/netbsd-tests/usr.bin/ld/ - copied from r305358, head/contrib/netbsd-tests/usr.bin/ld/ stable/11/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c stable/11/lib/libc/tests/stdio/open_memstream2_test.c - copied unchanged from r305358, head/lib/libc/tests/stdio/open_memstream2_test.c Deleted: stable/11/contrib/netbsd-tests/bin/sh/t_compexit.sh stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c stable/11/lib/libc/tests/stdio/open_memstream_test.c Modified: stable/11/bin/cat/tests/Makefile stable/11/contrib/netbsd-tests/bin/cat/d_align.in stable/11/contrib/netbsd-tests/bin/cat/d_align.out stable/11/contrib/netbsd-tests/bin/cat/t_cat.sh stable/11/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command stable/11/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh stable/11/contrib/netbsd-tests/bin/sh/t_evaltested.sh stable/11/contrib/netbsd-tests/bin/sh/t_exit.sh stable/11/contrib/netbsd-tests/bin/sh/t_expand.sh stable/11/contrib/netbsd-tests/bin/sh/t_fsplit.sh stable/11/contrib/netbsd-tests/bin/sh/t_here.sh stable/11/contrib/netbsd-tests/bin/sh/t_set_e.sh stable/11/contrib/netbsd-tests/bin/sh/t_ulimit.sh stable/11/contrib/netbsd-tests/bin/sh/t_varquote.sh stable/11/contrib/netbsd-tests/bin/sh/t_wait.sh stable/11/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh stable/11/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue stable/11/contrib/netbsd-tests/dev/dm/h_dm.c stable/11/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh stable/11/contrib/netbsd-tests/dev/sysmon/t_swwdog.c stable/11/contrib/netbsd-tests/fs/common/fstest_lfs.c stable/11/contrib/netbsd-tests/fs/common/h_fsmacros.h stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c stable/11/contrib/netbsd-tests/fs/nfs/t_rquotad.sh stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh stable/11/contrib/netbsd-tests/fs/vfs/t_io.c stable/11/contrib/netbsd-tests/fs/vfs/t_renamerace.c stable/11/contrib/netbsd-tests/fs/vfs/t_unpriv.c stable/11/contrib/netbsd-tests/fs/vfs/t_vnops.c stable/11/contrib/netbsd-tests/games/t_factor.sh stable/11/contrib/netbsd-tests/h_macros.h stable/11/contrib/netbsd-tests/include/sys/t_bitops.c stable/11/contrib/netbsd-tests/include/sys/t_cdefs.c stable/11/contrib/netbsd-tests/include/sys/t_socket.c stable/11/contrib/netbsd-tests/include/t_paths.c stable/11/contrib/netbsd-tests/ipf/expected/n14 stable/11/contrib/netbsd-tests/ipf/expected/n14_6 stable/11/contrib/netbsd-tests/ipf/t_filter_parse.sh stable/11/contrib/netbsd-tests/ipf/t_nat_exec.sh stable/11/contrib/netbsd-tests/kernel/kqueue/t_ioctl.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c stable/11/contrib/netbsd-tests/kernel/t_rnd.c stable/11/contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c stable/11/contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S stable/11/contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S stable/11/contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S stable/11/contrib/netbsd-tests/lib/libc/db/t_db.sh stable/11/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c stable/11/contrib/netbsd-tests/lib/libc/gen/isqemu.h stable/11/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_randomid.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_sleep.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_time.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_vis.c stable/11/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c stable/11/contrib/netbsd-tests/lib/libc/net/t_servent.sh stable/11/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c stable/11/contrib/netbsd-tests/lib/libc/string/t_memset.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_connect.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_kevent.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_mlock.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_mmap.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c stable/11/contrib/netbsd-tests/lib/libc/time/t_strptime.c stable/11/contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y stable/11/contrib/netbsd-tests/lib/libm/t_exp.c stable/11/contrib/netbsd-tests/lib/libm/t_fmod.c stable/11/contrib/netbsd-tests/lib/libm/t_log.c stable/11/contrib/netbsd-tests/lib/libm/t_pow.c stable/11/contrib/netbsd-tests/lib/libpthread/t_cond.c stable/11/contrib/netbsd-tests/lib/libpthread/t_mutex.c stable/11/contrib/netbsd-tests/lib/libpthread/t_rwlock.c stable/11/contrib/netbsd-tests/lib/librumpclient/t_exec.sh stable/11/contrib/netbsd-tests/lib/librumpclient/t_fd.c stable/11/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh stable/11/contrib/netbsd-tests/lib/libutil/t_parsedate.c stable/11/contrib/netbsd-tests/net/bpfilter/t_bpfilter.c stable/11/contrib/netbsd-tests/net/bpfjit/t_bpfjit.c stable/11/contrib/netbsd-tests/net/icmp/t_forward.c stable/11/contrib/netbsd-tests/net/icmp/t_ping.c stable/11/contrib/netbsd-tests/net/icmp/t_ping2.sh stable/11/contrib/netbsd-tests/net/if_bridge/t_bridge.sh stable/11/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh stable/11/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh stable/11/contrib/netbsd-tests/net/mpls/t_rfc4182.sh stable/11/contrib/netbsd-tests/net/net/t_tcp.c stable/11/contrib/netbsd-tests/net/route/t_change.sh stable/11/contrib/netbsd-tests/rump/modautoload/t_modautoload.c stable/11/contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c stable/11/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c stable/11/contrib/netbsd-tests/rump/rumpkern/t_sp.sh stable/11/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh stable/11/contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c stable/11/contrib/netbsd-tests/sbin/resize_ffs/common.sh stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh stable/11/contrib/netbsd-tests/sbin/sysctl/t_perm.sh stable/11/contrib/netbsd-tests/share/mk/t_lib.sh stable/11/contrib/netbsd-tests/share/mk/t_prog.sh stable/11/contrib/netbsd-tests/share/mk/t_test.sh stable/11/contrib/netbsd-tests/usr.bin/cc/t_hello.sh stable/11/contrib/netbsd-tests/usr.bin/config/support/conf/files stable/11/contrib/netbsd-tests/usr.bin/config/t_config.sh stable/11/contrib/netbsd-tests/usr.bin/make/t_make.sh stable/11/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh stable/11/contrib/netbsd-tests/usr.bin/sed/t_sed.sh stable/11/contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt (contents, props changed) stable/11/contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt (contents, props changed) stable/11/contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt (contents, props changed) stable/11/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh stable/11/lib/libc/tests/db/Makefile stable/11/lib/libc/tests/hash/Makefile stable/11/lib/libc/tests/inet/Makefile stable/11/lib/libc/tests/stdio/Makefile stable/11/lib/libc/tests/stdlib/Makefile stable/11/lib/libc/tests/sys/Makefile stable/11/lib/msun/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/cat/tests/Makefile ============================================================================== --- stable/11/bin/cat/tests/Makefile Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/bin/cat/tests/Makefile Sat Dec 3 02:47:16 2016 (r309466) @@ -6,7 +6,15 @@ NETBSD_ATF_TESTS_SH= cat_test ${PACKAGE}FILES+= d_align.in ${PACKAGE}FILES+= d_align.out +${PACKAGE}FILES+= d_se_output.in +${PACKAGE}FILES+= d_se_output.out .include +d_align.out: ${TESTSRC}/d_align.out + sed -E -e 's,^[[:space:]]{7}\$$$$,\$$,' < ${.ALLSRC} > ${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} + +CLEANFILES+= d_align.out d_align.out.tmp + .include Modified: stable/11/contrib/netbsd-tests/bin/cat/d_align.in ============================================================================== --- stable/11/contrib/netbsd-tests/bin/cat/d_align.in Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/contrib/netbsd-tests/bin/cat/d_align.in Sat Dec 3 02:47:16 2016 (r309466) @@ -1,3 +1,5 @@ a b c + 1 2 3 + x y z Modified: stable/11/contrib/netbsd-tests/bin/cat/d_align.out ============================================================================== --- stable/11/contrib/netbsd-tests/bin/cat/d_align.out Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/contrib/netbsd-tests/bin/cat/d_align.out Sat Dec 3 02:47:16 2016 (r309466) @@ -1,3 +1,5 @@ 1 a b c$ + $ 2 1 2 3$ + $ 3 x y z$ Copied: stable/11/contrib/netbsd-tests/bin/cat/d_se_output.in (from r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/netbsd-tests/bin/cat/d_se_output.in Sat Dec 3 02:47:16 2016 (r309466, copy of r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.in) @@ -0,0 +1,3 @@ + +Of course it runs NetBSD + Copied: stable/11/contrib/netbsd-tests/bin/cat/d_se_output.out (from r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/netbsd-tests/bin/cat/d_se_output.out Sat Dec 3 02:47:16 2016 (r309466, copy of r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.out) @@ -0,0 +1,3 @@ +$ +Of course it runs NetBSD$ +$ Modified: stable/11/contrib/netbsd-tests/bin/cat/t_cat.sh ============================================================================== --- stable/11/contrib/netbsd-tests/bin/cat/t_cat.sh Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/contrib/netbsd-tests/bin/cat/t_cat.sh Sat Dec 3 02:47:16 2016 (r309466) @@ -1,4 +1,4 @@ -# $NetBSD: t_cat.sh,v 1.2 2012/03/27 17:57:02 jruoho Exp $ +# $NetBSD: t_cat.sh,v 1.3 2016/06/16 01:04:58 sevan Exp $ # # Copyright (c) 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -52,8 +52,20 @@ nonexistent_body() { -x "cat /some/name/that/does/not/exist" } +atf_test_case se_output +se_output_head() { + atf_set "descr" "Test that cat(1) prints a $ sign " \ + "on blank lines with options '-se' (PR bin/51250)" +} + +se_output_body() { + atf_check -s ignore -o file:$(atf_get_srcdir)/d_se_output.out \ + -x "cat -se $(atf_get_srcdir)/d_se_output.in" +} + atf_init_test_cases() { atf_add_test_case align atf_add_test_case nonexistent + atf_add_test_case se_output } Modified: stable/11/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command ============================================================================== --- stable/11/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command Sat Dec 3 02:47:16 2016 (r309466) @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: scoped_command,v 1.1 2014/05/31 14:29:06 christos Exp $ +# $NetBSD: scoped_command,v 1.2 2016/03/27 14:57:50 christos Exp $ # # Copyright (c) 2014 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,6 +30,27 @@ # POSSIBILITY OF SUCH DAMAGE. # +: ${TEST_SH:=/bin/sh} + +sane_sh() +{ + set -- ${TEST_SH} + case "$#" in + (0) set /bin/sh;; + (1|2) ;; + (*) set "$1";; # Just ignore options if we cannot make them work + esac + + case "$1" in + /*) TEST_SH="$1${2+ }$2";; + ./*) TEST_SH="${PWD}${1#.}${2+ }$2";; + */*) TEST_SH="${PWD}/$1${2+ }$2";; + *) TEST_SH="$( command -v "$1" )${2+ }$2";; + esac +} + +sane_sh + set -e # USAGE: @@ -52,7 +73,7 @@ cmd="echo 'before ${3}' ${2} echo 'after ${3}, return value:' ${?}" -echo "#!/bin/sh" +echo "#!${TEST_SH}" [ 'func' = "${1}" ] && cat </dev/null + then + # 16 bits or less, or hex unsupported, just give up... + return + fi + test $( ${TEST_SH} -c 'echo $(( 0x1FFFF ))' ) = 131071 || return + + # when attempting to exceed the number of available bits + # the shell may react in any of 3 (rational) ways + # 1. syntax error (maybe even core dump...) and fail + # 2. represent a positive number input as negative value + # 3. keep the number positive, but not the value expected + # (perhaps pegged at the max possible value) + # any of those may be accompanied by a message to stderr + + # Must check all 3 possibilities for each plausible size + # Tests do not use 0x8000... because that value can have weird + # other side effects that are not relevant to discover here. + # But we do want to try and force the sign bit set. + + if ! ${TEST_SH} -c ': $(( 0xC0000000 ))' 2>/dev/null + then + # proobably shell detected overflow and complained + ARITH_BITS=32 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c 'case $(( 0xC0000000 )); in (-*) exit 0;; esac; exit 1' + then + ARITH_BITS=32 + return + fi + if ${TEST_SH} -c '[ $(( 0xC0000000 )) != 3221225472 ]' 2>/dev/null + then + ARITH_BITS=32 + return + fi + + if ! ${TEST_SH} -c ': $(( 0xC000000000000000 ))' 2>/dev/null + then + ARITH_BITS=64 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c 'case $(( 0xC000000000000000 )); in (-*) exit 0;; esac; exit 1' + then + ARITH_BITS=64 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c '[ $((0xC000000000000000)) != 13835058055282163712 ]' + then + ARITH_BITS=64 + return + fi + + if ${TEST_SH} 2>/dev/null -c \ + '[ $((0x123456781234567812345678)) = 5634002657842756053938493048 ]' + then + # just assume... (for now anyway, revisit when it happens...) + ARITH_BITS=96 + return + fi +} + +atf_test_case constants +constants_head() +{ + atf_set "descr" "Tests that arithmetic expansion can handle constants" +} +constants_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((0x0))' + + # atf_expect_fail "PR bin/50959" + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((0X0))' + # atf_expect_pass + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((000))' + + atf_check -s exit:0 -o inline:'1\n' -e empty \ + ${TEST_SH} -c 'echo $(( 000000001 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x000000 ))' + + atf_check -s exit:0 -o inline:'99999\n' -e empty \ + ${TEST_SH} -c 'echo $((99999))' + + [ ${ARITH_BITS} -gt 44 ] && + atf_check -s exit:0 -o inline:'9191919191919\n' -e empty \ + ${TEST_SH} -c 'echo $((9191919191919))' + + atf_check -s exit:0 -o inline:'13\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xD ))' + atf_check -s exit:0 -o inline:'11\n' -e empty ${TEST_SH} -c \ + 'echo $(( 013 ))' + atf_check -s exit:0 -o inline:'7\n' -e empty ${TEST_SH} -c \ + 'x=7;echo $(($x))' + atf_check -s exit:0 -o inline:'9\n' -e empty ${TEST_SH} -c \ + 'x=9;echo $((x))' + + atf_check -s exit:0 -o inline:'11\n' -e empty \ + ${TEST_SH} -c 'x=0xB; echo $(( $x ))' + atf_check -s exit:0 -o inline:'27\n' -e empty \ + ${TEST_SH} -c 'x=0X1B; echo $(( x ))' + atf_check -s exit:0 -o inline:'27\n' -e empty \ + ${TEST_SH} -c 'X=033; echo $(( $X ))' + atf_check -s exit:0 -o inline:'219\n' -e empty \ + ${TEST_SH} -c 'X=0333; echo $(( X ))' + atf_check -s exit:0 -o inline:'0\n' -e empty \ + ${TEST_SH} -c 'NULL=; echo $(( NULL ))' + + # Not clear if this is 0, nothing, or an error, so omit for now + # atf_check -s exit:0 -o inline:'0\n' -e empty \ + # ${TEST_SH} -c 'echo $(( ))' + + # not clear whether this should return 0 or an error, so omit for now + # atf_check -s exit:0 -o inline:'0\n' -e empty \ + # ${TEST_SH} -c 'echo $(( UNDEFINED_VAR ))' +} + + +atf_test_case do_unary_plus +do_unary_plus_head() +{ + atf_set "descr" "Tests that unary plus works as expected" +} +do_unary_plus_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( +0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( +1 ))' + atf_check -s exit:0 -o inline:'6\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 6 ))' + atf_check -s exit:0 -o inline:'4321\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 4321 ))' + atf_check -s exit:0 -o inline:'17185\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 0x4321 ))' +} + +atf_test_case do_unary_minus +do_unary_minus_head() +{ + atf_set "descr" "Tests that unary minus works as expected" +} +do_unary_minus_body() +{ + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 0 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 1 ))' + atf_check -s exit:0 -o inline:'-6\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 6 ))' + atf_check -s exit:0 -o inline:'-4321\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 4321 ))' + atf_check -s exit:0 -o inline:'-2257\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 04321 ))' + atf_check -s exit:0 -o inline:'-7\n' -e empty ${TEST_SH} -c \ + 'echo $((-7))' +} + +atf_test_case do_unary_not +do_unary_not_head() +{ + atf_set "descr" "Tests that unary not (boolean) works as expected" +} +do_unary_not_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 0 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( !1234 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( !0xFFFF ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 000000 ))' +} + +atf_test_case do_unary_tilde +do_unary_tilde_head() +{ + atf_set "descr" "Tests that unary not (bitwise) works as expected" +} +do_unary_tilde_body() +{ + # definitely 2's complement arithmetic here... + + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~ 0 ))' + atf_check -s exit:0 -o inline:'-2\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~ 1 ))' + + atf_check -s exit:0 -o inline:'-1235\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~1234 ))' + atf_check -s exit:0 -o inline:'-256\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~0xFF ))' +} + +atf_test_case elementary_add +elementary_add_head() +{ + atf_set "descr" "Tests that simple addition works as expected" +} +elementary_add_body() +{ + # some of these tests actually test unary ops & op precedence... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 + 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 + 1 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 1 ))' + atf_check -s exit:0 -o inline:'10\n' -e empty ${TEST_SH} -c \ + 'echo $(( 4 + 6 ))' + atf_check -s exit:0 -o inline:'10\n' -e empty ${TEST_SH} -c \ + 'echo $(( 6 + 4 ))' + atf_check -s exit:0 -o inline:'5555\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 + 4321 ))' + atf_check -s exit:0 -o inline:'3333\n' -e empty ${TEST_SH} -c \ + 'echo $((1111+2222))' + atf_check -s exit:0 -o inline:'5555\n' -e empty ${TEST_SH} -c \ + 'echo $((+3333+2222))' + atf_check -s exit:0 -o inline:'7777\n' -e empty ${TEST_SH} -c \ + 'echo $((+3333 + +4444))' + atf_check -s exit:0 -o inline:'-7777\n' -e empty ${TEST_SH} -c \ + 'echo -$((+4125+ +3652))' +} + +atf_test_case elementary_sub +elementary_sub_head() +{ + atf_set "descr" "Tests that simple subtraction works as expected" +} +elementary_sub_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 - 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 - 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 - 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 - 1 ))' + atf_check -s exit:0 -o inline:'488\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1066 - 578 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016-5678 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016+-5678 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016-+5678 ))' + atf_check -s exit:0 -o inline:'-7694\n' -e empty ${TEST_SH} -c \ + 'echo $(( -2016-5678 ))' + atf_check -s exit:0 -o inline:'--1\n' -e empty ${TEST_SH} -c \ + 'echo -$(( -1018 - -1017 ))' +} + +atf_test_case elementary_mul +elementary_mul_head() +{ + atf_set "descr" "Tests that simple multiplication works as expected" +} +elementary_mul_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 * 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 * 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 * 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * -1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 * -1 ))' + atf_check -s exit:0 -o inline:'391\n' -e empty ${TEST_SH} -c \ + 'echo $(( 17 * 23 ))' + atf_check -s exit:0 -o inline:'169\n' -e empty ${TEST_SH} -c \ + 'echo $(( 13*13 ))' + atf_check -s exit:0 -o inline:'-11264\n' -e empty ${TEST_SH} -c \ + 'echo $(( -11 *1024 ))' + atf_check -s exit:0 -o inline:'-16983\n' -e empty ${TEST_SH} -c \ + 'echo $(( 17* -999 ))' + atf_check -s exit:0 -o inline:'9309\n' -e empty ${TEST_SH} -c \ + 'echo $(( -29*-321 ))' +} + +atf_test_case elementary_div +elementary_div_head() +{ + atf_set "descr" "Tests that simple division works as expected" +} +elementary_div_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 / 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 / 1 ))' + test ${ARITH_BITS} -ge 38 && + atf_check -s exit:0 -o inline:'99999999999\n' -e empty \ + ${TEST_SH} -c 'echo $(( 99999999999 / 1 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 / 1 ))' + + atf_check -s exit:0 -o inline:'3\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 4 ))' + + atf_check -s exit:0 -o inline:'173\n' -e empty ${TEST_SH} -c \ + 'echo $(( 123456 / 713 ))' + atf_check -s exit:0 -o inline:'13\n' -e empty ${TEST_SH} -c \ + 'echo $(( 169 / 13 ))' +} + +atf_test_case elementary_rem +elementary_rem_head() +{ + atf_set "descr" "Tests that simple modulus works as expected" +} +elementary_rem_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 9999 % 1 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 2 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF % 2 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 3 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 3 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 % 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3123 % 3 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 9999 % 2 ))' + + atf_check -s exit:0 -o inline:'107\n' -e empty ${TEST_SH} -c \ + 'echo $(( 123456%173 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((169%13))' +} + +atf_test_case elementary_shl +elementary_shl_head() +{ + atf_set "descr" "Tests that simple shift left works as expected" +} +elementary_shl_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 17 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 0 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 1 ))' + atf_check -s exit:0 -o inline:'131072\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 17 ))' + + atf_check -s exit:0 -o inline:'2021161080\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x3C3C3C3C << 1 ))' + + test "${ARITH_BITS}" -ge 40 && + atf_check -s exit:0 -o inline:'129354309120\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x3C3C3C3C << 7 ))' + test "${ARITH_BITS}" -ge 72 && + atf_check -s exit:0 -o inline:'1111145054534149079040\n' \ + -e empty ${TEST_SH} -c 'echo $(( 0x3C3C3C3C << 40 ))' + + return 0 +} + +atf_test_case elementary_shr +elementary_shr_head() +{ + atf_set "descr" "Tests that simple shift right works as expected" +} +elementary_shr_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 17 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >> 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >> 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 >> 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 >> 1 ))' + + atf_check -s exit:0 -o inline:'4\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x10 >> 2 ))' + atf_check -s exit:0 -o inline:'4\n' -e empty ${TEST_SH} -c \ + 'echo $(( 022 >> 2 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 131072 >> 17 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'8\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x4000000000 >> 35 ))' + test ${ARITH_BITS} -ge 80 && + atf_check -s exit:0 -o inline:'4464\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x93400FACE005C871000 >> 64 ))' + + return 0 +} + +atf_test_case elementary_eq +elementary_eq_head() +{ + atf_set "descr" "Tests that simple equality test works as expected" +} +elementary_eq_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0000 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0x00 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 == 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=30; Y=0x1E; echo $(( X == Y ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 == 4660 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 == 011064 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0000000000000001 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0x10000000000000 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 == 2 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=3; Y=7; echo $(( X == Y ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 == 0x4660 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 01234 == 0x11064 ))' +} +atf_test_case elementary_ne +elementary_ne_head() +{ + atf_set "descr" "Tests that simple inequality test works as expected" +} +elementary_ne_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 != 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x71 != 17 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 != 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 != 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=3; echo $(( X != 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=3; Y=0x11; echo $(( X != Y ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 != 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 != 0x0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA != 012 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=1; echo $(( X != 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=0xC; Y=014; echo $(( X != Y ))' +} +atf_test_case elementary_lt +elementary_lt_head() +{ + atf_set "descr" "Tests that simple less than test works as expected" +} +elementary_lt_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 < 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 10 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 100 < 101 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 < 200 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 0 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1BEEFF00D < 0x1FACECAFE ))' + + return 0 +} +atf_test_case elementary_le +elementary_le_head() +{ + atf_set "descr" "Tests that simple less or equal test works as expected" +} +elementary_le_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 <= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 10 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 100 <= 101 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 <= 161 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 <= 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -100 <= -200 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'cost=; AUD=; echo $(( $cost 0x2FEEDBABE <= $AUD 12866927294 ))' + + return 0 +} +atf_test_case elementary_gt +elementary_gt_head() +{ + atf_set "descr" "Tests that simple greater than works as expected" +} +elementary_gt_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 > 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 > -1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 11 > 012 ))' + + # atf_expect_fail "PR bin/50959" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2147483647 > 0X7FFFFF0 ))' + # atf_expect_pass + + test ${ARITH_BITS} -gt 32 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x80000000 > 0x7FFFFFFF ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 > 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 10 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2015 > 2016 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 > 200 ))' + + test ${ARITH_BITS} -ge 44 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x7F07F07F0 > 34099628014 ))' + + return 0 +} +atf_test_case elementary_ge +elementary_ge_head() +{ + atf_set "descr" "Tests that simple greater or equal works as expected" +} +elementary_ge_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -100 >= -101 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 >= 0 ))' +} + +atf_test_case fiddle_bits_and +fiddle_bits_and_head() +{ + atf_set "descr" "Test bitwise and operations in arithmetic expressions" +} +fiddle_bits_and_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 & 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 & 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 & 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 & 1 ))' + + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFF & 0xFF ))' + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF & 0377 ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'70377641607203\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 & 0x42871357BAB3 ))' + + return 0 +} +atf_test_case fiddle_bits_or +fiddle_bits_or_head() +{ + atf_set "descr" "Test bitwise or operations in arithmetic expressions" +} +fiddle_bits_or_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 | 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 | 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 | 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 | 1 ))' + + atf_check -s exit:0 -o inline:'4369\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 | 0x1111 ))' + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xAA | 0125 ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'95348271856563\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 | 0x42871357BAB3 ))' + + return 0 +} +atf_test_case fiddle_bits_xor +fiddle_bits_xor_head() +{ + atf_set "descr" "Test bitwise xor operations in arithmetic expressions" +} +fiddle_bits_xor_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ^ 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ^ 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ^ 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ^ 1 ))' + + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xF0 ^ 0x0F ))' + atf_check -s exit:0 -o inline:'15\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xF0 ^ 0xFF ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'24970630249360\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 ^ 0x42871357BAB3 ))' + + return 0 +} + +atf_test_case logical_and +logical_and_head() +{ + atf_set "descr" "Test logical and operations in arithmetic expressions" +} +logical_and_body() +{ + # cannot test short-circuit eval until sh implements side effects... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 && 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 && 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 && 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 && 1 ))' + + # atf_expect_fail "PR bin/50960" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 && 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF && 0xF0F0 ))' +} +atf_test_case logical_or +logical_or_head() +{ + atf_set "descr" "Test logical or operations in arithmetic expressions" +} +logical_or_body() +{ + # cannot test short-circuit eval until sh implements side effects... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 || 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 || 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 || 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 || 1 ))' + + # atf_expect_fail "PR bin/50960" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 || 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x33 || 0xF0F0 ))' +} + +atf_test_case make_selection +make_selection_head() +{ + atf_set "descr" "Test ?: operator in arithmetic expressions" +} +make_selection_body() +{ + # atf_expect_fail "PR bin/50958" + + atf_check -s exit:0 -o inline:'3\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ? 2 : 3 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ? 2 : 3 ))' + + atf_check -s exit:0 -o inline:'111\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 ? 111 : 222 ))' + + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 2 ? -1 : 1 > 2 ? 1 : 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 1 ? -1 : 1 > 1 ? 1 : 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 < 1 ? -1 : 2 > 1 ? 1 : 0 ))' +} + +atf_test_case operator_precedence +operator_precedence_head() +{ + atf_set "descr" "Test operator precedence without parentheses" +} +operator_precedence_body() +{ + # NB: apart from $(( )) ** NO ** parentheses in the expressions. + + atf_check -s exit:0 -o inline:'6\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 2 + 3 ))' *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***