From 14591d82b6423ed76540ced70f1d4752d31882f3 Mon Sep 17 00:00:00 2001 From: n-isaka Date: Tue, 8 Oct 2024 08:00:54 +0000 Subject: [PATCH] Update test script --- tests/sql_data | 4 +- tests/sqlca | 602 +++++++++++++++++++++++-------------------------- 2 files changed, 289 insertions(+), 317 deletions(-) diff --git a/tests/sql_data b/tests/sql_data index ed0c436..2c9774a 100755 --- a/tests/sql_data +++ b/tests/sql_data @@ -1,5 +1,5 @@ #! /bin/sh -# Generated from sql_data.at by GNU Autoconf 2.69. +# Generated from ../tests/sql_data.at by GNU Autoconf 2.69. # # Copyright (C) 2009-2012 Free Software Foundation, Inc. # @@ -2435,7 +2435,7 @@ cat >prog.cbl <<'_ATEOF' ****************************************************************** - * END + * END PERFORM CLEANUP-DB. STOP RUN. diff --git a/tests/sqlca b/tests/sqlca index d478e95..8d64d40 100755 --- a/tests/sqlca +++ b/tests/sqlca @@ -1,7 +1,7 @@ #! /bin/sh -# Generated from sqlca.at by GNU Autoconf 2.71. +# Generated from ../tests/sqlca.at by GNU Autoconf 2.69. # -# Copyright (C) 2009-2017, 2020-2021 Free Software Foundation, Inc. +# Copyright (C) 2009-2012 Free Software Foundation, Inc. # # This test suite is free software; the Free Software Foundation gives # unlimited permission to copy, distribute and modify it. @@ -11,16 +11,14 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop +else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -30,46 +28,46 @@ esac fi - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi # The user is always right. -if ${PATH_SEPARATOR+false} :; then +if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -78,6 +76,13 @@ if ${PATH_SEPARATOR+false} :; then fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -86,12 +91,8 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS @@ -103,22 +104,40 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop +else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -138,53 +157,42 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ) -then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : -else \$as_nop +else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 -blah=\$(echo \$(echo blah)) -test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null -then : + if (eval "$as_required") 2>/dev/null; then : as_have_required=yes -else $as_nop +else as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null -then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -else $as_nop +else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir$as_base + as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes - if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null -then : + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi @@ -192,21 +200,14 @@ fi esac as_found=false done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes -fi -fi +fi; } +IFS=$as_save_IFS - if test "x$CONFIG_SHELL" != x -then : + if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -224,19 +225,18 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno -then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." - if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -263,7 +263,6 @@ as_fn_unset () } as_unset=as_fn_unset - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -281,14 +280,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -303,7 +294,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -312,7 +303,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -351,13 +342,12 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' -else $as_nop +else as_fn_append () { eval $1=\$$1\$2 @@ -369,13 +359,12 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else $as_nop +else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -393,9 +382,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -416,7 +405,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -466,7 +455,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -480,10 +469,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -497,13 +482,6 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -605,6 +583,8 @@ at_change_dir=false # Whether to enable colored test results. at_color=no +# List of the tested programs. +at_tested='ocesql' # As many question marks as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. @@ -616,7 +596,7 @@ at_help_all="1;connect-disconnect.at:1;connect-disconnect;; 4;prepare-execute.at:67;prepare-precompile-return-errorcode;; " # List of the all the test groups. -at_groups_all=`printf "%s\n" "$at_help_all" | sed 's/;.*//'` +at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'` # at_fn_validate_ranges NAME... # ----------------------------- @@ -628,7 +608,7 @@ at_fn_validate_ranges () do eval at_value=\$$at_grp if test $at_value -lt 1 || test $at_value -gt 4; then - printf "%s\n" "invalid test group: $at_value" >&2 + $as_echo "invalid test group: $at_value" >&2 exit 1 fi case $at_value in @@ -641,9 +621,6 @@ at_fn_validate_ranges () esac done } -# List of the tested programs. -at_tested='"ocesql"' - at_prev= for at_option @@ -659,6 +636,8 @@ do *) at_optarg= ;; esac + # Accept the important Cygnus configure options, so we can diagnose typos. + case $at_option in --help | -h ) at_help_p=: @@ -717,7 +696,7 @@ do [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_start - at_range=`printf "%s\n" "$at_groups_all" | \ + at_range=`$as_echo "$at_groups_all" | \ sed -ne '/^'$at_range_start'$/,$p'` as_fn_append at_groups "$at_range$as_nl" ;; @@ -725,7 +704,7 @@ do -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_end - at_range=`printf "%s\n" "$at_groups_all" | \ + at_range=`$as_echo "$at_groups_all" | \ sed -ne '1,/^'$at_range_end'$/p'` as_fn_append at_groups "$at_range$as_nl" ;; @@ -744,7 +723,7 @@ do at_range_start=$at_tmp fi at_fn_validate_ranges at_range_start at_range_end - at_range=`printf "%s\n" "$at_groups_all" | \ + at_range=`$as_echo "$at_groups_all" | \ sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'` as_fn_append at_groups "$at_range$as_nl" ;; @@ -798,11 +777,11 @@ do ;; esac # It is on purpose that we match the test group titles too. - at_groups_selected=`printf "%s\n" "$at_groups_selected" | + at_groups_selected=`$as_echo "$at_groups_selected" | grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` done # Smash the keywords. - at_groups_selected=`printf "%s\n" "$at_groups_selected" | sed 's/;.*//'` + at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//'` as_fn_append at_groups "$at_groups_selected$as_nl" ;; --recheck) @@ -816,22 +795,21 @@ do '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$at_envvar'" ;; esac - at_value=`printf "%s\n" "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` + at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` # Export now, but save eval for later and for debug scripts. export $at_envvar as_fn_append at_debug_args " $at_envvar='$at_value'" ;; - *) printf "%s\n" "$as_me: invalid option: $at_option" >&2 - printf "%s\n" "Try \`$0 --help' for more information." >&2 + *) $as_echo "$as_me: invalid option: $at_option" >&2 + $as_echo "Try \`$0 --help' for more information." >&2 exit 1 ;; esac done # Verify our last option didn't require an argument -if test -n "$at_prev" -then : +if test -n "$at_prev"; then : as_fn_error $? "\`$at_prev' requires an argument" fi @@ -855,7 +833,7 @@ else as_fn_append at_groups "$at_oldfails$as_nl" fi # Sort the tests, removing duplicates. - at_groups=`printf "%s\n" "$at_groups" | sort -nu | sed '/^$/d'` + at_groups=`$as_echo "$at_groups" | sort -nu | sed '/^$/d'` fi if test x"$at_color" = xalways \ @@ -934,7 +912,7 @@ Open-COBOL-ESQL-1.2 test suite: SQLCA test test groups: _ATEOF # Pass an empty line as separator between selected groups and help. - printf "%s\n" "$at_groups$as_nl$as_nl$at_help_all" | + $as_echo "$at_groups$as_nl$as_nl$at_help_all" | awk 'NF == 1 && FS != ";" { selected[$ 1] = 1 next @@ -968,10 +946,10 @@ _ATEOF exit $at_write_fail fi if $at_version_p; then - printf "%s\n" "$as_me (Open-COBOL-ESQL-1.2)" && + $as_echo "$as_me (Open-COBOL-ESQL-1.2)" && cat <<\_ATEOF || at_write_fail=1 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This test suite is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ATEOF @@ -1078,17 +1056,13 @@ fi # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. -AUTOTEST_PATH=`printf "%s\n" "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"` +AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR case $as_dir in [\\/]* | ?:[\\/]* ) @@ -1118,11 +1092,7 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac + test -z "$as_dir" && as_dir=. test -d "$as_dir" || continue case $as_dir in [\\/]* | ?:[\\/]* ) ;; @@ -1152,23 +1122,23 @@ fi exec 5>>"$at_suite_log" # Banners and logs. -printf "%s\n" "## ------------------------------------------- ## +$as_echo "## ------------------------------------------- ## ## Open-COBOL-ESQL-1.2 test suite: SQLCA test. ## ## ------------------------------------------- ##" { - printf "%s\n" "## ------------------------------------------- ## + $as_echo "## ------------------------------------------- ## ## Open-COBOL-ESQL-1.2 test suite: SQLCA test. ## ## ------------------------------------------- ##" echo - printf "%s\n" "$as_me: command line was:" - printf "%s\n" " \$ $0 $at_cli_args" + $as_echo "$as_me: command line was:" + $as_echo " \$ $0 $at_cli_args" echo # If ChangeLog exists, list a few lines in case it might help determining # the exact version. if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then - printf "%s\n" "## ---------- ## + $as_echo "## ---------- ## ## ChangeLog. ## ## ---------- ##" echo @@ -1205,12 +1175,8 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - printf "%s\n" "PATH: $as_dir" + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1221,7 +1187,7 @@ IFS=$as_save_IFS for at_file in atconfig atlocal do test -r $at_file || continue - printf "%s\n" "$as_me: $at_file:" + $as_echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done @@ -1245,7 +1211,7 @@ at_fn_banner () if test -z "$at_banner_text"; then $at_first || echo else - printf "%s\n" "$as_nl$at_banner_text$as_nl" + $as_echo "$as_nl$at_banner_text$as_nl" fi } # at_fn_banner @@ -1256,7 +1222,7 @@ at_fn_banner () at_fn_check_prepare_notrace () { $at_trace_echo "Not enabling shell tracing (command contains $1)" - printf "%s\n" "$2" >"$at_check_line_file" + $as_echo "$2" >"$at_check_line_file" at_check_trace=: at_check_filter=: : >"$at_stdout"; : >"$at_stderr" } @@ -1267,7 +1233,7 @@ at_fn_check_prepare_notrace () # command. at_fn_check_prepare_trace () { - printf "%s\n" "$1" >"$at_check_line_file" + $as_echo "$1" >"$at_check_line_file" at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace : >"$at_stdout"; : >"$at_stderr" } @@ -1304,7 +1270,7 @@ at_fn_filter_trace () at_fn_log_failure () { for file - do printf "%s\n" "$file:"; sed 's/^/> /' "$file"; done + do $as_echo "$file:"; sed 's/^/> /' "$file"; done echo 1 > "$at_status_file" exit 1 } @@ -1318,7 +1284,7 @@ at_fn_check_skip () { case $1 in 99) echo 99 > "$at_status_file"; at_failed=: - printf "%s\n" "$2: hard failure"; exit 99;; + $as_echo "$2: hard failure"; exit 99;; 77) echo 77 > "$at_status_file"; exit 77;; esac } @@ -1335,8 +1301,8 @@ at_fn_check_status () $1 ) ;; 77) echo 77 > "$at_status_file"; exit 77;; 99) echo 99 > "$at_status_file"; at_failed=: - printf "%s\n" "$3: hard failure"; exit 99;; - *) printf "%s\n" "$3: exit code was $2, expected $1" + $as_echo "$3: hard failure"; exit 99;; + *) $as_echo "$3: exit code was $2, expected $1" at_failed=:;; esac } @@ -1368,9 +1334,9 @@ at_fn_create_debugging_script () { { echo "#! /bin/sh" && - echo 'test ${ZSH_VERSION+y} && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' && - printf "%s\n" "cd '$at_dir'" && - printf "%s\n" "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" && + echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' && + $as_echo "cd '$at_dir'" && + $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" && echo 'exit 1' } >"$at_group_dir/run" && chmod +x "$at_group_dir/run" @@ -1380,40 +1346,33 @@ at_fn_create_debugging_script () ## End of autotest shell functions. ## ## -------------------------------- ## { - printf "%s\n" "## ---------------- ## + $as_echo "## ---------------- ## ## Tested programs. ## ## ---------------- ##" echo } >&5 # Report what programs are being tested. -for at_program in : `eval echo $at_tested` +for at_program in : $at_tested do - case $at_program in #( - :) : - continue ;; #( - [\\/]* | ?:[\\/]*) : - at_program_=$at_program ;; #( - *) : + test "$at_program" = : && continue + case $at_program in + [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;; + * ) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -f "$as_dir$at_program" && break + test -z "$as_dir" && as_dir=. + test -f "$as_dir/$at_program" && break done IFS=$as_save_IFS - at_program_=$as_dir$at_program ;; -esac - + at_program_=$as_dir/$at_program ;; + esac if test -f "$at_program_"; then { - printf "%s\n" "$at_srcdir/sqlca.at:1: $at_program_ --version" + $as_echo "$at_srcdir/sqlca.at:1: $at_program_ --version" "$at_program_" --version &5 2>&1 @@ -1423,14 +1382,14 @@ esac done { - printf "%s\n" "## ------------------ ## + $as_echo "## ------------------ ## ## Running the tests. ## ## ------------------ ##" } >&5 at_start_date=`date` at_start_time=`date +%s 2>/dev/null` -printf "%s\n" "$as_me: starting at: $at_start_date" >&5 +$as_echo "$as_me: starting at: $at_start_date" >&5 # Create the master directory if it doesn't already exist. as_dir="$at_suite_dir"; as_fn_mkdir_p || @@ -1541,13 +1500,12 @@ at_fn_group_prepare () # under the shell's notion of the current directory. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log - if test -d "$at_group_dir" -then + if test -d "$at_group_dir"; then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \; rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* fi || - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 -printf "%s\n" "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 +$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} # Be tolerant if the above `rm' was not able to remove the directory. as_dir="$at_group_dir"; as_fn_mkdir_p @@ -1577,7 +1535,7 @@ at_fn_group_banner () *) at_desc_line="$1: " ;; esac as_fn_append at_desc_line "$3$4" - $at_quiet printf %s "$at_desc_line" + $at_quiet $as_echo_n "$at_desc_line" echo "# -*- compilation -*-" >> "$at_group_log" } @@ -1596,11 +1554,11 @@ at_fn_group_postprocess () run. This means that test suite is improperly designed. Please report this failure to . _ATEOF - printf "%s\n" "$at_setup_line" >"$at_check_line_file" + $as_echo "$at_setup_line" >"$at_check_line_file" at_status=99 fi - $at_verbose printf %s "$at_group. $at_setup_line: " - printf %s "$at_group. $at_setup_line: " >> "$at_group_log" + $at_verbose $as_echo_n "$at_group. $at_setup_line: " + $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log" case $at_xfail:$at_status in yes:0) at_msg="UNEXPECTED PASS" @@ -1636,10 +1594,10 @@ _ATEOF echo "$at_res" > "$at_job_dir/$at_res" # In parallel mode, output the summary line only afterwards. if test $at_jobs -ne 1 && test -n "$at_verbose"; then - printf "%s\n" "$at_desc_line $at_color$at_msg$at_std" + $as_echo "$at_desc_line $at_color$at_msg$at_std" else # Make sure there is a separator even with long titles. - printf "%s\n" " $at_color$at_msg$at_std" + $as_echo " $at_color$at_msg$at_std" fi at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in @@ -1652,8 +1610,8 @@ _ATEOF at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')' rm -f "$at_times_file" fi - printf "%s\n" "$at_log_msg" >> "$at_group_log" - printf "%s\n" "$at_log_msg" >&5 + $as_echo "$at_log_msg" >> "$at_group_log" + $as_echo "$at_log_msg" >&5 # Cleanup the group directory, unless the user wants the files # or the success was unexpected. @@ -1674,7 +1632,7 @@ _ATEOF # Upon failure, include the log into the testsuite's global # log. The failure message is written in the group log. It # is later included in the global log. - printf "%s\n" "$at_log_msg" >> "$at_group_log" + $as_echo "$at_log_msg" >> "$at_group_log" # Upon failure, keep the group directory for autopsy, and create # the debugging script. With -e, do not start any further tests. @@ -1717,8 +1675,8 @@ for at_signal in 1 2 15; do at_signame=`kill -l $at_signal 2>&1 || echo $at_signal` set x $at_signame test 1 -gt 2 && at_signame=$at_signal - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5 -printf "%s\n" "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5 +$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;} as_fn_arith 128 + $at_signal && exit_status=$as_val as_fn_exit $exit_status' $at_signal done @@ -1739,7 +1697,7 @@ then done if test -n "$at_pids"; then at_sig=TSTP - test ${TMOUT+y} && at_sig=STOP + test "${TMOUT+set}" = set && at_sig=STOP kill -$at_sig $at_pids 2>/dev/null fi kill -STOP $$ @@ -1747,7 +1705,7 @@ then echo # Turn jobs into a list of numbers, starting from 1. - at_joblist=`printf "%s\n" "$at_groups" | sed -n 1,${at_jobs}p` + at_joblist=`$as_echo "$at_groups" | sed -n 1,${at_jobs}p` set X $at_joblist shift @@ -1771,8 +1729,8 @@ then at_fn_test $at_group && . "$at_test_source" then :; else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 -printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 +$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess @@ -1810,8 +1768,8 @@ else if cd "$at_group_dir" && at_fn_test $at_group && . "$at_test_source"; then :; else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 -printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 +$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess @@ -1850,7 +1808,7 @@ rm -rf "$at_helper_dir" # Compute the duration of the suite. at_stop_date=`date` at_stop_time=`date +%s 2>/dev/null` -printf "%s\n" "$as_me: ending at: $at_stop_date" >&5 +$as_echo "$as_me: ending at: $at_stop_date" >&5 case $at_start_time,$at_stop_time in [0-9]*,[0-9]*) as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val @@ -1859,18 +1817,18 @@ case $at_start_time,$at_stop_time in as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" - printf "%s\n" "$as_me: test suite duration: $at_duration" >&5 + $as_echo "$as_me: test suite duration: $at_duration" >&5 ;; esac echo -printf "%s\n" "## ------------- ## +$as_echo "## ------------- ## ## Test results. ## ## ------------- ##" echo { echo - printf "%s\n" "## ------------- ## + $as_echo "## ------------- ## ## Test results. ## ## ------------- ##" echo @@ -1950,7 +1908,7 @@ else echo "ERROR: $at_result" >&5 { echo - printf "%s\n" "## ------------------------ ## + $as_echo "## ------------------------ ## ## Summary of the failures. ## ## ------------------------ ##" @@ -1971,7 +1929,7 @@ else echo fi if test $at_fail_count != 0; then - printf "%s\n" "## ---------------------- ## + $as_echo "## ---------------------- ## ## Detailed failed tests. ## ## ---------------------- ##" echo @@ -2010,14 +1968,10 @@ _ASBOX else at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'" fi - at_msg1a=${at_xpass_list:+', '} - at_msg1=$at_fail_list${at_fail_list:+" failed$at_msg1a"} - at_msg2=$at_xpass_list${at_xpass_list:+" passed unexpectedly"} - - printf "%s\n" "Please send $at_msg and all information you think might help: + $as_echo "Please send $at_msg and all information you think might help: To: - Subject: [Open-COBOL-ESQL-1.2] $as_me: $at_msg1$at_msg2 + Subject: [Open-COBOL-ESQL-1.2] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may @@ -2036,7 +1990,7 @@ at_fn_group_banner 1 'connect-disconnect.at:1' \ "connect-disconnect" " " at_xfail=no ( - printf "%s\n" "1. $at_setup_line: testing $at_desc ..." + $as_echo "1. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2068,7 +2022,12 @@ cat >prog.cbl <<'_ATEOF' EXEC SQL DISCONNECT ALL END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = -220 THEN + DISPLAY "DISCONNECT ALL SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "08003" THEN + DISPLAY "DISCONNECT ALL SQLSTATE:" SQLSTATE + END-IF. MOVE "<|DB_NAME|>@<|DB_HOST|>:<|DB_PORT|>" TO DBNAME. @@ -2080,12 +2039,22 @@ cat >prog.cbl <<'_ATEOF' EXEC SQL CONNECT :USERNAME IDENTIFIED BY :PASSWD USING :DBNAME END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = 0 THEN + DISPLAY "CONNECT SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "00000" THEN + DISPLAY "CONNECT SQLSTATE:" SQLSTATE + END-IF. EXEC SQL DISCONNECT ALL END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = 0 THEN + DISPLAY "DISCONNECT ALL SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "00000" THEN + DISPLAY "DISCONNECT ALL SQLSTATE:" SQLSTATE + END-IF. MOVE "invalid" TO DBNAME. @@ -2097,84 +2066,77 @@ cat >prog.cbl <<'_ATEOF' EXEC SQL CONNECT :USERNAME IDENTIFIED BY :PASSWD USING :DBNAME END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = -402 THEN + DISPLAY "CONNECT invalid SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "08001" THEN + DISPLAY "CONNECT invalid SQLSTATE:" SQLSTATE + END-IF. EXEC SQL DISCONNECT ALL END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = -220 THEN + DISPLAY "DISCONNECT ALL SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "08003" THEN + DISPLAY "DISCONNECT ALL SQLSTATE:" SQLSTATE + END-IF. * END STOP RUN. - ****************************************************************** - SHOW-STATUS. - ****************************************************************** - DISPLAY SQLCODE. - DISPLAY SQLSTATE. - _ATEOF { set +x -printf "%s\n" "$at_srcdir/connect-disconnect.at:76: ocesql prog.cbl prog.cob > /dev/null" -at_fn_check_prepare_trace "connect-disconnect.at:76" +$as_echo "$at_srcdir/connect-disconnect.at:95: ocesql prog.cbl prog.cob > /dev/null" +at_fn_check_prepare_trace "connect-disconnect.at:95" ( $at_check_trace; ocesql prog.cbl prog.cob > /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/connect-disconnect.at:76" +at_fn_check_status 0 $at_status "$at_srcdir/connect-disconnect.at:95" $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/connect-disconnect.at:77: \${EMBED_DB_INFO} prog.cob" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "connect-disconnect.at:77" +$as_echo "$at_srcdir/connect-disconnect.at:96: \${EMBED_DB_INFO} prog.cob" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "connect-disconnect.at:96" ( $at_check_trace; ${EMBED_DB_INFO} prog.cob ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/connect-disconnect.at:77" +at_fn_check_status 0 $at_status "$at_srcdir/connect-disconnect.at:96" $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/connect-disconnect.at:78: \${COMPILE_MODULE} prog.cob" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "connect-disconnect.at:78" +$as_echo "$at_srcdir/connect-disconnect.at:97: \${COMPILE_MODULE} prog.cob" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "connect-disconnect.at:97" ( $at_check_trace; ${COMPILE_MODULE} prog.cob ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/connect-disconnect.at:78" +at_fn_check_status 0 $at_status "$at_srcdir/connect-disconnect.at:97" $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/connect-disconnect.at:79: \${RUN_MODULE} prog 2> /dev/null" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "connect-disconnect.at:79" +$as_echo "$at_srcdir/connect-disconnect.at:98: \${RUN_MODULE} prog 2> /dev/null" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "connect-disconnect.at:98" ( $at_check_trace; ${RUN_MODULE} prog 2> /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; printf "%s\n" "-000000220 -08003 -+000000000 -00000 -+000000000 -00000 --000000402 -08001 --000000220 -08003 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 1 $at_status "$at_srcdir/connect-disconnect.at:79" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 1 $at_status "$at_srcdir/connect-disconnect.at:98" $at_failed && at_fn_log_failure $at_traceon; } @@ -2189,7 +2151,7 @@ at_fn_group_banner 2 'open-fetch-close.at:1' \ "open-fetch-close" " " at_xfail=no ( - printf "%s\n" "2. $at_setup_line: testing $at_desc ..." + $as_echo "2. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2247,32 +2209,62 @@ cat >prog.cbl <<'_ATEOF' EXEC SQL OPEN C END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = 0 THEN + DISPLAY "OPEN SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "00000" THEN + DISPLAY "OPEN SQLSTATE:" SQLSTATE + END-IF. EXEC SQL OPEN CC END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = -602 THEN + DISPLAY "OPEN CC SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "34000" THEN + DISPLAY "OPEN CC SQLSTATE:" SQLSTATE + END-IF. EXEC SQL FETCH C INTO :DATA-V END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = 0 THEN + DISPLAY "FETCH SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "00000" THEN + DISPLAY "FETCH SQLSTATE:" SQLSTATE + END-IF. EXEC SQL FETCH CC INTO :DATA-V END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = -602 THEN + DISPLAY "FETCH CC SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "34000" THEN + DISPLAY "FETCH CC SQLSTATE:" SQLSTATE + END-IF. EXEC SQL CLOSE C END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = 0 THEN + DISPLAY "CLOSE SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "00000" THEN + DISPLAY "CLOSE SQLSTATE:" SQLSTATE + END-IF. EXEC SQL CLOSE CC END-EXEC. - PERFORM SHOW-STATUS. + IF SQLCODE NOT = -602 THEN + DISPLAY "CLOSE CC SQLCODE:" SQLCODE + END-IF. + IF SQLSTATE NOT = "34000" THEN + DISPLAY "CLOSE CC SQLSTATE:" SQLSTATE + END-IF. PERFORM CLEANUP-DB. @@ -2322,78 +2314,58 @@ cat >prog.cbl <<'_ATEOF' EXEC SQL DISCONNECT ALL END-EXEC. - - ****************************************************************** - SHOW-STATUS. - ****************************************************************** - DISPLAY SQLCODE. - DISPLAY SQLSTATE. - _ATEOF { set +x -printf "%s\n" "$at_srcdir/open-fetch-close.at:140: ocesql prog.cbl prog.cob > /dev/null" -at_fn_check_prepare_trace "open-fetch-close.at:140" +$as_echo "$at_srcdir/open-fetch-close.at:163: ocesql prog.cbl prog.cob > /dev/null" +at_fn_check_prepare_trace "open-fetch-close.at:163" ( $at_check_trace; ocesql prog.cbl prog.cob > /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/open-fetch-close.at:140" +at_fn_check_status 0 $at_status "$at_srcdir/open-fetch-close.at:163" $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/open-fetch-close.at:141: \${EMBED_DB_INFO} prog.cob" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "open-fetch-close.at:141" +$as_echo "$at_srcdir/open-fetch-close.at:164: \${EMBED_DB_INFO} prog.cob" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "open-fetch-close.at:164" ( $at_check_trace; ${EMBED_DB_INFO} prog.cob ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/open-fetch-close.at:141" +at_fn_check_status 0 $at_status "$at_srcdir/open-fetch-close.at:164" $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/open-fetch-close.at:142: \${COMPILE_MODULE} prog.cob" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "open-fetch-close.at:142" +$as_echo "$at_srcdir/open-fetch-close.at:165: \${COMPILE_MODULE} prog.cob" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "open-fetch-close.at:165" ( $at_check_trace; ${COMPILE_MODULE} prog.cob ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/open-fetch-close.at:142" +at_fn_check_status 0 $at_status "$at_srcdir/open-fetch-close.at:165" $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/open-fetch-close.at:143: \${RUN_MODULE} prog 2> /dev/null" -at_fn_check_prepare_notrace 'a ${...} parameter expansion' "open-fetch-close.at:143" +$as_echo "$at_srcdir/open-fetch-close.at:166: \${RUN_MODULE} prog 2> /dev/null" +at_fn_check_prepare_notrace 'a ${...} parameter expansion' "open-fetch-close.at:166" ( $at_check_trace; ${RUN_MODULE} prog 2> /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; printf "%s\n" "+000000000 -00000 --000000602 -34000 -+000000000 -00000 --000000602 -34000 -+000000000 -00000 --000000602 -34000 -" | \ - $at_diff - "$at_stdout" || at_failed=: -at_fn_check_status 0 $at_status "$at_srcdir/open-fetch-close.at:143" +at_fn_diff_devnull "$at_stdout" || at_failed=: +at_fn_check_status 0 $at_status "$at_srcdir/open-fetch-close.at:166" $at_failed && at_fn_log_failure $at_traceon; } @@ -2408,7 +2380,7 @@ at_fn_group_banner 3 'prepare-execute.at:1' \ "prepare-execute" " " at_xfail=no ( - printf "%s\n" "3. $at_setup_line: testing $at_desc ..." + $as_echo "3. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2472,7 +2444,7 @@ _ATEOF { set +x -printf "%s\n" "$at_srcdir/prepare-execute.at:60: ocesql prog.cbl prog.cob > /dev/null" +$as_echo "$at_srcdir/prepare-execute.at:60: ocesql prog.cbl prog.cob > /dev/null" at_fn_check_prepare_trace "prepare-execute.at:60" ( $at_check_trace; ocesql prog.cbl prog.cob > /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -2485,7 +2457,7 @@ $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/prepare-execute.at:61: \${EMBED_DB_INFO} prog.cob" +$as_echo "$at_srcdir/prepare-execute.at:61: \${EMBED_DB_INFO} prog.cob" at_fn_check_prepare_notrace 'a ${...} parameter expansion' "prepare-execute.at:61" ( $at_check_trace; ${EMBED_DB_INFO} prog.cob ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -2498,7 +2470,7 @@ $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/prepare-execute.at:62: \${COMPILE_MODULE} prog.cob" +$as_echo "$at_srcdir/prepare-execute.at:62: \${COMPILE_MODULE} prog.cob" at_fn_check_prepare_notrace 'a ${...} parameter expansion' "prepare-execute.at:62" ( $at_check_trace; ${COMPILE_MODULE} prog.cob ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -2511,7 +2483,7 @@ $at_failed && at_fn_log_failure $at_traceon; } { set +x -printf "%s\n" "$at_srcdir/prepare-execute.at:63: \${RUN_MODULE} prog 2> /dev/null" +$as_echo "$at_srcdir/prepare-execute.at:63: \${RUN_MODULE} prog 2> /dev/null" at_fn_check_prepare_notrace 'a ${...} parameter expansion' "prepare-execute.at:63" ( $at_check_trace; ${RUN_MODULE} prog 2> /dev/null ) >>"$at_stdout" 2>>"$at_stderr" 5>&- @@ -2534,7 +2506,7 @@ at_fn_group_banner 4 'prepare-execute.at:67' \ "prepare-precompile-return-errorcode" " " at_xfail=no ( - printf "%s\n" "4. $at_setup_line: testing $at_desc ..." + $as_echo "4. $at_setup_line: testing $at_desc ..." $at_traceon @@ -2597,14 +2569,14 @@ cat >prog.cbl <<'_ATEOF' _ATEOF { set +x -printf "%s\n" "$at_srcdir/prepare-execute.at:125: ocesql prog.cbl prog.cob" +$as_echo "$at_srcdir/prepare-execute.at:125: ocesql prog.cbl prog.cob" at_fn_check_prepare_trace "prepare-execute.at:125" ( $at_check_trace; ocesql prog.cbl prog.cob ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: -echo >>"$at_stdout"; printf "%s\n" "precompile start: prog.cbl +echo >>"$at_stdout"; $as_echo "precompile start: prog.cbl ======================================================= LIST OF CALLED DB Library API =======================================================