diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f81ac8cbf1..1da01b7120 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,11 @@ +20000403-18:25 GMT+1 Victor Szakats + + * utils/hbtest/* + + Some __XPP__ branches removed. + + Documented and added tests for the :className() <-> :className + difference. + ! Worked around ALINK /OUT: handling bug (by not using this switch). + 20000403-16:35 GMT+1 Victor Szakats * utils/hbtest/* @@ -7,11 +15,11 @@ Comparison: - Platform Filename Size Passes Failures Total - --------------- ------------- --------- ------ -------- ----- - CA-Clipper 5.2e hbtest5x.exe 504.832 2976 25 3001 - Harbour (BCC55) hbtest.exe 566.272 3186 82 3268 - XBase++ 1.10 hbtestxp.exe 1.375.232 1977 771 2748 + Platform Filename Size Passes Failures Total Time + --------------- ------------- --------- ------ -------- ----- ---- + CA-Clipper 5.2e hbtest5x.exe 504.832 2976 25 3001 ~1 s + Harbour (BCC55) hbtest.exe 566.272 3186 82 3268 ~4 s + XBase++ 1.10 hbtestxp.exe 1.375.232 1977 771 2748 ~2 s * source/rtl/philesx.c ! CURDRIVE() error handling made more like XBase++. Retry is allowed, diff --git a/harbour/utils/hbtest/hbtest.prg b/harbour/utils/hbtest/hbtest.prg index 85ebfd9778..4d936dfd36 100644 --- a/harbour/utils/hbtest/hbtest.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -39,9 +39,14 @@ /* NOTE: The test suite will not work if the DTOS() function is not included in Harbour (-DHB_COMPAT_XPP). */ + /* NOTE: Always compile with /n switch */ /* NOTE: It's worth to make tests with and without the /z switch */ /* NOTE: Guard all Harbour extensions with __HARBOUR__ #ifdefs */ +/* NOTE: Use ":className()" instead of ":className" to make your code work + with XBase++. XBase++ seem to take differenciate between the + object method and object variable form. In CA-Clipper and Harbour + both syntax is accepted. Same goes for ":Eval()" */ /* TODO: Add checks for string parameters with embedded NUL character */ /* TODO: Add test cases for other string functions */ @@ -412,11 +417,7 @@ FUNCTION XToStr( xValue ) CASE cType == "N" ; RETURN LTrim( Str( xValue ) ) CASE cType == "D" ; RETURN 'SToD("' + DToS( xValue ) + '")' CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) -#ifdef __XPP__ - CASE cType == "O" ; RETURN xValue:className() + "Object" -#else - CASE cType == "O" ; RETURN xValue:className + " Object" -#endif + CASE cType == "O" ; RETURN xValue:className() + " Object" CASE cType == "U" ; RETURN "NIL" CASE cType == "B" ; RETURN '{||...}' CASE cType == "A" ; RETURN '{.[' + LTrim( Str( Len( xValue ) ) ) + '].}' @@ -437,13 +438,9 @@ STATIC FUNCTION ErrorMessage( oError ) CASE oError:severity == ES_CATASTROPHIC ; cMessage += "C " ENDCASE ENDIF -#ifdef __XPP__ - cMessage += "BASE" + " " -#else IF ValType( oError:subsystem ) == "C" - cMessage += oError:subsystem() + " " + cMessage += oError:subsystem + " " ENDIF -#endif IF ValType( oError:subCode ) == "N" cMessage += LTrim( Str( oError:subCode ) ) + " " ENDIF diff --git a/harbour/utils/hbtest/make_xpp.bat b/harbour/utils/hbtest/make_xpp.bat index 67e6cc4e68..3f9c622719 100644 --- a/harbour/utils/hbtest/make_xpp.bat +++ b/harbour/utils/hbtest/make_xpp.bat @@ -13,6 +13,6 @@ xpp rt_misc.prg /w /n xpp rt_str.prg /w /n xpp rt_trans.prg /w /n -alink /out:hbtestxp hbtest rt_array rt_date rt_file rt_hvm rt_math rt_misc rt_str rt_trans +alink hbtest rt_array rt_date rt_file rt_hvm rt_math rt_misc rt_str rt_trans del *.obj diff --git a/harbour/utils/hbtest/make_xpp.cmd b/harbour/utils/hbtest/make_xpp.cmd index 67e6cc4e68..3f9c622719 100644 --- a/harbour/utils/hbtest/make_xpp.cmd +++ b/harbour/utils/hbtest/make_xpp.cmd @@ -13,6 +13,6 @@ xpp rt_misc.prg /w /n xpp rt_str.prg /w /n xpp rt_trans.prg /w /n -alink /out:hbtestxp hbtest rt_array rt_date rt_file rt_hvm rt_math rt_misc rt_str rt_trans +alink hbtest rt_array rt_date rt_file rt_hvm rt_math rt_misc rt_str rt_trans del *.obj diff --git a/harbour/utils/hbtest/rt_hvm.prg b/harbour/utils/hbtest/rt_hvm.prg index fcce298857..b55474decf 100644 --- a/harbour/utils/hbtest/rt_hvm.prg +++ b/harbour/utils/hbtest/rt_hvm.prg @@ -176,64 +176,68 @@ FUNCTION Main_HVM() /* Harbour compiler not yet handles these */ #ifndef __HARBOUR__ #ifndef __XPP__ - TEST_LINE( NIL:className , "NIL" ) + TEST_LINE( NIL:className() , "NIL" ) #endif #endif ) #ifndef __XPP__ - TEST_LINE( "":className , "CHARACTER" ) - TEST_LINE( 0:className , "NUMERIC" ) - TEST_LINE( SToD( "" ):className , "DATE" ) - TEST_LINE( .F.:className , "LOGICAL" ) - TEST_LINE( {|| NIL }:className , "BLOCK" ) - TEST_LINE( {}:className , "ARRAY" ) - TEST_LINE( ErrorNew():className , "ERROR" ) + TEST_LINE( "":className() , "CHARACTER" ) + TEST_LINE( 0:className() , "NUMERIC" ) + TEST_LINE( SToD( "" ):className() , "DATE" ) + TEST_LINE( .F.:className() , "LOGICAL" ) + TEST_LINE( {|| NIL }:className() , "BLOCK" ) + TEST_LINE( {}:className() , "ARRAY" ) #endif + TEST_LINE( ErrorNew():className() , "ERROR" ) + TEST_LINE( ErrorNew():className , "ERROR" ) /* Harbour compiler not yet handles these */ #ifndef __HARBOUR__ #ifndef __XPP__ - TEST_LINE( NIL:classH , 0 ) + TEST_LINE( NIL:classH() , 0 ) #endif #endif #ifndef __XPP__ - TEST_LINE( "":classH , 0 ) - TEST_LINE( 0:classH , 0 ) - TEST_LINE( SToD( "" ):classH , 0 ) - TEST_LINE( .F.:classH , 0 ) - TEST_LINE( {|| NIL }:classH , 0 ) - TEST_LINE( {}:classH , 0 ) - TEST_LINE( ErrorNew():classH > 0 , .T. ) + TEST_LINE( "":classH() , 0 ) + TEST_LINE( 0:classH() , 0 ) + TEST_LINE( SToD( "" ):classH() , 0 ) + TEST_LINE( .F.:classH() , 0 ) + TEST_LINE( {|| NIL }:classH() , 0 ) + TEST_LINE( {}:classH() , 0 ) #endif + TEST_LINE( ErrorNew():classH() > 0 , .T. ) + TEST_LINE( ErrorNew():classH > 0 , .T. ) /* Harbour compiler not yet handles these */ #ifndef __HARBOUR__ #ifndef __XPP__ - TEST_LINE( suNIL:className , "NIL" ) + TEST_LINE( suNIL:className() , "NIL" ) #endif #endif #ifndef __XPP__ - TEST_LINE( scString:className , "CHARACTER" ) - TEST_LINE( snIntP:className , "NUMERIC" ) - TEST_LINE( sdDateE:className , "DATE" ) - TEST_LINE( slFalse:className , "LOGICAL" ) - TEST_LINE( sbBlock:className , "BLOCK" ) - TEST_LINE( saArray:className , "ARRAY" ) - TEST_LINE( soObject:className , "ERROR" ) + TEST_LINE( scString:className() , "CHARACTER" ) + TEST_LINE( snIntP:className() , "NUMERIC" ) + TEST_LINE( sdDateE:className() , "DATE" ) + TEST_LINE( slFalse:className() , "LOGICAL" ) + TEST_LINE( sbBlock:className() , "BLOCK" ) + TEST_LINE( saArray:className() , "ARRAY" ) #endif + TEST_LINE( soObject:className() , "ERROR" ) + TEST_LINE( soObject:className , "ERROR" ) /* Harbour compiler not yet handles these */ #ifndef __HARBOUR__ #ifndef __XPP__ - TEST_LINE( suNIL:classH , 0 ) + TEST_LINE( suNIL:classH() , 0 ) #endif #endif #ifndef __XPP__ - TEST_LINE( scString:classH , 0 ) - TEST_LINE( snIntP:classH , 0 ) - TEST_LINE( sdDateE:classH , 0 ) - TEST_LINE( slFalse:classH , 0 ) - TEST_LINE( sbBlock:classH , 0 ) - TEST_LINE( saArray:classH , 0 ) - TEST_LINE( soObject:classH > 0 , .T. ) + TEST_LINE( scString:classH() , 0 ) + TEST_LINE( snIntP:classH() , 0 ) + TEST_LINE( sdDateE:classH() , 0 ) + TEST_LINE( slFalse:classH() , 0 ) + TEST_LINE( sbBlock:classH() , 0 ) + TEST_LINE( saArray:classH() , 0 ) #endif + TEST_LINE( soObject:classH() > 0 , .T. ) + TEST_LINE( soObject:classH > 0 , .T. ) /* (operators) */ diff --git a/harbour/utils/hbtest/rt_misc.prg b/harbour/utils/hbtest/rt_misc.prg index 8b3ed7ca89..1a93083b16 100644 --- a/harbour/utils/hbtest/rt_misc.prg +++ b/harbour/utils/hbtest/rt_misc.prg @@ -216,7 +216,7 @@ FUNCTION Main_MISC() TEST_LINE( TFORNEXTXF( 1, 10, -4 ) , "F-9999T1S1R1" ) TEST_LINE( TFORNEXTXF( 10, 1, 4 ) , "F-9999T10S10R10" ) - /* EVAL(), :EVAL */ + /* EVAL(), :EVAL(), :EVAL */ TEST_LINE( Eval( NIL ) , "E BASE 1004 No exported method EVAL F:S" ) TEST_LINE( Eval( 1 ) , "E BASE 1004 No exported method EVAL F:S" ) @@ -227,6 +227,16 @@ FUNCTION Main_MISC() TEST_LINE( Eval( {|p1,p2| p1+p2 },"A","B") , "AB" ) TEST_LINE( Eval( {|p1,p2,p3| p1 },"A","B") , "A" ) /* Harbour compiler not yet handles these */ +#ifndef __HARBOUR__ + TEST_LINE( suNIL:Eval() , "E BASE 1004 No exported method EVAL F:S" ) +#endif + TEST_LINE( scString:Eval() , "E BASE 1004 No exported method EVAL F:S" ) + TEST_LINE( snIntP:Eval() , "E BASE 1004 No exported method EVAL F:S" ) + TEST_LINE( sdDateE:Eval() , "E BASE 1004 No exported method EVAL F:S" ) + TEST_LINE( slFalse:Eval() , "E BASE 1004 No exported method EVAL F:S" ) + TEST_LINE( sbBlock:Eval() , NIL ) + TEST_LINE( saArray:Eval() , "E BASE 1004 No exported method EVAL F:S" ) + TEST_LINE( soObject:Eval() , "E BASE 1004 No exported method EVAL F:S" ) #ifndef __HARBOUR__ TEST_LINE( suNIL:Eval , "E BASE 1004 No exported method EVAL F:S" ) #endif diff --git a/harbour/utils/hbtest/rt_str.prg b/harbour/utils/hbtest/rt_str.prg index 48453fa495..9f6e9766d8 100644 --- a/harbour/utils/hbtest/rt_str.prg +++ b/harbour/utils/hbtest/rt_str.prg @@ -408,8 +408,8 @@ FUNCTION Main_STR() TEST_LINE( At(90, 100) , "E BASE 1108 Argument error AT F:S" ) TEST_LINE( At("", 100) , "E BASE 1108 Argument error AT F:S" ) TEST_LINE( At(100, "") , "E BASE 1108 Argument error AT F:S" ) - TEST_LINE( At("", "") , 1 ) /* Bug in CA-Cl*ppers compiler optimalizer, it should return 0 */ - TEST_LINE( At("", "ABCDEF") , 1 ) /* Bug in CA-Cl*ppers compiler optimalizer, it should return 0 */ + TEST_LINE( At("", "") , 1 ) /* Bug in CA-Cl*ppers compiler optimizer, it should return 0 */ + TEST_LINE( At("", "ABCDEF") , 1 ) /* Bug in CA-Cl*ppers compiler optimizer, it should return 0 */ TEST_LINE( At(scStringE, "ABCDEF") , 0 ) TEST_LINE( At("ABCDEF", "") , 0 ) TEST_LINE( At("AB", "AB") , 1 )