19990908-03:14 GMT+1

This commit is contained in:
Viktor Szakats
1999-09-08 01:27:51 +00:00
parent 238168f2a0
commit 9ecfab59a4
4 changed files with 46 additions and 1 deletions

View File

@@ -1,3 +1,11 @@
19990908-03:14 GMT+1 Victor Szel <info@szelvesz.hu>
* tests/working/rtl_test.prg
+ Some ==/= tests added for strings.
* source/rtl/arrays.c
! hb_arrayScan(). Fixed a string comparison bug.
* source/rtl/transform.c
+ TOFIX added about a directly modified item string buffer.
19990908-02:30 GMT+1 Victor Szel <info@szelvesz.hu>
* source/rtl/math.c
source/rtl/strings.c

View File

@@ -415,7 +415,9 @@ ULONG hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, ULONG ulStart, ULONG ulCou
{
PHB_ITEM pItem = pBaseArray->pItems + ulStart;
if( IS_STRING( pItem ) && hb_itemStrCmp( pValue, pItem, FALSE ) == 0 )
/* NOTE: The order of the pItem and pValue parameters passed to
hb_itemStrCmp() is significant, please don't change it. */
if( IS_STRING( pItem ) && hb_itemStrCmp( pItem, pValue, FALSE ) == 0 )
return ulStart + 1;
}
}

View File

@@ -36,6 +36,8 @@
/* TODO: Getting rid of calling back HARBOUR HB_STR() function */
/* and #include "ctoharb.h" */
/* TOFIX: TRANSFORM() is directly modifying an item string buffer.
This is dangerous, and should be fixed. */
#include <ctype.h>
#include "extend.h"

View File

@@ -454,6 +454,39 @@ STATIC FUNCTION Main_HVM()
TEST_LINE( scString > 1 , "E BASE 1075 Argument error > F:S" )
TEST_LINE( scString >= 1 , "E BASE 1076 Argument error >= F:S" )
TEST_LINE( scString <> 1 , "E BASE 1072 Argument error <> F:S" )
SET EXACT ON
TEST_LINE( "123" = "123 " , .T. )
TEST_LINE( " 123" = "123" , .F. )
TEST_LINE( "123" = "12345" , .F. )
TEST_LINE( "12345" = "123" , .F. )
TEST_LINE( "123" = "" , .F. )
TEST_LINE( "" = "123" , .F. )
TEST_LINE( "A" == "A" , .T. )
TEST_LINE( "Z" == "A" , .F. )
TEST_LINE( "A" == "A " , .F. )
TEST_LINE( "AA" == "A" , .F. )
SET EXACT OFF
TEST_LINE( "123" = "123 " , .F. )
TEST_LINE( " 123" = "123" , .F. )
TEST_LINE( "123" = "12345" , .F. )
TEST_LINE( "12345" = "123" , .T. )
TEST_LINE( "123" = "" , .T. )
TEST_LINE( "" = "123" , .F. )
TEST_LINE( "A" == "A" , .T. )
TEST_LINE( "Z" == "A" , .F. )
TEST_LINE( "A" == "A " , .F. )
TEST_LINE( "AA" == "A" , .F. )
TEST_LINE( scString = scString , .T. )
TEST_LINE( scString = scStringE , .T. )
TEST_LINE( scString = scStringZ , .F. )
TEST_LINE( scStringE = scString , .F. )
TEST_LINE( scStringE = scStringE , .T. )
TEST_LINE( scStringE = scStringZ , .F. )
TEST_LINE( scStringZ = scString , .F. )
TEST_LINE( scStringZ = scStringE , .T. )
TEST_LINE( scStringZ = scStringZ , .T. )
TEST_LINE( scString == 1 , "E BASE 1070 Argument error == F:S" )
TEST_LINE( soObject == soObject , .T. )
TEST_LINE( soObject = soObject , "E BASE 1071 Argument error = F:S" )