* contrib/hbformat/hbfmtcls.prg
! fixed casing of some function names.
* utils/hbmk2/hbmk2.prg
; all changes below apply to .xhp (xMate) to .hbp conversion:
! properly convert input filenames with spaces in them
! remove lib prefix from .a input filenames
% do not add empty -L options
* do not add include paths with %HB_INSTALL%\ in them
+ split non-portable, Borland-specific include path lists
concatenated with ';' into distinct -I options
% do not add empty include paths
* tests/testop.prg
* tests/testntx.prg
* tests/vmasort.prg
* tests/testlbl.prg
* tests/testidle.prg
* tests/videotst.prg
* tests/testmem.prg
* tests/testinit.prg
* tests/testhtml.prg
* tests/tstcolor.prg
* tests/vidtest.prg
* tests/tstuse.prg
* tests/vec1.prg
* tests/while.prg
* tests/tstdspac.prg
* tests/version.prg
* tests/testpre.prg
* tests/tstprag.prg
* formatted. mostly with hbformat.
86 lines
1.6 KiB
Plaintext
86 lines
1.6 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
PROCEDURE Main( nPass )
|
|
|
|
LOCAL aTest
|
|
LOCAL aOrig
|
|
|
|
IF nPass == NIL
|
|
nPass := 1
|
|
ELSE
|
|
nPass := Val( nPass )
|
|
ENDIF
|
|
|
|
? "Testing aSort with " + Str( nPass ) + " loops."
|
|
?
|
|
aTest := aMkArray( nPass )
|
|
aOrig := AClone( aTest )
|
|
|
|
SET DATE ANSI
|
|
|
|
? "Original.....:", aDump( aOrig )
|
|
? "Asort.c......:", aDump( ASort( aTest ) )
|
|
// ? "Asort.c.block:", aDump( aSort( aTest, , , {| x, y | x < y } ) )
|
|
|
|
RETURN
|
|
|
|
STATIC FUNCTION aMkArray( nPass )
|
|
|
|
LOCAL aData := {}
|
|
LOCAL n
|
|
LOCAL nMult := 200
|
|
LOCAL nMid := ( nMult / 2 ) + 1
|
|
LOCAL nMax := nPass * nMult
|
|
|
|
FOR n := 1 TO nMax
|
|
AAdd( aData, NIL )
|
|
AAdd( aData, nMid - n )
|
|
AAdd( aData, Date() - n )
|
|
AAdd( aData, iif( n % 2 == 0, .F., .T. ) )
|
|
AAdd( aData, Replicate( Chr( 64 + ( n % 256 ) ), nPass ) )
|
|
AAdd( aData, {|| n } )
|
|
AAdd( aData, Array( n ) )
|
|
AAdd( aData, ErrorNew() )
|
|
NEXT
|
|
|
|
RETURN aData
|
|
|
|
FUNCTION aDump( a )
|
|
|
|
LOCAL cStr := ""
|
|
LOCAL n := Len( a )
|
|
LOCAL i
|
|
|
|
FOR i := 1 TO n
|
|
cStr += AllTrim( xToStr( a[ i ] ) ) + " "
|
|
NEXT
|
|
|
|
RETURN cStr
|
|
|
|
FUNCTION xToStr( xValue )
|
|
|
|
LOCAL cType := ValType( xValue )
|
|
|
|
DO CASE
|
|
CASE cType == "C" .OR. cType == "M"
|
|
RETURN xValue
|
|
CASE cType == "N"
|
|
RETURN AllTrim( Str( xValue ) )
|
|
CASE cType == "D"
|
|
RETURN DToC( xValue )
|
|
CASE cType == "L"
|
|
RETURN iif( xValue, ".T.", ".F." )
|
|
CASE cType == "U"
|
|
RETURN "NIL"
|
|
CASE cType == "A"
|
|
RETURN "{.}"
|
|
CASE cType == "B"
|
|
RETURN "{|| }"
|
|
CASE cType == "O"
|
|
RETURN "[O]"
|
|
ENDCASE
|
|
|
|
RETURN xValue
|