003 File Manager
Current Path:
/usr/src/contrib/bc/tests/bc
usr
/
src
/
contrib
/
bc
/
tests
/
bc
/
📁
..
📄
abs.txt
(90 B)
📄
abs_results.txt
(52 B)
📄
add.txt
(7.12 KB)
📄
add_results.txt
(4.24 KB)
📄
all.txt
(313 B)
📄
arctangent.txt
(364 B)
📄
arctangent_results.txt
(783 B)
📄
arrays.txt
(66 B)
📄
arrays_results.txt
(6 B)
📄
assignments.txt
(821 B)
📄
assignments_results.txt
(344 B)
📄
boolean.txt
(2.37 KB)
📄
boolean_results.txt
(368 B)
📄
comp.txt
(2.58 KB)
📄
comp_results.txt
(262 B)
📄
cosine.txt
(496 B)
📄
cosine_results.txt
(845 B)
📄
decimal.txt
(2.23 KB)
📄
decimal_results.txt
(2.13 KB)
📄
divide.txt
(1.88 KB)
📄
divide_results.txt
(1.16 KB)
📄
engineering.txt
(160 B)
📄
engineering_results.txt
(179 B)
📁
errors
📄
errors.txt
(3.97 KB)
📄
exponent.txt
(206 B)
📄
exponent_results.txt
(697 B)
📄
functions.txt
(124 B)
📄
functions_results.txt
(15 B)
📄
globals.txt
(156 B)
📄
globals_results.txt
(18 B)
📄
length.txt
(2.47 KB)
📄
length_results.txt
(276 B)
📄
letters.txt
(133 B)
📄
letters_results.txt
(156 B)
📄
lib2.txt
(5.75 KB)
📄
lib2_results.txt
(14.71 KB)
📄
log.txt
(212 B)
📄
log_results.txt
(703 B)
📄
misc.txt
(206 B)
📄
misc1.txt
(611 B)
📄
misc1_results.txt
(163 B)
📄
misc2.txt
(1.43 KB)
📄
misc2_results.txt
(186 B)
📄
misc3.txt
(102 B)
📄
misc3_results.txt
(70 B)
📄
misc4.txt
(31 B)
📄
misc4_results.txt
(3 B)
📄
misc5.txt
(131 B)
📄
misc5_results.txt
(11 B)
📄
misc6.txt
(25 B)
📄
misc6_results.txt
(2 B)
📄
misc7.txt
(37 B)
📄
misc7_results.txt
(6 B)
📄
misc_results.txt
(70 B)
📄
modulus.txt
(1.02 KB)
📄
modulus_results.txt
(568 B)
📄
multiply.txt
(3.32 KB)
📄
multiply_results.txt
(2.35 KB)
📄
pi.txt
(52 B)
📄
pi_results.txt
(5.29 KB)
📄
places.txt
(218 B)
📄
places_results.txt
(96 B)
📄
posix_errors.txt
(584 B)
📄
power.txt
(577 B)
📄
power_results.txt
(2.57 KB)
📄
print2.txt
(4.95 KB)
📄
print2_results.txt
(3.54 KB)
📄
rand.txt
(4.1 KB)
📄
rand_results.txt
(3.44 KB)
📄
read.txt
(6 B)
📄
read_errors.txt
(12 B)
📄
read_results.txt
(2 B)
📄
scale.txt
(983 B)
📄
scale_results.txt
(130 B)
📄
scientific.txt
(429 B)
📄
scientific_results.txt
(443 B)
📁
scripts
📄
shift.txt
(93.51 KB)
📄
shift_results.txt
(89.55 KB)
📄
sine.txt
(3.61 KB)
📄
sine_results.txt
(4.4 KB)
📄
sqrt.txt
(345 B)
📄
sqrt_results.txt
(380 B)
📄
stdin.txt
(344 B)
📄
stdin1.txt
(25 B)
📄
stdin1_results.txt
(2 B)
📄
stdin2.txt
(37 B)
📄
stdin2_results.txt
(6 B)
📄
stdin_results.txt
(103 B)
📄
strings.txt
(147 B)
📄
strings_results.txt
(87 B)
📄
subtract.txt
(6.57 KB)
📄
subtract_results.txt
(3.93 KB)
📄
timeconst.sh
(2.54 KB)
📄
trunc.txt
(147 B)
📄
trunc_results.txt
(47 B)
📄
vars.txt
(667 B)
📄
vars_results.txt
(512 B)
📄
void.txt
(198 B)
📄
void_results.txt
(63 B)
Editing: timeconst.sh
#! /bin/sh # # Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # Tests the timeconst.bc script from the Linux kernel build. # You can find the script at kernel/time/timeconst.bc in any Linux repo. # One such repo is: https://github.com/torvalds/linux script="$0" testdir=$(dirname "$script") if [ "$#" -gt 0 ]; then timeconst="$1" shift else timeconst="$testdir/scripts/timeconst.bc" fi if [ "$#" -gt 0 ]; then bc="$1" shift else bc="$testdir/../../bin/bc" fi out1="$testdir/../.log_bc_timeconst.txt" out2="$testdir/../.log_bc_timeconst_test.txt" base=$(basename "$timeconst") if [ ! -f "$timeconst" ]; then printf 'Warning: %s does not exist\n' "$timeconst" printf 'Skipping...\n' exit 0 fi unset BC_ENV_ARGS unset BC_LINE_LENGTH unset DC_ENV_ARGS unset DC_LINE_LENGTH printf 'Running %s...' "$base" nums=$(printf 'for (i = 0; i <= 1000; ++i) { i }\n' | bc) for i in $nums; do printf '%s\n' "$i" | bc -q "$timeconst" > "$out1" err="$?" if [ "$err" -ne 0 ]; then printf '\nOther bc is not GNU compatible. Skipping...\n' exit 0 fi printf '%s\n' "$i" | "$bc" "$@" -q "$timeconst" > "$out2" diff "$out1" "$out2" error="$?" if [ "$error" -ne 0 ]; then printf '\nFailed on input: %s\n' "$i" exit "$error" fi done rm -f "$out1" rm -f "$out2" exec printf 'pass\n'
Upload File
Create Folder