From 4ff514f08f8b313b0fe38b55bec325254cd2f66f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 13 Apr 2008 20:27:07 +0000 Subject: [PATCH] 2008-04-13 22:16 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * utils/hbtest/make_c5x.bat * utils/hbtest/hbtest.prg * utils/hbtest/rt_miscc.c * utils/hbtest/rt_misc.prg - Removed dependency on hbclip. + Added proper C version of hb_SToD() for C5.x compiles. (Needs MSC) ! Refixed hb_SToD() results messed up in my previous commit. Sorry for the confusion, Harbour was perfectly 100% compatible, the reference values were wrong in default HBTEST for CA-Cl*pper. + Disabling hb_SToD() tests with invalid input values for CA-Cl*pper in case there was no C compiler available when building HBTEST. This is to avoid any invalid results (due to the .prg version of hb_SToD() and to avoid confusions such as above. --- harbour/ChangeLog | 18 ++++++++++++++++++ harbour/utils/hbtest/hbtest.prg | 2 +- harbour/utils/hbtest/make_c5x.bat | 8 -------- harbour/utils/hbtest/rt_misc.prg | 20 +++++++++++--------- harbour/utils/hbtest/rt_miscc.c | 12 ++++++++++++ 5 files changed, 42 insertions(+), 18 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2a72a60b09..8526edb3af 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,24 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-04-13 22:16 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * utils/hbtest/make_c5x.bat + * utils/hbtest/hbtest.prg + * utils/hbtest/rt_miscc.c + * utils/hbtest/rt_misc.prg + - Removed dependency on hbclip. + + Added proper C version of hb_SToD() for C5.x compiles. + (Needs MSC) + ! Refixed hb_SToD() results messed up in my previous + commit. Sorry for the confusion, Harbour was perfectly + 100% compatible, the reference values were wrong in + default HBTEST for CA-Cl*pper. + + Disabling hb_SToD() tests with invalid input values + for CA-Cl*pper in case there was no C compiler available + when building HBTEST. This is to avoid any invalid + results (due to the .prg version of hb_SToD() and to + avoid confusions such as above. + 2008-04-13 21:59 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/rtl/mod.c ! Fixed error object to be C5x compatible when wrong or too diff --git a/harbour/utils/hbtest/hbtest.prg b/harbour/utils/hbtest/hbtest.prg index 7329cf1b5a..859e7fa9b0 100644 --- a/harbour/utils/hbtest/hbtest.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -578,7 +578,7 @@ FUNCTION HB_SToD( cDate ) RETURN SToD( cDate ) #endif -#ifndef HAVE_HBCLIP +#ifdef RT_NO_C #ifndef __HARBOUR__ #ifndef __XPP__ diff --git a/harbour/utils/hbtest/make_c5x.bat b/harbour/utils/hbtest/make_c5x.bat index f1532acd54..160143b37b 100644 --- a/harbour/utils/hbtest/make_c5x.bat +++ b/harbour/utils/hbtest/make_c5x.bat @@ -3,14 +3,6 @@ rem rem $Id$ rem -if not exist ..\..\contrib\hbclip\hbclip.lib goto NO_HBCLIP - -set HB_CLIPOPT=%HB_CLIPOPT% /DHAVE_HBCLIP -set HB_LINKOPT=li hbclip -set LIB=..\..\contrib\hbclip\;%LIB% - -:NO_HBCLIP - rem ; TODO: Use /FPi when HB_COMPAT_C53=1 %HB_MSC_DIR%\cl.exe /c /AL /Zl /Oalt /Gs /FPa /W3 /G2 rt_miscc.c diff --git a/harbour/utils/hbtest/rt_misc.prg b/harbour/utils/hbtest/rt_misc.prg index bcc06ea197..2004a5bde6 100644 --- a/harbour/utils/hbtest/rt_misc.prg +++ b/harbour/utils/hbtest/rt_misc.prg @@ -539,6 +539,7 @@ FUNCTION Main_MISC() } */ +#ifndef RT_NO_C #ifndef __XPP__ TEST_LINE( HB_SToD() , HB_SToD(" ") ) #endif @@ -551,27 +552,28 @@ FUNCTION Main_MISC() TEST_LINE( HB_SToD(" 1234567") , HB_SToD(" ") ) TEST_LINE( HB_SToD("1999 ") , HB_SToD(" ") ) TEST_LINE( HB_SToD("99999999") , HB_SToD(" ") ) - TEST_LINE( HB_SToD("99990101") , HB_SToD(" ") ) + TEST_LINE( HB_SToD("99990101") , HB_SToD("99990101") ) TEST_LINE( HB_SToD("19991301") , HB_SToD(" ") ) TEST_LINE( HB_SToD("19991241") , HB_SToD(" ") ) TEST_LINE( HB_SToD("01000101") , HB_SToD("01000101") ) TEST_LINE( HB_SToD("29991231") , HB_SToD("29991231") ) TEST_LINE( HB_SToD("19990905") , HB_SToD("19990905") ) - TEST_LINE( HB_SToD(" 9990905") , HB_SToD("09990905") ) - TEST_LINE( HB_SToD(" 990905") , HB_SToD("19990905") ) - TEST_LINE( HB_SToD(" 90905") , HB_SToD("19090905") ) + TEST_LINE( HB_SToD(" 9990905") , HB_SToD(" ") ) + TEST_LINE( HB_SToD(" 990905") , HB_SToD(" ") ) + TEST_LINE( HB_SToD(" 90905") , HB_SToD(" ") ) TEST_LINE( HB_SToD(" 0905") , HB_SToD(" ") ) TEST_LINE( HB_SToD(" 905") , HB_SToD(" ") ) TEST_LINE( HB_SToD(" 05") , HB_SToD(" ") ) TEST_LINE( HB_SToD("1 990905") , HB_SToD(" ") ) - TEST_LINE( HB_SToD("19 90905") , HB_SToD(" ") ) /* Bug in C5.x. They return "19190909". */ - TEST_LINE( HB_SToD("199 0905") , HB_SToD(" ") ) /* Bug/feature in C5.x. They return "01990905". */ - TEST_LINE( HB_SToD("1999 905") , HB_SToD("19990905") ) + TEST_LINE( HB_SToD("19 90905") , HB_SToD("17490905") ) + TEST_LINE( HB_SToD("199 0905") , HB_SToD("19740905") ) + TEST_LINE( HB_SToD("1999 905") , HB_SToD(" ") ) TEST_LINE( HB_SToD("19990 05") , HB_SToD(" ") ) - TEST_LINE( HB_SToD("199909 5") , HB_SToD("19990905") ) + TEST_LINE( HB_SToD("199909 5") , HB_SToD(" ") ) TEST_LINE( HB_SToD("1999090 ") , HB_SToD(" ") ) - TEST_LINE( HB_SToD("1999 9 5") , HB_SToD("19990905") ) + TEST_LINE( HB_SToD("1999 9 5") , HB_SToD(" ") ) TEST_LINE( HB_SToD("1999090" + Chr(0)) , HB_SToD(" ") ) +#endif /* DESCEND() */ diff --git a/harbour/utils/hbtest/rt_miscc.c b/harbour/utils/hbtest/rt_miscc.c index 36ef668109..029616be40 100644 --- a/harbour/utils/hbtest/rt_miscc.c +++ b/harbour/utils/hbtest/rt_miscc.c @@ -61,3 +61,15 @@ RT_FUNDEF( R_PASSENLC ) { _retnl( 1000000000L ); } + +#ifndef __HARBOUR__ +#ifndef __XPP__ + +CLIPPER HB_STOD( void ) +{ + // The length check is a fix to avoid buggy behaviour of _retds() + _retds( ( ISCHAR( 1 ) && _parclen( 1 ) == 8 ) ? _parc( 1 ) : " " ); +} + +#endif +#endif