diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8330e6a13f..9b353ab337 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,11 @@ +19991122-23:43 GMT+1 Victor Szel + * tests/regress/rt_hvm.prg + tests/regress/rt_misc.prg + + Enabled some tests which will make the VM die. (NIL:Classname) + ! Disabled some tests for Clipper which return trash. + * source/pp/hbpp.c + * Minor formatting (static declaration moved first). + 19991122-17:10 EDT David G. Holm * rt_misc.prg @@ -27,7 +35,6 @@ * fixed incorrect error generation if empty lines were placed between DO CASE statement and the first CASE statement - 19991122-16:12 GMT+1 Victor Szel * source/common/hbstr.c include/extend.h diff --git a/harbour/source/pp/hbpp.c b/harbour/source/pp/hbpp.c index 7b7561e173..b22dad228c 100644 --- a/harbour/source/pp/hbpp.c +++ b/harbour/source/pp/hbpp.c @@ -441,8 +441,10 @@ static COMMANDS * TraSearch( char * cmdname, COMMANDS * sttraStart ) static void ParseCommand( char * sLine, BOOL com_or_xcom, BOOL com_or_tra ) { - static char mpatt[PATTERN_SIZE], rpatt[PATTERN_SIZE]; - char cmdname[MAX_NAME]; + static char mpatt[ PATTERN_SIZE ]; + static char rpatt[ PATTERN_SIZE ]; + + char cmdname[ MAX_NAME ]; COMMANDS * stcmd; int mlen,rlen; int ipos; @@ -1101,8 +1103,9 @@ static int RemoveSlash( char * stroka ) static int WorkMarkers( char ** ptrmp, char ** ptri, char * ptro, int * lenres, BOOL com_or_xcom ) { - static char expreal[MAX_EXP]; - char exppatt[MAX_NAME]; + static char expreal[ MAX_EXP ]; + + char exppatt[ MAX_NAME ]; int lenreal = 0, maxlenreal = HB_PP_STR_SIZE, lenpatt; int rezrestr, ipos; char * ptr, * ptrtemp; @@ -1530,12 +1533,13 @@ static void SkipOptional( char ** ptri ) static void SearnRep( char * exppatt, char * expreal, int lenreal, char * ptro, int * lenres ) { + static char expnew[ MAX_EXP ]; + int ifou, isdvig = 0; BOOL rezs; int kolmarkers; int lennew, i; char lastchar = '0'; - static char expnew[MAX_EXP]; char *ptr, *ptr2, *ptrOut = ptro; HB_TRACE(HB_TR_DEBUG, ("SearnRep(%s, %s, %d, %s, %p)", exppatt, expreal, lenreal, ptro, lenres)); diff --git a/harbour/tests/regress/rt_hvm.prg b/harbour/tests/regress/rt_hvm.prg index 7d0fd0fe91..8eb21563af 100644 --- a/harbour/tests/regress/rt_hvm.prg +++ b/harbour/tests/regress/rt_hvm.prg @@ -235,10 +235,7 @@ FUNCTION Main_HVM() /* Special internal messages */ -/* Harbour compiler not yet handles these */ -#ifndef __HARBOUR__ TEST_LINE( NIL:className , "NIL" ) -#endif ) TEST_LINE( "":className , "CHARACTER" ) TEST_LINE( 0:className , "NUMERIC" ) TEST_LINE( SToD( "" ):className , "DATE" ) @@ -246,10 +243,7 @@ FUNCTION Main_HVM() TEST_LINE( {|| nil }:className , "BLOCK" ) TEST_LINE( {}:className , "ARRAY" ) TEST_LINE( ErrorNew():className , "ERROR" ) -/* Harbour compiler not yet handles these */ -#ifndef __HARBOUR__ TEST_LINE( NIL:classH , 0 ) -#endif TEST_LINE( "":classH , 0 ) TEST_LINE( 0:classH , 0 ) TEST_LINE( SToD( "" ):classH , 0 ) @@ -258,10 +252,7 @@ FUNCTION Main_HVM() TEST_LINE( {}:classH , 0 ) TEST_LINE( ErrorNew():classH > 0 , .T. ) -/* Harbour compiler not yet handles these */ -#ifndef __HARBOUR__ TEST_LINE( suNIL:className , "NIL" ) -#endif TEST_LINE( scString:className , "CHARACTER" ) TEST_LINE( snIntP:className , "NUMERIC" ) TEST_LINE( sdDateE:className , "DATE" ) @@ -269,10 +260,7 @@ FUNCTION Main_HVM() TEST_LINE( sbBlock:className , "BLOCK" ) TEST_LINE( saArray:className , "ARRAY" ) TEST_LINE( soObject:className , "ERROR" ) -/* Harbour compiler not yet handles these */ -#ifndef __HARBOUR__ TEST_LINE( suNIL:classH , 0 ) -#endif TEST_LINE( scString:classH , 0 ) TEST_LINE( snIntP:classH , 0 ) TEST_LINE( sdDateE:classH , 0 ) diff --git a/harbour/tests/regress/rt_misc.prg b/harbour/tests/regress/rt_misc.prg index d8ab41e53c..1b464b547b 100644 --- a/harbour/tests/regress/rt_misc.prg +++ b/harbour/tests/regress/rt_misc.prg @@ -222,11 +222,11 @@ FUNCTION Main_MISC() TEST_LINE( NationMsg(12) , "Y/N" ) TEST_LINE( NationMsg(13) , "INVALID EXPRESSION" ) TEST_LINE( NationMsg(14) , "" ) -#ifndef __CLIPPER__ /* Causes GPF in CA-Cl*pper (5.3b) */ +#ifndef __CLIPPER__ /* Causes GPF in CA-Cl*pper (5.2e, 5.3b) */ TEST_LINE( NationMsg(200) , "" ) /* Bug in CA-Cl*pper, it will return "74?" or other trash */ #endif -/* These will cause a GPF in CA-Cl*pper (5.3b) */ +/* These will cause a GPF in CA-Cl*pper (5.2e, 5.3b) */ #ifndef __CLIPPER__ TEST_LINE( IsAffirm() , .F. ) TEST_LINE( IsAffirm(.F.) , .F. ) @@ -245,7 +245,7 @@ FUNCTION Main_MISC() TEST_LINE( IsAffirm("no") , .F. ) TEST_LINE( IsAffirm("NO") , .F. ) -/* These will cause a GPF in CA-Cl*pper (5.3b) */ +/* These will cause a GPF in CA-Cl*pper (5.2e, 5.3b) */ #ifndef __CLIPPER__ TEST_LINE( IsNegative() , .F. ) TEST_LINE( IsNegative(.F.) , .F. ) @@ -370,7 +370,9 @@ FUNCTION Main_MISC() /* DESCEND() */ +#ifndef __CLIPPER__ TEST_LINE( Descend() , NIL ) /* Bug in CA-Cl*pper, it returns undefined trash */ +#endif TEST_LINE( Descend( NIL ) , NIL ) TEST_LINE( Descend( { "A", "B" } ) , NIL ) #ifdef __HARBOUR__ @@ -469,8 +471,8 @@ FUNCTION Main_MISC() #ifndef __CLIPPER__ TEST_LINE( BIN2I() , 0 ) /* Bug in CA-Cl*pper, this causes a GPF */ TEST_LINE( BIN2I(100) , 0 ) /* Bug in CA-Cl*pper, this causes a GPF */ + TEST_LINE( BIN2I("") , 0 ) /* Bug in CA-Cl*pper, it will return trash */ #endif - TEST_LINE( BIN2I("") , 0 ) TEST_LINE( BIN2I("AB") , 16961 ) TEST_LINE( BIN2I("BA") , 16706 ) TEST_LINE( BIN2I(Chr(255)) , 255 ) @@ -485,8 +487,8 @@ FUNCTION Main_MISC() #ifndef __CLIPPER__ TEST_LINE( BIN2W() , 0 ) /* Bug in CA-Cl*pper, this causes a GPF */ TEST_LINE( BIN2W(100) , 0 ) /* Bug in CA-Cl*pper, this causes a GPF */ + TEST_LINE( BIN2W("") , 0 ) /* Bug in CA-Cl*pper, it will return trash */ #endif - TEST_LINE( BIN2W("") , 0 ) TEST_LINE( BIN2W("AB") , 16961 ) TEST_LINE( BIN2W("BA") , 16706 ) TEST_LINE( BIN2W(Chr(255)) , 255 ) @@ -501,11 +503,13 @@ FUNCTION Main_MISC() #ifndef __CLIPPER__ TEST_LINE( BIN2L() , 0 ) /* Bug in CA-Cl*pper, this causes a GPF */ TEST_LINE( BIN2L(100) , 0 ) /* Bug in CA-Cl*pper, this causes a GPF */ + TEST_LINE( BIN2L("") , 0 ) /* Bug in CA-Cl*pper, it will return trash */ #endif - TEST_LINE( BIN2L("") , 0 ) TEST_LINE( BIN2L("ABCD") , 1145258561 ) TEST_LINE( BIN2L("DCBA") , 1094861636 ) - TEST_LINE( BIN2L(Chr(255)) , 255 ) +#ifndef __CLIPPER__ + TEST_LINE( BIN2L(Chr(255)) , 255 ) /* Bug in CA-Cl*pper, it will return trash */ +#endif TEST_LINE( BIN2L(Chr(255)+Chr(255)+Chr(255)) , 16777215 ) TEST_LINE( BIN2L(Chr(255)+Chr(255)+Chr(255)+Chr(255)) , -1 ) TEST_LINE( BIN2L(Chr(0)+Chr(0)+Chr(0)) , 0 )