From 774377666f0ca76020f39bdc76331f09250e1203 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 11 Oct 2012 14:33:54 +0000 Subject: [PATCH] 2012-10-11 16:32 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbamf/tests/tstendin.prg ! fixed infinite loop after one recent change ! fixed to not redefine ? operator, making it ambiguous. use unused command name instead ! fixed one test value, which actually needs to be in UTF-8 to give proper results. + added #require so it now works as script * contrib/hbamf/hbamfobj.prg * contrib/hbhttpd/widgets.prg * contrib/hbnf/linked.prg * contrib/xhb/xhbtedit.prg * extras/gtwvw/tests/ebtest7.prg ! do not use = operator --- harbour/ChangeLog | 16 ++++++++ harbour/contrib/hbamf/hbamfobj.prg | 2 +- harbour/contrib/hbamf/tests/tstendin.prg | 49 ++++++++++++------------ harbour/contrib/hbhttpd/widgets.prg | 2 +- harbour/contrib/hbnf/linked.prg | 2 +- harbour/contrib/xhb/xhbtedit.prg | 10 ++--- harbour/extras/gtwvw/tests/ebtest7.prg | 2 +- 7 files changed, 50 insertions(+), 33 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4cb462f85e..13f5f97b61 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,22 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-11 16:32 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbamf/tests/tstendin.prg + ! fixed infinite loop after one recent change + ! fixed to not redefine ? operator, making it ambiguous. + use unused command name instead + ! fixed one test value, which actually needs to be in UTF-8 + to give proper results. + + added #require so it now works as script + + * contrib/hbamf/hbamfobj.prg + * contrib/hbhttpd/widgets.prg + * contrib/hbnf/linked.prg + * contrib/xhb/xhbtedit.prg + * extras/gtwvw/tests/ebtest7.prg + ! do not use = operator + 2012-10-11 15:07 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbamf/readme.txt * contrib/hbcairo/tests/table.prg diff --git a/harbour/contrib/hbamf/hbamfobj.prg b/harbour/contrib/hbamf/hbamfobj.prg index e2446d4bad..cf146dd7cb 100644 --- a/harbour/contrib/hbamf/hbamfobj.prg +++ b/harbour/contrib/hbamf/hbamfobj.prg @@ -48,7 +48,7 @@ METHOD noMessage( ... ) CLASS AMF_Obj METHOD msgNotFound( cMessage, ... ) CLASS AMF_Obj - IF PCount() = 1 .AND. !( hb_BLeft( cMessage, 1 ) == "_" ) + IF PCount() == 1 .AND. !( hb_BLeft( cMessage, 1 ) == "_" ) IF ! Empty( ::hCachedData ) .AND. hb_HHasKey( ::hCachedData, cMessage ) RETURN ::hCachedData[ cMessage ] ENDIF diff --git a/harbour/contrib/hbamf/tests/tstendin.prg b/harbour/contrib/hbamf/tests/tstendin.prg index 96eba650b2..d8f2bddcbd 100644 --- a/harbour/contrib/hbamf/tests/tstendin.prg +++ b/harbour/contrib/hbamf/tests/tstendin.prg @@ -2,40 +2,41 @@ * $Id$ */ +#require "hbamf" + REQUEST HB_CODEPAGE_UTF8EX -#uncommand ? [] => -#command ? [] => A( ) +#command TEST [] => _TEST( ) PROCEDURE Main() hb_cdpSelect( "UTF8EX" ) - ? { }, "8352" - ? "a", "F248" - ? "¥", "96F0" - ? 1, "AE79" - ? 1000, "278B" - ? 1000000, "A752" - ? 268435455, "4907" - ? 268435456, "E677" - ? 268435456000, "4271" - ? - 1, "FE11" - ? 9007199254740990, "0009" - ? AMF3_DECODE( AMF3_ENCODE( 9007199254740990 ) ), "0009" - ? 9007199254740991, "8918" - ? AMF3_DECODE( AMF3_ENCODE( 9007199254740991 ) ), "8918" - ? 9007199254740991.00, "8918" - ? 6969.69, "10AF" - ? NIL, "F1E1" - ? .T. , "E3C2" - ? .F. , "6AD3" - ? { 1, - 1 }, "0560" - ? { "ONE" => 0xcafe, "TWO" => 0xbabe }, "CE93" + TEST {}, "8352" + TEST "a", "F248" + TEST "ą", "96F0" + TEST 1, "AE79" + TEST 1000, "278B" + TEST 1000000, "A752" + TEST 268435455, "4907" + TEST 268435456, "E677" + TEST 268435456000, "4271" + TEST -1, "FE11" + TEST 9007199254740990, "0009" + TEST AMF3_DECODE( AMF3_ENCODE( 9007199254740990 ) ), "0009" + TEST 9007199254740991, "8918" + TEST AMF3_DECODE( AMF3_ENCODE( 9007199254740991 ) ), "8918" + TEST 9007199254740991.00, "8918" + TEST 6969.69, "10AF" + TEST NIL, "F1E1" + TEST .T. , "E3C2" + TEST .F. , "6AD3" + TEST { 1, -1 }, "0560" + TEST { "ONE" => 0xcafe, "TWO" => 0xbabe }, "CE93" RETURN -PROCEDURE A( a, cChkOK ) +STATIC PROCEDURE _TEST( a, cChkOK ) LOCAL x := AMF3_ENCODE( a ) LOCAL cChk := hb_StrToHex( I2Bin( hb_CRC( x ) ) ) diff --git a/harbour/contrib/hbhttpd/widgets.prg b/harbour/contrib/hbhttpd/widgets.prg index 9019a87532..6c16a1d7e6 100644 --- a/harbour/contrib/hbhttpd/widgets.prg +++ b/harbour/contrib/hbhttpd/widgets.prg @@ -473,7 +473,7 @@ PROCEDURE UProcWidgets( cURL, aMap ) LOCAL aStack, aURL, aFrame, cI, nI, nL, lRet IF hb_HHasKey( aMap, cURL ) - // aStack[ i ] = { url_part, function, variables } + // aStack[ i ] := { url_part, function, variables } IF ( aStack := hb_HGetDef( session, "_ustack" ) ) == NIL session[ "_ustack" ] := aStack := {} ENDIF diff --git a/harbour/contrib/hbnf/linked.prg b/harbour/contrib/hbnf/linked.prg index bca69bbcdf..e5df205a4c 100644 --- a/harbour/contrib/hbnf/linked.prg +++ b/harbour/contrib/hbnf/linked.prg @@ -58,7 +58,7 @@ FUNCTION FT_Linked( cFuncs ) ENDDO // Scan through the array of functions, stop after the first occurence // of a function which returns a TYPE() of "U" (hence is not linked in) - lRetVal := AScan( aFuncArray, {| element | Type( element ) == "U" } ) = 0 + lRetVal := AScan( aFuncArray, {| element | Type( element ) == "U" } ) == 0 ENDIF RETURN lRetVal diff --git a/harbour/contrib/xhb/xhbtedit.prg b/harbour/contrib/xhb/xhbtedit.prg index 345f381cb2..ce3b94e3d9 100644 --- a/harbour/contrib/xhb/xhbtedit.prg +++ b/harbour/contrib/xhb/xhbtedit.prg @@ -1350,11 +1350,11 @@ METHOD WordLeft() CLASS XHBEditor ::nCol < ::LineLen( ::nRow ) .AND. ; Empty( ::GetCol( ::nRow,::nCol ) ) ::WordRight() - ELSEIF ::lWordWrap .AND. ::nCol = 1 .AND. ::nRow = 1 .AND. ; + ELSEIF ::lWordWrap .AND. ::nCol == 1 .AND. ::nRow == 1 .AND. ; Empty( ::GetCol( ::nRow,::nCol ) ) ::WordRight() - ELSEIF ::lWordWrap .AND. ::nCol = 1 .AND. ::nRow > 1 - DO While ::nCol = 1 .AND. ::nRow > 1 .AND. Empty( ::GetCol( ::nRow, ::nCol ) ) + ELSEIF ::lWordWrap .AND. ::nCol == 1 .AND. ::nRow > 1 + DO While ::nCol == 1 .AND. ::nRow > 1 .AND. Empty( ::GetCol( ::nRow, ::nCol ) ) ::up() IF !::IsEmptyLine( ::nRow ) ::end() @@ -2495,7 +2495,7 @@ METHOD SetTextSelection( cAction, nCount ) CLASS XHBEditor ENDIF ELSEIF nCount < 0 // Shift Left IF ::nCol > 1 - IF ::nColSelStart = 0 .AND. ::nColSelEnd = 0 + IF ::nColSelStart == 0 .AND. ::nColSelEnd == 0 ::nColSelEnd := ::nColSelStart := ::nCol ENDIF ::GotoCol( ::nCol - 1 ) @@ -2655,7 +2655,7 @@ METHOD SetTextSelection( cAction, nCount ) CLASS XHBEditor ELSE ::nColSelStart := Max( 1, ::nCol ) ENDIF - IF ::nCol = 1 .AND. ::nColSelStart == ::nColSelEnd + IF ::nCol == 1 .AND. ::nColSelStart == ::nColSelEnd ::lSelActive := .F. ENDIF ::RefreshLine( .T. ) diff --git a/harbour/extras/gtwvw/tests/ebtest7.prg b/harbour/extras/gtwvw/tests/ebtest7.prg index b95ca405ac..80487d852e 100644 --- a/harbour/extras/gtwvw/tests/ebtest7.prg +++ b/harbour/extras/gtwvw/tests/ebtest7.prg @@ -899,7 +899,7 @@ STATIC FUNCTION GetNumMask( Text, mcvaltype ) s := '' FOR i := 1 TO Len( Text ) c := SubStr( Text, i, 1 ) - IF c = '9' .OR. c = '.' + IF c == '9' .OR. c == '.' s := s + c ENDIF IF c == '$' .OR. c == '*'