From 03a15d50b58a727e33dc8cd746416ffeafdfeb11 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 16 Jul 2010 11:34:05 +0000 Subject: [PATCH] 2010-07-16 13:27 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbtest/hbtest.prg * utils/hbtest/rt_hvm.prg * utils/hbtest/rt_hvma.prg * utils/hbtest/rt_stra.prg * utils/hbtest/rt_vars.ch + Enabled GTCGI for Harbour builds. This makes it independent for GTs, to there is better chance to run it. Now it also works on VxWorks. + Will now detect .dbf creation failure and continue gracefully with a message and skipping all related tests. * src/rtl/hbsocket.c * external/minizip/ioapi.h * include/hbthread.h + Added/cleaned hacks to avoid collision between VxWorks's own system types. * external/minizip/ioapi.h ! Disabled 64-bit FSIO for whole VxWorks. * config/vxworks/gcc.mk * config/vxworks/diab.mk * config/vxworks/global.mk + _VX_CPU is now defined in vxworks/global.mk. * src/common/hbarch.c ! Fixed hb_put_le_uint64() definition to match declaration. * include/hbdefs.h ! Fixed compatibility type definitions in HB_LONG_LONG_OFF mode. * include/hbsetup.h + Added bzero() declaration hack for vxworks. * include/hbinit.h + Added support for diag compiler init function. It requires the constructor to have public visibility. * src/common/hbver.c + Changed to always display x.x.x.x format verison no for diab. (in generic way). * INSTALL * Updated list of CPUs supported by vxworks. --- harbour/ChangeLog | 54 +++++++++++++++++++++-- harbour/INSTALL | 12 ++--- harbour/config/vxworks/diab.mk | 8 +--- harbour/config/vxworks/gcc.mk | 1 + harbour/config/vxworks/global.mk | 32 +++++++++----- harbour/external/minizip/ioapi.h | 12 ++++- harbour/include/hbdefs.h | 24 +++++----- harbour/include/hbinit.h | 24 +++++++--- harbour/include/hbsetup.h | 2 + harbour/include/hbthread.h | 11 ++--- harbour/src/common/hbarch.c | 2 +- harbour/src/common/hbver.c | 4 +- harbour/src/rtl/hbsocket.c | 4 ++ harbour/utils/hbtest/hbtest.prg | 76 ++++++++++++++++++++------------ harbour/utils/hbtest/rt_hvm.prg | 4 ++ harbour/utils/hbtest/rt_hvma.prg | 4 ++ harbour/utils/hbtest/rt_stra.prg | 2 + harbour/utils/hbtest/rt_vars.ch | 2 + 18 files changed, 193 insertions(+), 85 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c7048a3ebf..5b50fc43a1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,52 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-16 13:27 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbtest/hbtest.prg + * utils/hbtest/rt_hvm.prg + * utils/hbtest/rt_hvma.prg + * utils/hbtest/rt_stra.prg + * utils/hbtest/rt_vars.ch + + Enabled GTCGI for Harbour builds. This makes it independent + for GTs, to there is better chance to run it. Now it also + works on VxWorks. + + Will now detect .dbf creation failure and continue gracefully + with a message and skipping all related tests. + + * src/rtl/hbsocket.c + * external/minizip/ioapi.h + * include/hbthread.h + + Added/cleaned hacks to avoid collision between VxWorks's own + system types. + + * external/minizip/ioapi.h + ! Disabled 64-bit FSIO for whole VxWorks. + + * config/vxworks/gcc.mk + * config/vxworks/diab.mk + * config/vxworks/global.mk + + _VX_CPU is now defined in vxworks/global.mk. + + * src/common/hbarch.c + ! Fixed hb_put_le_uint64() definition to match declaration. + + * include/hbdefs.h + ! Fixed compatibility type definitions in HB_LONG_LONG_OFF mode. + + * include/hbsetup.h + + Added bzero() declaration hack for vxworks. + + * include/hbinit.h + + Added support for diag compiler init function. + It requires the constructor to have public visibility. + + * src/common/hbver.c + + Changed to always display x.x.x.x format verison no for diab. + (in generic way). + + * INSTALL + * Updated list of CPUs supported by vxworks. + 2010-07-16 03:07 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/hbide.hbp ! Missing from previous. @@ -50,17 +96,17 @@ Input dialog is presented depending upon the search variable type. Sequential search is a slow process but there is no alternative to that. - Sequential search is initiated from the current record downwards and terminated + Sequential search is initiated from the current record downwards and terminated either on oBrw:hitBottom is encountered or value is found. Icon: ideDBU toolbar-serach Hotkey: CTRL+F + Implemented: goto record. It is straight forward. DbGoto( nRecord ) is issued. - - Icon: ideDBU toolbar-goto record Hotkey: CTRL+G + + Icon: ideDBU toolbar-goto record Hotkey: CTRL+G Please forward your opinions. - + 2010-07-16 08:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/tests/testqaim.prg ! Two fixes reported by Tamas and Bacco respectively. diff --git a/harbour/INSTALL b/harbour/INSTALL index da93f328bf..a85a12dd9a 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -1278,8 +1278,8 @@ HARBOUR x win -> dos/watcom x86 x win -> os2/watcom x86 x win -> linux/watcom x86 - x win -> vxworks/gcc (CPU cross-builds possible: x86, arm, coldfire, mips, ppc) - x win -> vxworks/diab (CPU cross-builds possible) + x win -> vxworks/gcc (CPU cross-builds possible: x86, arm, mips, ppc) + x win -> vxworks/diab (CPU cross-builds possible: x86, arm, mips, ppc, sparc) dos -> dos/djgpp x86 dos -> dos/watcom x86 x dos -> win/watcom x86 @@ -1304,8 +1304,8 @@ HARBOUR x linux -> os2/watcom x86 x linux -> dos/watcom x86 x linux -> dos/djgpp x86 - x linux -> vxworks/gcc (CPU cross-builds possible: x86, arm, coldfire, mips, ppc) - x linux -> vxworks/diab (CPU cross-builds possible) + x linux -> vxworks/gcc (CPU cross-builds possible: x86, arm, mips, ppc) + x linux -> vxworks/diab (CPU cross-builds possible: x86, arm, mips, ppc, sparc) bsd -> bsd/gcc (CPU cross-builds possible) bsd -> bsd/clang (CPU cross-builds possible) x bsd -> wce/mingwarm arm @@ -1333,8 +1333,8 @@ HARBOUR x sunos -> wce/mingw x86 x sunos -> win/mingw x86 x sunos -> dos/djgpp x86 - x sunos -> vxworks/gcc (CPU cross-builds possible: x86, arm, coldfire, mips, ppc) - x sunos -> vxworks/diab (CPU cross-builds possible) + x sunos -> vxworks/gcc (CPU cross-builds possible: x86, arm, mips, ppc) + x sunos -> vxworks/diab (CPU cross-builds possible: x86, arm, mips, ppc, sparc) Leading 'x' marks cross-platform scenarios. diff --git a/harbour/config/vxworks/diab.mk b/harbour/config/vxworks/diab.mk index c80965aad3..56592ab053 100644 --- a/harbour/config/vxworks/diab.mk +++ b/harbour/config/vxworks/diab.mk @@ -18,27 +18,21 @@ HB_DYN_COPT := -DHB_DYNLIB -Xpic ifeq ($(HB_CPU),x86) _DIAB_CPU := X86LH - _DIAB_VXCPU := _VX_SIMPENTIUM else ifeq ($(HB_CPU),arm) _DIAB_CPU := - _DIAB_VXCPU := else ifeq ($(HB_CPU),mips) _DIAB_CPU := - _DIAB_VXCPU := else ifeq ($(HB_CPU),ppc) _DIAB_CPU := - _DIAB_VXCPU := else ifeq ($(HB_CPU),sh) _DIAB_CPU := - _DIAB_VXCPU := else ifeq ($(HB_CPU),m68k) _DIAB_CPU := - _DIAB_VXCPU := endif endif endif @@ -57,7 +51,7 @@ DFLAGS += -t$(_DIAB_CPU):rtpsim -WDVSB_DIR=$(WIND_BASE)/target/lib CFLAGS += -I. -I$(HB_INC_COMPILE) CFLAGS += -I$(WIND_BASE)/target/usr/h CFLAGS += -I$(WIND_BASE)/target/usr/h/wrn/coreip -CFLAGS += -D_VX_CPU=$(_DIAB_VXCPU) +CFLAGS += -D_VX_CPU=$(_HB_VXCPU) #CFLAGS += -D_VX_TOOL_FAMILY=diab -D_VX_TOOL=diab ifneq ($(HB_BUILD_WARN),no) diff --git a/harbour/config/vxworks/gcc.mk b/harbour/config/vxworks/gcc.mk index 15266b3ce6..c70a730fdd 100644 --- a/harbour/config/vxworks/gcc.mk +++ b/harbour/config/vxworks/gcc.mk @@ -29,6 +29,7 @@ CFLAGS += -I$(WIND_BASE)/target/usr/h CFLAGS += -I$(WIND_BASE)/target/usr/h/wrn/coreip CFLAGS += -fno-strict-aliasing CFLAGS += -D_C99 -D_HAS_C9X +#CFLAGS += -D_VX_CPU=$(_HB_VXCPU) #CFLAGS += -D_VX_TOOL_FAMILY=gnu -D_VX_TOOL=gnu ifneq ($(HB_BUILD_WARN),no) diff --git a/harbour/config/vxworks/global.mk b/harbour/config/vxworks/global.mk index 2cc88ed2f9..01720bfed9 100644 --- a/harbour/config/vxworks/global.mk +++ b/harbour/config/vxworks/global.mk @@ -8,22 +8,32 @@ BIN_EXT := .vxe DYN_EXT := .so DYN_PREF := lib -ifeq ($(HB_CCPOSTFIX),) - ifeq ($(HB_CPU),x86) +ifeq ($(HB_CPU),x86) + ifeq ($(HB_CCPOSTFIX),) export HB_CCPOSTFIX := pentium - else - ifeq ($(HB_CPU),arm) + endif + _HB_VXCPU := _VX_SIMPENTIUM +else +ifeq ($(HB_CPU),arm) + ifeq ($(HB_CCPOSTFIX),) export HB_CCPOSTFIX := arm - else - ifeq ($(HB_CPU),mips) + endif + _HB_VXCPU := _VX_ARMARCH7 +else +ifeq ($(HB_CPU),mips) + ifeq ($(HB_CCPOSTFIX),) export HB_CCPOSTFIX := mips - else - ifeq ($(HB_CPU),ppc) + endif + _HB_VXCPU := +else +ifeq ($(HB_CPU),ppc) + ifeq ($(HB_CCPOSTFIX),) export HB_CCPOSTFIX := ppc endif - endif - endif - endif + _HB_VXCPU := +endif +endif +endif endif ifneq ($(filter $(HB_BUILD_STRIP),all lib),) diff --git a/harbour/external/minizip/ioapi.h b/harbour/external/minizip/ioapi.h index 812ef3f00d..a42a553fc1 100644 --- a/harbour/external/minizip/ioapi.h +++ b/harbour/external/minizip/ioapi.h @@ -44,10 +44,20 @@ #include "hbsetup.h" +#if defined( HB_OS_VXWORKS ) && defined( _STD_USING_INT_TYPES ) + /* NOTE: Hack to avoid collision between stdint.h and types/vxTypes.h. [vszakats] */ + #ifndef __BIT_TYPES_DEFINED__ + #define __BIT_TYPES_DEFINED__ + #endif + #ifndef _SYS_INT_TYPES_H + #define _SYS_INT_TYPES_H + #endif +#endif + #if defined( __BORLANDC__ ) || \ defined( __WATCOMC__ ) || \ defined( __MINGW32CE__ ) || \ - defined( __DCC__ ) || \ + defined( HB_OS_VXWORKS ) || \ defined( HB_OS_BSD ) || \ defined( HB_OS_DARWIN ) || \ defined( HB_OS_HAIKU ) || \ diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 12a52d13f6..f14badaf2b 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -417,11 +417,13 @@ typedef HB_UCHAR HB_U8; typedef HB_ULONG ULONG; #if ! defined( _WINNT_H ) - #if ! defined( LONGLONG ) - typedef HB_LONGLONG LONGLONG; - #endif - #if ! defined( ULONGLONG ) - typedef HB_ULONGLONG ULONGLONG; + #if ! defined( HB_LONG_LONG_OFF ) + #if ! defined( LONGLONG ) + typedef HB_LONGLONG LONGLONG; + #endif + #if ! defined( ULONGLONG ) + typedef HB_ULONGLONG ULONGLONG; + #endif #endif #endif @@ -452,11 +454,13 @@ typedef HB_UCHAR HB_U8; #if ! defined( INT32 ) typedef HB_I32 INT32; #endif - #if ! defined( UINT64 ) - typedef HB_U64 UINT64; - #endif - #if ! defined( INT64 ) - typedef HB_I64 INT64; + #if ! defined( HB_LONG_LONG_OFF ) + #if ! defined( UINT64 ) + typedef HB_U64 UINT64; + #endif + #if ! defined( INT64 ) + typedef HB_I64 INT64; + #endif #endif #endif diff --git a/harbour/include/hbinit.h b/harbour/include/hbinit.h index 3dec9976f0..e4443edc44 100644 --- a/harbour/include/hbinit.h +++ b/harbour/include/hbinit.h @@ -170,13 +170,23 @@ extern HB_EXPORT PHB_SYMB hb_vmProcessSymbols( PHB_SYMB pSymbols, HB_USHORT uiSy #define HB_INIT_SYMBOLS_BEGIN( func ) \ static HB_SYMB symbols_table[] = { - #define HB_INIT_SYMBOLS_EX_END( func, module, id, vpcode ) \ - }; \ - static PHB_SYMB symbols = symbols_table; \ - static void __attribute__ ((constructor)) func( void ) \ - { \ - symbols = hb_vmProcessSymbols( symbols_table, ( HB_USHORT ) ( sizeof( symbols_table ) / sizeof( HB_SYMB ) ), (module), (id), (vpcode) ); \ - } + #if defined( __DCC__ ) + #define HB_INIT_SYMBOLS_EX_END( func, module, id, vpcode ) \ + }; \ + static PHB_SYMB symbols = symbols_table; \ + void __attribute__ ((constructor)) func( void ) \ + { \ + symbols = hb_vmProcessSymbols( symbols_table, ( HB_USHORT ) ( sizeof( symbols_table ) / sizeof( HB_SYMB ) ), (module), (id), (vpcode) ); \ + } + #else + #define HB_INIT_SYMBOLS_EX_END( func, module, id, vpcode ) \ + }; \ + static PHB_SYMB symbols = symbols_table; \ + static void __attribute__ ((constructor)) func( void ) \ + { \ + symbols = hb_vmProcessSymbols( symbols_table, ( HB_USHORT ) ( sizeof( symbols_table ) / sizeof( HB_SYMB ) ), (module), (id), (vpcode) ); \ + } + #endif #define HB_CALL_ON_STARTUP_BEGIN( func ) \ static void __attribute__ ((constructor)) func( void ) \ diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index bb619f3819..a95ded81d6 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -419,6 +419,8 @@ #if defined( HB_OS_VXWORKS ) #define HB_NO_FNMATCH + /* NOTE: Needed to avoid 'implicit bzero() declaration' warnings */ + extern void bzero( char * buffer, int nbytes ); #endif #if defined( __DCC__ ) /* NOTE: Without this, the compiler will crash with this error, even with optimizations disabled: [vszakats] diff --git a/harbour/include/hbthread.h b/harbour/include/hbthread.h index afbe7c76b1..88ea5f8658 100644 --- a/harbour/include/hbthread.h +++ b/harbour/include/hbthread.h @@ -65,14 +65,9 @@ defined( HB_OS_SUNOS ) || defined( HB_OS_HPUX ) || \ defined( HB_OS_BSD ) || defined( HB_OS_BEOS ) || \ defined( HB_OS_QNX ) || defined( HB_OS_VXWORKS ) -# if defined( HB_OS_VXWORKS ) - /* Hack to avoid this collision between system headers: [vszakats] - ...\vxworks-6.8\target\usr\h/pthread.h:78, - ...\vxworks-6.8\target\usr\h/unistd.h:439: error: redefinition of typedef 'intptr_t' - ...\vxworks-6.8\target\usr\h/stdint.h:76: error: previous declaration of 'intptr_t' was here */ -# if defined( _INTPTR ) && !defined( _INTPTR_T ) -# define _INTPTR_T -# endif + /* NOTE: Hack to avoid collision between stdint.h and unistd.h. [vszakats] */ +# if defined( HB_OS_VXWORKS ) && defined( _INTPTR ) && !defined( _INTPTR_T ) +# define _INTPTR_T # endif # include # define HB_PTHREAD_API diff --git a/harbour/src/common/hbarch.c b/harbour/src/common/hbarch.c index 2889a0a3c5..fb03effb09 100644 --- a/harbour/src/common/hbarch.c +++ b/harbour/src/common/hbarch.c @@ -310,7 +310,7 @@ double hb_get_le_int64( const HB_BYTE * ptr ) return ldexp( ( double ) l2, 32 ) + ( double ) l1; } -void hb_put_le_uint64( HB_BYTE * ptr, double d ) +void hb_put_le_uint64( const HB_BYTE * ptr, double d ) { HB_U32 l1, l2; diff --git a/harbour/src/common/hbver.c b/harbour/src/common/hbver.c index a98c07137d..c86ccce6b3 100644 --- a/harbour/src/common/hbver.c +++ b/harbour/src/common/hbver.c @@ -517,6 +517,7 @@ char * hb_verCompiler( void ) int iVerMinor; int iVerPatch; int iVerMicro = 0; + int iElements = 0; HB_TRACE(HB_TR_DEBUG, ("hb_verCompiler()")); @@ -709,6 +710,7 @@ char * hb_verCompiler( void ) iVerMinor = ( __VERSION_NUMBER__ / 100 ) % 10; iVerPatch = ( __VERSION_NUMBER__ / 10 ) % 10; iVerMicro = __VERSION_NUMBER__ % 10; + iElements = 4; #elif defined( __clang__ ) && defined( __clang_major__ ) @@ -830,7 +832,7 @@ char * hb_verCompiler( void ) if( pszName ) { - if( iVerMicro != 0 ) + if( iElements == 4 ) hb_snprintf( pszCompiler, COMPILER_BUF_SIZE, "%s%s %d.%d.%d.%d", pszName, szSub, iVerMajor, iVerMinor, iVerPatch, iVerMicro ); else if( iVerPatch != 0 ) hb_snprintf( pszCompiler, COMPILER_BUF_SIZE, "%s%s %d.%d.%d", pszName, szSub, iVerMajor, iVerMinor, iVerPatch ); diff --git a/harbour/src/rtl/hbsocket.c b/harbour/src/rtl/hbsocket.c index 9e067045d3..7cfa420a8c 100644 --- a/harbour/src/rtl/hbsocket.c +++ b/harbour/src/rtl/hbsocket.c @@ -227,6 +227,10 @@ # include # if !( defined( HB_OS_LINUX ) && defined( __WATCOMC__ ) ) # include +# endif + /* NOTE: Hack to avoid collision between stdint.h and unistd.h. [vszakats] */ +# if defined( HB_OS_VXWORKS ) && defined( _INTPTR ) && !defined( _INTPTR_T ) +# define _INTPTR_T # endif # include # include diff --git a/harbour/utils/hbtest/hbtest.prg b/harbour/utils/hbtest/hbtest.prg index 31661fdebe..fdd0030753 100644 --- a/harbour/utils/hbtest/hbtest.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -93,6 +93,9 @@ STATIC s_nEndTime #ifdef __HARBOUR__ REQUEST HB_LANG_EN + + ANNOUNCE HB_GTSYS + REQUEST HB_GT_CGI_DEFAULT #endif PROCEDURE Main( cPar1, cPar2 ) @@ -183,6 +186,7 @@ STATIC PROCEDURE Main_LAST() RETURN STATIC PROCEDURE TEST_BEGIN( cParam ) + LOCAL bErrorOld s_nStartTime := Seconds() @@ -263,40 +267,52 @@ STATIC PROCEDURE TEST_BEGIN( cParam ) PUBLIC mbBlockC := sbBlockC PUBLIC maArray := { 9898 } + PUBLIC lDBFAvail := .F. + #ifndef __XPP__ //rddSetDefault( "DBFCDX" ) #endif - dbCreate( "_hbtmp_.dbf",; - { { "TYPE_C" , "C", 15, 0 } ,; - { "TYPE_C_E" , "C", 15, 0 } ,; - { "TYPE_D" , "D", 8, 0 } ,; - { "TYPE_D_E" , "D", 8, 0 } ,; - { "TYPE_M" , "M", 10, 0 } ,; - { "TYPE_M_E" , "M", 10, 0 } ,; - { "TYPE_N_I" , "N", 11, 0 } ,; - { "TYPE_N_IE", "N", 11, 0 } ,; - { "TYPE_N_D" , "N", 11, 3 } ,; - { "TYPE_N_DE", "N", 11, 3 } ,; - { "TYPE_L" , "L", 1, 0 } ,; - { "TYPE_L_E" , "L", 1, 0 } } ) + bErrorOld := ErrorBlock( {| oError | Break( oError ) } ) + BEGIN SEQUENCE + dbCreate( "_hbtmp_.dbf",; + { { "TYPE_C" , "C", 15, 0 } ,; + { "TYPE_C_E" , "C", 15, 0 } ,; + { "TYPE_D" , "D", 8, 0 } ,; + { "TYPE_D_E" , "D", 8, 0 } ,; + { "TYPE_M" , "M", 10, 0 } ,; + { "TYPE_M_E" , "M", 10, 0 } ,; + { "TYPE_N_I" , "N", 11, 0 } ,; + { "TYPE_N_IE", "N", 11, 0 } ,; + { "TYPE_N_D" , "N", 11, 3 } ,; + { "TYPE_N_DE", "N", 11, 3 } ,; + { "TYPE_L" , "L", 1, 0 } ,; + { "TYPE_L_E" , "L", 1, 0 } } ) - USE ( "_hbtmp_.dbf" ) NEW ALIAS w_TEST EXCLUSIVE + USE ( "_hbtmp_.dbf" ) NEW ALIAS w_TEST EXCLUSIVE - dbAppend() + dbAppend() - w_TEST->TYPE_C := "" - w_TEST->TYPE_C_E := "" - w_TEST->TYPE_D := sdDate - w_TEST->TYPE_D_E := sdDateE - w_TEST->TYPE_M := "" - w_TEST->TYPE_M_E := "" - w_TEST->TYPE_N_I := 100 - w_TEST->TYPE_N_IE := 0 - w_TEST->TYPE_N_D := 101.127 - w_TEST->TYPE_N_DE := 0 - w_TEST->TYPE_L := .T. - w_TEST->TYPE_L_E := .F. + w_TEST->TYPE_C := "" + w_TEST->TYPE_C_E := "" + w_TEST->TYPE_D := sdDate + w_TEST->TYPE_D_E := sdDateE + w_TEST->TYPE_M := "" + w_TEST->TYPE_M_E := "" + w_TEST->TYPE_N_I := 100 + w_TEST->TYPE_N_IE := 0 + w_TEST->TYPE_N_D := 101.127 + w_TEST->TYPE_N_DE := 0 + w_TEST->TYPE_L := .T. + w_TEST->TYPE_L_E := .F. + + lDBFAvail := .T. + END SEQUENCE + ErrorBlock( bErrorOld ) + + IF ! lDBFAvail + OutMsg( s_nFhnd, "WARNING ! Test .dbf could not be created. Related tests will be skipped." + HB_OSNewLine() ) + ENDIF RETURN @@ -388,8 +404,10 @@ STATIC PROCEDURE TEST_END() dbSelectArea( "w_TEST" ) dbCloseArea() - FErase( "_hbtmp_.dbf" ) - FErase( "_hbtmp_.dbt" ) + IF lDBFAvail + FErase( "_hbtmp_.dbf" ) + FErase( "_hbtmp_.dbt" ) + ENDIF s_nEndTime := Seconds() diff --git a/harbour/utils/hbtest/rt_hvm.prg b/harbour/utils/hbtest/rt_hvm.prg index e394e183f8..f96e7c4cca 100644 --- a/harbour/utils/hbtest/rt_hvm.prg +++ b/harbour/utils/hbtest/rt_hvm.prg @@ -79,12 +79,14 @@ PROCEDURE Main_HVM() TEST_LINE( ValType( sbBlock ) , "B" ) TEST_LINE( ValType( saArray ) , "A" ) TEST_LINE( ValType( { 1, 2, 3 } ) , "A" ) + IF lDBFAvail TEST_LINE( ValType( w_TEST->TYPE_C ) , "C" ) TEST_LINE( ValType( w_TEST->TYPE_D ) , "D" ) TEST_LINE( ValType( w_TEST->TYPE_M ) , "M" ) TEST_LINE( ValType( w_TEST->TYPE_N_I ) , "N" ) TEST_LINE( ValType( w_TEST->TYPE_N_D ) , "N" ) TEST_LINE( ValType( w_TEST->TYPE_L ) , "L" ) + ENDIF #ifdef __HARBOUR__ TEST_LINE( ValType( @scString ) , "C" ) /* Bug in CA-Cl*pper, it will return "U" */ TEST_LINE( ValType( @scStringE ) , "C" ) /* Bug in CA-Cl*pper, it will return "U" */ @@ -154,12 +156,14 @@ PROCEDURE Main_HVM() TEST_LINE( Type( 100 ) , "E 1 BASE 1121 Argument error (TYPE) OS:0 #:0 A:1:N:100 F:S" ) TEST_LINE( Type( {} ) , "E 1 BASE 1121 Argument error (TYPE) OS:0 #:0 A:1:A:{.[0].} F:S" ) #endif + IF lDBFAvail TEST_LINE( Type( "w_TEST->TYPE_C" ) , "C" ) TEST_LINE( Type( "w_TEST->TYPE_D" ) , "D" ) TEST_LINE( Type( "w_TEST->TYPE_M" ) , "M" ) TEST_LINE( Type( "w_TEST->TYPE_N_I" ) , "N" ) TEST_LINE( Type( "w_TEST->TYPE_N_D" ) , "N" ) TEST_LINE( Type( "w_TEST->TYPE_L" ) , "L" ) + ENDIF TEST_LINE( Type( "mxNotHere" ) , "U" ) TEST_LINE( Type( "mcString" ) , "C" ) TEST_LINE( Type( "mcStringE" ) , "C" ) diff --git a/harbour/utils/hbtest/rt_hvma.prg b/harbour/utils/hbtest/rt_hvma.prg index 4ba9e781f2..282c8ada3a 100644 --- a/harbour/utils/hbtest/rt_hvma.prg +++ b/harbour/utils/hbtest/rt_hvma.prg @@ -451,10 +451,12 @@ PROCEDURE Main_HVMA() TEST_LINE( Len( "" ) , 0 ) TEST_LINE( Len( "123" ) , 3 ) TEST_LINE( Len( "123"+Chr(0)+"456 " ) , 8 ) + IF lDBFAvail TEST_LINE( Len( w_TEST->TYPE_C ) , 15 ) TEST_LINE( Len( w_TEST->TYPE_C_E ) , 15 ) TEST_LINE( Len( w_TEST->TYPE_M ) , 11 ) TEST_LINE( Len( w_TEST->TYPE_M_E ) , 0 ) + ENDIF TEST_LINE( Len( saArray ) , 1 ) #ifdef __HARBOUR__ TEST_LINE( Len( ErrorNew() ) , 12 ) @@ -481,6 +483,7 @@ PROCEDURE Main_HVMA() TEST_LINE( Empty( " x " ) , .F. ) TEST_LINE( Empty( " x"+Chr(0) ) , .F. ) TEST_LINE( Empty( " "+Chr(13)+"x"+Chr(9) ) , .F. ) + IF lDBFAvail TEST_LINE( Empty( w_TEST->TYPE_C ) , .F. ) TEST_LINE( Empty( w_TEST->TYPE_C_E ) , .T. ) TEST_LINE( Empty( w_TEST->TYPE_D ) , .F. ) @@ -493,6 +496,7 @@ PROCEDURE Main_HVMA() TEST_LINE( Empty( w_TEST->TYPE_N_DE ) , .T. ) TEST_LINE( Empty( w_TEST->TYPE_L ) , .F. ) TEST_LINE( Empty( w_TEST->TYPE_L_E ) , .T. ) + ENDIF TEST_LINE( Empty( 0 ) , .T. ) TEST_LINE( Empty( -0 ) , .T. ) TEST_LINE( Empty( 0.0 ) , .T. ) diff --git a/harbour/utils/hbtest/rt_stra.prg b/harbour/utils/hbtest/rt_stra.prg index bdad28759d..b47e1f2fb6 100644 --- a/harbour/utils/hbtest/rt_stra.prg +++ b/harbour/utils/hbtest/rt_stra.prg @@ -64,10 +64,12 @@ PROCEDURE Main_STRA() TEST_LINE( Str(100, 10, "A") , "E 1 BASE 1099 Argument error (STR) OS:0 #:0 A:3:N:100;N:10;C:A F:S" ) TEST_LINE( Str(100, 10, NIL) , "E 1 BASE 1099 Argument error (STR) OS:0 #:0 A:3:N:100;N:10;U:NIL F:S" ) TEST_LINE( Str(100, NIL, NIL) , "E 1 BASE 1099 Argument error (STR) OS:0 #:0 A:3:N:100;U:NIL;U:NIL F:S" ) + IF lDBFAvail TEST_LINE( Str( w_TEST->TYPE_N_I ) , " 100" ) TEST_LINE( Str( w_TEST->TYPE_N_IE ) , " 0" ) TEST_LINE( Str( w_TEST->TYPE_N_D ) , " 101.127" ) TEST_LINE( Str( w_TEST->TYPE_N_DE ) , " 0.000" ) + ENDIF TEST_LINE( Str(5000000000.0) , "5000000000.0" ) TEST_LINE( Str(50000000) , " 50000000" ) TEST_LINE( Str(500000000) , " 500000000" ) diff --git a/harbour/utils/hbtest/rt_vars.ch b/harbour/utils/hbtest/rt_vars.ch index f5a5824aed..a267469607 100644 --- a/harbour/utils/hbtest/rt_vars.ch +++ b/harbour/utils/hbtest/rt_vars.ch @@ -50,6 +50,8 @@ * */ +MEMVAR lDBFAvail + MEMVAR mxNotHere /* Please don't declare this variable, since it's used to test undeclared MEMVAR situations. */ MEMVAR mcLongerNameThen10Chars MEMVAR mcString