150477Speter# Copyright (c) 2019 Conrad Meyer <cem@FreeBSD.org> 231706Spst# All rights reserved. 326931Smsmith# 41590Srgrimes# Redistribution and use in source and binary forms, with or without 5160750Syar# modification, are permitted provided that the following conditions 6160750Syar# are met: 731706Spst# 1. Redistributions of source code must retain the above copyright 831706Spst# notice, this list of conditions and the following disclaimer. 931706Spst# 2. Redistributions in binary form must reproduce the above copyright 1031706Spst# notice, this list of conditions and the following disclaimer in the 11223328Sgavin# documentation and/or other materials provided with the distribution. 12223328Sgavin# 1387824Smikeh# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 141590Srgrimes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15223328Sgavin# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16223328Sgavin# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 171590Srgrimes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18160750Syar# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19160750Syar# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20160750Syar# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21160750Syar# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22223328Sgavin# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23125503Sru# SUCH DAMAGE. 24125503Sru# 2526931Smsmith 26201386Sedatf_test_case float_rounding 27201386Sedfloat_rounding_head() 2831706Spst{ 2931706Spst atf_set "descr" "Check for correct termination in the face of floating point rounding" 3031706Spst} 3131706Spstfloat_rounding_body() 3226931Smsmith{ 331590Srgrimes atf_check -o inline:'1\n1.1\n1.2\n' seq 1 0.1 1.2 34} 35 36atf_test_case format_includes_conversion 37format_includes_conversion_head() 38{ 39 atf_set "descr" "Check for correct user-provided format strings" 40} 41format_includes_conversion_body() 42{ 43 # PR 236347 44 atf_check -s exit:1 -o empty -e match:"invalid format string" \ 45 seq -f foo 3 46 atf_check -s exit:0 -o inline:'foo1\nfoo2\n' -e empty \ 47 seq -f foo%g 2 48} 49 50atf_init_test_cases() 51{ 52 atf_add_test_case float_rounding 53 atf_add_test_case format_includes_conversion 54} 55