Files
harbour-core/harbour/tests/teststr.prg
Viktor Szakats 986df3694e 2012-09-30 23:08 UTC+0200 Viktor Szakats (harbour syenar.net)
+ contrib/hbct/tests/dates4.prg
  - tests/dates4.prg
  * contrib/hbnf/byt2bit.prg
  * contrib/hbnf/dectobin.prg
  * contrib/hbnf/popadder.prg
  * tests/ac_test2.prg
  * tests/ainstest.prg
  * tests/and_or.prg
  * tests/array16.prg
  * tests/arrays.prg
  * tests/begin.prg
  * tests/byref.prg
  * tests/calling.prg
  * tests/clasinh.prg
  * tests/clasinit.prg
  * tests/classes.prg
  * tests/clsnv.prg
  * tests/codebloc.prg
  * tests/dates.prg
  * tests/debugtst.prg
  * tests/destruct.prg
  * tests/dirtest.prg
  * tests/dynobj.prg
  * tests/exittest.prg
  * tests/fib.prg
  * tests/files.prg
  * tests/fornext.prg
  * tests/fsplit.prg
  * tests/gtchars.prg
  * tests/ifelse.prg
  * tests/inherit.prg
  * tests/inifiles.prg
  * tests/initexit.prg
  * tests/inkeytst.prg
  * tests/inline.prg
  * tests/iotest.prg
  * tests/iotest2.prg
  * tests/longdev.prg
  * tests/longstr2.prg
  * tests/memvar.prg
  * tests/multiarg.prg
  * tests/newrdd.prg
  * tests/nums.prg
  * tests/objasign.prg
  * tests/objects.prg
  * tests/overload.prg
  * tests/passref.prg
  * tests/procname.prg
  * tests/readhrb.prg
  * tests/returns.prg
  * tests/rto_get.prg
  * tests/rto_tb.prg
  * tests/sbartest.prg
  * tests/setkeys.prg
  * tests/speed.prg
  * tests/statfun.prg
  * tests/statics.prg
  * tests/stripem.prg
  * tests/switch.prg
  * tests/tb1.prg
  * tests/test_all.prg
  * tests/testbrw.prg
  * tests/testcls.prg
  * tests/testerro.prg
  * tests/testfor.prg
  * tests/testmem.prg
  * tests/testntx.prg
  * tests/testop.prg
  * tests/testpp.prg
  * tests/testrdd2.prg
  * tests/teststr.prg
  * tests/testvars.prg
  * tests/testwarn.prg
  * tests/tstasort.prg
  * tests/tstdbi.prg
  * tests/tstmacro.prg
  * tests/varparam.prg
  * tests/vidtest.prg
    * various cleanups, fixes and formatting
      now most tests are warning and error free
2012-09-30 21:12:01 +00:00

119 lines
2.1 KiB
Plaintext

/*
* $Id$
*/
PROCEDURE Main()
OutStd( hb_eol() )
OutStd( "Running with SET FIXED OFF (the default setting): " )
OutStd( hb_eol() )
test()
__ACCEPT( "Pause before running again with SET FIXED ON: " )
OutStd( hb_eol() )
OutStd( "Running with SET FIXED ON: " )
OutStd( hb_eol() )
Set( _SET_FIXED, "ON" )
test()
RETURN
PROCEDURE test()
LOCAL a := 15.1
LOCAL b := 10.0002575
LOCAL nI, c, d
OutStd( "1: " )
OutStd( 10 )
OutStd( a )
OutStd( - a )
OutStd( b )
OutStd( - b )
OutStd( hb_eol() )
OutStd( "2: " )
OutStd( a + b )
OutStd( a - b )
OutStd( a * b )
OutStd( a / b )
OutStd( hb_eol() )
OutStd( "3: " )
OutStd( a % b )
OutStd( a ** b )
OutStd( hb_eol() )
c := a * b
d := b * a
OutStd( hb_eol() )
OutStd( "4: " )
OutStd( Str( c ) )
OutStd( Str( d ) )
OutStd( hb_eol() )
OutStd( "5: " )
OutStd( Str( c + d ) )
OutStd( Str( c - d ) )
OutStd( Str( c * d ) )
OutStd( Str( c / d ) )
OutStd( hb_eol() )
OutStd( hb_eol() )
OutStd( "6: " )
OutStd( a + b + c )
OutStd( c - b - a )
OutStd( b * a * c )
OutStd( b * a * c * d )
b := 1.000213
OutStd( b * b * b * b * b * b * b )
OutStd( hb_eol() )
FOR nI := 1 TO 20
OutStd( hb_eol() )
OutStd( LTrim( Str( 6 + nI ) ) + ": " )
OutStd( 10 ** nI + ( 1.02 * 1.02 ) )
NEXT
OutStd( hb_eol() )
OutStd( hb_eol() )
OutStd( "27: " )
OutStd( Str( a ), a )
OutStd( hb_eol() )
OutStd( "28: " )
OutStd( Str( b ), b )
OutStd( hb_eol() )
OutStd( "29: " )
OutStd( Str( b, 15 ) )
OutStd( hb_eol() )
OutStd( "30: " )
OutStd( Str( b, 20, 5 ) )
OutStd( hb_eol() )
OutStd( "31: " )
OutStd( Str( b, 20, 10 ) )
OutStd( hb_eol() )
OutStd( "32: " )
OutStd( Str( b, 5, 10 ) )
OutStd( hb_eol() )
OutStd( "33: " )
OutStd( Str( b, 20, - 10 ) )
OutStd( hb_eol() )
OutStd( "34: " )
OutStd( Str( b, - 12, 7 ) )
OutStd( hb_eol() )
OutStd( "35: " )
OutStd( Str( b, 0 ) )
OutStd( hb_eol() )
OutStd( hb_eol() )
a := 15.1004
OutStd( "36: " )
OutStd( Str( a ), a )
OutStd( hb_eol() )
RETURN