#! /usr/bin/ksh
#####################################################################
# function: passfail
#
# description of the function:
# ----------------------------
#    1. Print out a standard pass/fail message.
#    2. If $2 == $3
#           Increment SUCCESS 
#       else
#           Increment FAILURE 
# 
# Input to the function:
# ----------------------
#    $1: pd command
#    $2: actual return value 
#    $3: expected return value 
#
# Assumptions:
# ------------
#    SUCCESS and FAILURE have been defined as global variables.
#      e.g.) typeset -i SUCCESS
#      e.g.) typeset -i FAILURE
#
#    To increment SUCCESS and FAILURE globally, this function must
#    be invoked as part of the current process. 
#      e.g.) . passfail
#
#####################################################################

PDCOMMAND=$1          #pd command
ACTUAL_RV=$2          #actual return code
EXPECTED_RV=$3        #expected return code


if [[ "$ACTUAL_RV" -eq "$EXPECTED_RV" ]]
then
   SUCCESS=$SUCCESS+1
   echo "result: $PDCOMMAND passed." 
else
   FAILURE=$FAILURE+1
   echo "result: $PDCOMMAND FAILED!!" 
fi


#----------------------------------------------------------------------
#    Version      Date     Time    Owner   Comment
# ------------- -------- -------- -------- ----------------------------
# V1.0          03/28/94          rachel   original script


# V             04/21/94 10:45:47 rachel   initial script
