home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / xinetd / sio.1.5.6 / suite / sprint_test < prev    next >
Encoding:
Text File  |  1992-12-09  |  1.1 KB  |  64 lines

  1. #!/bin/sh
  2.  
  3. # (c) Copyright 1992 by Panagiotis Tsirigotis
  4. # All rights reserved.  The file named COPYRIGHT specifies the terms 
  5. # and conditions for redistribution.
  6.  
  7.  
  8. #
  9. # $Id: sprint_test,v 7.1 1992/06/01 21:38:57 panos Exp $
  10. #
  11.  
  12. compare()
  13. {
  14.     cmp -s PRINTF.DATA SPRINT.DATA
  15.     if [ $? -ne 0 ]
  16.     then
  17.         echo TEST $1 FAILED
  18.         echo Check files PRINTF.DATA and SPRINT.DATA for differences
  19.         exit 1
  20.     else
  21.         echo TEST $1 PASSED
  22.         rm -f PRINTF.DATA SPRINT.DATA
  23.     fi
  24. }
  25.  
  26. format_test()
  27. {
  28.     Sprint $@ 1>PRINTF.DATA 2>SPRINT.DATA
  29.     compare "$*"
  30. }
  31.  
  32. format_test ALL
  33.  
  34. format_test -W10 -F0 -c
  35. format_test -W10 -F- -c
  36.  
  37. echo
  38. echo PRECISION TEST
  39. i=13
  40. while test $i -ne 0
  41. do
  42.     format_test -P$i -F# -X
  43.     i=`expr $i - 1`
  44. done
  45. echo END OF PRECISION TEST
  46. echo
  47.  
  48. format_test -Vi -4 4 1 -o "-F#"
  49.  
  50. format_test -Vf -1.0 1.0 0.3 -W30 -P13 -F+ -f
  51. format_test -Vf -1.0 1.0 0.3 -W30 -P13 -F+ -e
  52. format_test -Vf -1.0 2.0 0.3 -W30 -P13 -F+ -g
  53.  
  54. format_test -Vf -1.0 1.0 0.3 -W30 -P13 -F+- -f
  55. format_test -Vf -1.0 1.0 0.3 -W30 -P13 -F+- -e
  56. format_test -Vf -1.0 2.0 0.3 -W30 -P13 -F+- -g
  57.  
  58. format_test -W10 "-F " -x
  59.  
  60. format_test -W40 -u -Vi 8 100 3 -F0
  61.  
  62. format_test -b
  63. format_test -b -P10
  64.