From ddcaf47aaea7d445beb97bce49e434a85ce267af Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 26 Nov 2012 23:22:39 +0000 Subject: [PATCH] 2012-11-27 00:15 UTC+0100 Viktor Szakats (harbour syenar.net) + contrib/hbct/tests/test.prg * contrib/hbct/doc/en/*.txt + replaced $TESTS$ in docs with regression test script ; NOTE: there are some failures * src/rtl/Makefile * include/harbour.hbx + src/rtl/hbtestc.c + added an internal function (which I didn't used yet after some experimentations) * src/rtl/hbtest.prg * minor cleanup --- harbour/ChangeLog | 15 ++ harbour/contrib/hbct/doc/en/addascii.txt | 10 - harbour/contrib/hbct/doc/en/asciisum.txt | 4 - harbour/contrib/hbct/doc/en/ascpos.txt | 9 - harbour/contrib/hbct/doc/en/atnum.txt | 12 - harbour/contrib/hbct/doc/en/atrepl.txt | 5 - harbour/contrib/hbct/doc/en/charevod.txt | 7 - harbour/contrib/hbct/doc/en/charlihb.txt | 7 - harbour/contrib/hbct/doc/en/charlist.txt | 6 - harbour/contrib/hbct/doc/en/charmirr.txt | 4 - harbour/contrib/hbct/doc/en/charmix.txt | 6 - harbour/contrib/hbct/doc/en/charone.txt | 9 - harbour/contrib/hbct/doc/en/charonly.txt | 12 - harbour/contrib/hbct/doc/en/charop.txt | 16 -- harbour/contrib/hbct/doc/en/charophb.txt | 14 -- harbour/contrib/hbct/doc/en/charrepl.txt | 6 - harbour/contrib/hbct/doc/en/charsort.txt | 8 - harbour/contrib/hbct/doc/en/charswap.txt | 6 - harbour/contrib/hbct/doc/en/ctmath2.txt | 17 -- harbour/contrib/hbct/doc/en/ctpad.txt | 4 - harbour/contrib/hbct/doc/en/finan.txt | 15 -- harbour/contrib/hbct/doc/en/ftoc.txt | 4 - harbour/contrib/hbct/doc/en/justify.txt | 4 - harbour/contrib/hbct/doc/en/keyset.txt | 8 - harbour/contrib/hbct/doc/en/misc1.txt | 2 - harbour/contrib/hbct/doc/en/num1.txt | 8 - harbour/contrib/hbct/doc/en/numat.txt | 2 - harbour/contrib/hbct/doc/en/numconv.txt | 8 - harbour/contrib/hbct/doc/en/pos1.txt | 8 - harbour/contrib/hbct/doc/en/pos2.txt | 8 - harbour/contrib/hbct/doc/en/posdiff.txt | 4 - harbour/contrib/hbct/doc/en/print.txt | 4 - harbour/contrib/hbct/doc/en/range.txt | 8 - harbour/contrib/hbct/doc/en/relation.txt | 4 - harbour/contrib/hbct/doc/en/remove.txt | 6 - harbour/contrib/hbct/doc/en/replace.txt | 6 - harbour/contrib/hbct/doc/en/screen1.txt | 18 -- harbour/contrib/hbct/doc/en/strdiff.txt | 7 - harbour/contrib/hbct/doc/en/strswap.txt | 2 - harbour/contrib/hbct/doc/en/tab.txt | 10 - harbour/contrib/hbct/doc/en/token1.txt | 26 --- harbour/contrib/hbct/doc/en/token2.txt | 16 -- harbour/contrib/hbct/doc/en/trig.txt | 51 ----- harbour/contrib/hbct/doc/en/video.txt | 8 - harbour/contrib/hbct/doc/en/wordrepl.txt | 6 - harbour/contrib/hbct/doc/en/wordtoch.txt | 2 - harbour/contrib/hbct/tests/test.prg | 268 +++++++++++++++++++++++ harbour/include/harbour.hbx | 3 +- harbour/src/rtl/Makefile | 1 + harbour/src/rtl/hbtest.prg | 2 +- harbour/src/rtl/hbtestc.c | 62 ++++++ 51 files changed, 349 insertions(+), 409 deletions(-) create mode 100644 harbour/contrib/hbct/tests/test.prg create mode 100644 harbour/src/rtl/hbtestc.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d181d0c6f2..3a3ecaeceb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -10,6 +10,21 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2012-11-27 00:15 UTC+0100 Viktor Szakats (harbour syenar.net) + + contrib/hbct/tests/test.prg + * contrib/hbct/doc/en/*.txt + + replaced $TESTS$ in docs with regression test script + ; NOTE: there are some failures + + * src/rtl/Makefile + * include/harbour.hbx + + src/rtl/hbtestc.c + + added an internal function (which I didn't used yet after some + experimentations) + + * src/rtl/hbtest.prg + * minor cleanup + 2012-11-26 22:47 UTC+0100 Viktor Szakats (harbour syenar.net) * src/rtl/Makefile + src/rtl/hbtest.prg diff --git a/harbour/contrib/hbct/doc/en/addascii.txt b/harbour/contrib/hbct/doc/en/addascii.txt index a1856e8c8d..7710c11713 100644 --- a/harbour/contrib/hbct/doc/en/addascii.txt +++ b/harbour/contrib/hbct/doc/en/addascii.txt @@ -41,16 +41,6 @@ // in the string ? AddAscii( "SmitH", 32 ) // --> "Smith" - $TESTS$ - AddAscii( "0000", 1, 1 ) == "1000" - AddAscii( "0000", 1 ) == "0001" - AddAscii( "AAAA", -255, 1 ) == "BAAA" - AddAscii( "AAAA", -255 ) == "AAAB" - AddAscii( "AAAA", 1, 2, .T. ) == "ABAA" - AddAscii( "AAAA", 257, 2, .T. ) == "BBAA" - AddAscii( "AAAA", 257, 2, .F. ) == "ABAA" - AddAscii( "AAAA", 258,, .T. ) == "AABC" - AddAscii( "ABBA", -257, 3, .T. ) == "AAAA" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/asciisum.txt b/harbour/contrib/hbct/doc/en/asciisum.txt index 62f2c71b4d..b7aca33378 100644 --- a/harbour/contrib/hbct/doc/en/asciisum.txt +++ b/harbour/contrib/hbct/doc/en/asciisum.txt @@ -23,10 +23,6 @@ $EXAMPLES$ ? AsciiSum( "ABC" ) // --> 197 ? AsciiSum( "ACB" ) // --> 197 - $TESTS$ - AsciiSum( Replicate( "A", 10000 ) ) == 650000 - AsciiSum( "0123456789" ) == 525 - AsciiSum( NIL ) == 0 $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/ascpos.txt b/harbour/contrib/hbct/doc/en/ascpos.txt index 90be1cd77f..2551c85071 100644 --- a/harbour/contrib/hbct/doc/en/ascpos.txt +++ b/harbour/contrib/hbct/doc/en/ascpos.txt @@ -25,10 +25,6 @@ $EXAMPLES$ ? AscPos( "0123456789" ) // --> 57 ? AscPos( "0123456789", 1 ) // --> 48 - $TESTS$ - AscPos( "0123456789" ) == 57 - AscPos( "0123456789", 1 ) == 48 - AscPos( "0123456789", 11 ) == 0 // to large ! $STATUS$ Ready $COMPLIANCE$ @@ -66,11 +62,6 @@ $EXAMPLES$ ? ValPos( "1234x56789" ) // --> 9 ? ValPos( "1234x56789", 1 ) // --> 1 - $TESTS$ - ValPos( "1234x56789" ) == 9 - ValPos( "1234x56789", 1 ) == 1 - ValPos( "1234x56789", 11 ) == 0 // to large ! - ValPos( "1234x56789", 5 ) == 0 // "x" is not a digit ! $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/atnum.txt b/harbour/contrib/hbct/doc/en/atnum.txt index 7a6b199cae..1b4f30aa36 100644 --- a/harbour/contrib/hbct/doc/en/atnum.txt +++ b/harbour/contrib/hbct/doc/en/atnum.txt @@ -41,10 +41,6 @@ ? AfterAtNum( "!", "What is the answer ? 4 ! 5 !" ) // -> "" ? AfterAtNum( "!", "What is the answer ? 4 ! 5 ?" ) // -> " 5 ?" - $TESTS$ - AfterAtNum( "..", "..This..is..a..test!" ) == "test!" - AfterAtNum( "..", "..This..is..a..test!", 2 ) == "is..a..test!" - AfterAtNum( "..", "..This..is..a..test!", 2, 2 ) == "a..test!" $STATUS$ Ready $COMPLIANCE$ @@ -97,10 +93,6 @@ ? BeforAtNum( "!", "What is the answer ? 4 ! 5 !" ) // -> "What is the answer ? 4 ! 5 " ? BeforAtNum( "!", "What is the answer ? 4 ! 5 ?" ) // -> "What is the answer ? 4 " - $TESTS$ - BeforAtNum( "..", "..This..is..a..test!" ) == "..This..is..a" - BeforAtNum( "..", "..This..is..a..test!", 2 ) == "..This" - BeforAtNum( "..", "..This..is..a..test!", 2, 2 ) == "..This..is" $STATUS$ Ready $COMPLIANCE$ @@ -152,10 +144,6 @@ ? AtNum( "!", "What is the answer ? 4 ! 5 !" ) // -> 28 ? AtNum( "!", "What is the answer ? 4 ! 5 ?" ) // -> 24 - $TESTS$ - AtNum( "..", "..This..is..a..test!" ) == 14 - AtNum( "..", "..This..is..a..test!", 2 ) == 7 - AtNum( "..", "..This..is..a..test!", 2, 2 ) == 11 $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/atrepl.txt b/harbour/contrib/hbct/doc/en/atrepl.txt index 9003ae7ab8..09e0867f18 100644 --- a/harbour/contrib/hbct/doc/en/atrepl.txt +++ b/harbour/contrib/hbct/doc/en/atrepl.txt @@ -48,11 +48,6 @@ ? AtRepl( "ABC", "ABCDABC", "ZYXW" ) // --> "ZYXWDZYXW" ? AtRepl( "ABC", "ABCDABCDABC", "xx", 2 ) // --> "xxDxxDABC" ? AtRepl( "ABC", "ABCDABCDABC", "xx", 2, .T. ) // --> "ABCDxxDABC" - $TESTS$ - AtRepl( "ABC", "ABCDABCDABC", "xx" ) == "xxDxxDxx" - AtRepl( "ABC", "ABCDABC", "ZYXW" ) == "ZYXWDZYXW" - AtRepl( "ABC", "ABCDABCDABC", "xx", 2 ) == "xxDxxDABC" - AtRepl( "ABC", "ABCDABCDABC", "xx", 2, .T. ) == "ABCDxxDABC" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charevod.txt b/harbour/contrib/hbct/doc/en/charevod.txt index f725f6cef5..45a7bc501e 100644 --- a/harbour/contrib/hbct/doc/en/charevod.txt +++ b/harbour/contrib/hbct/doc/en/charevod.txt @@ -21,10 +21,6 @@ in a given string, collects them and returns them as a string. $EXAMPLES$ ? CharEven( " H E L L O !" ) // -> "HELLO!" - $TESTS$ - CharEven( " 1 2 3 4 5" ) == "12345" - CharEven( " 1 2 3 4 " ) == "1234" - CharEven( " " ) == "" $STATUS$ Ready $COMPLIANCE$ @@ -57,9 +53,6 @@ in a given string, collects them and returns them as a string. $EXAMPLES$ ? CharOdd( "H E L L O ! " ) // -> "HELLO!" - $TESTS$ - CharOdd( "1A2B3C4D5E" ) == "12345" - CharOdd( "1A2B3C4D5" ) == "12345" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charlihb.txt b/harbour/contrib/hbct/doc/en/charlihb.txt index bb99568e8b..45438db8c8 100644 --- a/harbour/contrib/hbct/doc/en/charlihb.txt +++ b/harbour/contrib/hbct/doc/en/charlihb.txt @@ -24,10 +24,6 @@ gives the same result as CharSort(CharList()) $EXAMPLES$ ? CharSList( "Hello World !" ) // --> " !HWdelor" - $TESTS$ - CharSList( "Hello World !" ) == " !HWdelor" - CharSList( "Hello World !" ) == CharSort( CharList( "Hello World !" ) ) - CharSList( NIL ) == "" $STATUS$ Ready $COMPLIANCE$ @@ -64,9 +60,6 @@ of ASCII character #(n-1) in . $EXAMPLES$ ? CharHist( "Hello World !" )[ 109 ] // --> 3 // Chr( 108 ) == "l" - $TESTS$ - CharHist( "Hello World !" )[ 109 ] == 3 - Eval( {|| AEval( CharHist( "Hello World !" ), {| x | nTotal += x } ), nTotal == Len( "Hello World !" ) } $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charlist.txt b/harbour/contrib/hbct/doc/en/charlist.txt index 571dc8e72c..53cb3654f5 100644 --- a/harbour/contrib/hbct/doc/en/charlist.txt +++ b/harbour/contrib/hbct/doc/en/charlist.txt @@ -24,9 +24,6 @@ characters first that are occuring in first. $EXAMPLES$ ? CharList( "Hello World !" ) // --> "Helo Wrd!" - $TESTS$ - CharList( "Hello World !" ) == "Helo Wrd!" - CharList( NIL ) == "" $STATUS$ Ready $COMPLIANCE$ @@ -62,9 +59,6 @@ sorted. $EXAMPLES$ ? CharNoList( CharNoList( "Hello World !" ) ) // --> " !HWdelor" - $TESTS$ - CharNoList( CharNoList( "Hello World !" ) ) == CharSList( "Hello World !" ) - CharNoList( CharNoList( NIL ) ) == "" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charmirr.txt b/harbour/contrib/hbct/doc/en/charmirr.txt index 87ac236fa1..a1103a1d97 100644 --- a/harbour/contrib/hbct/doc/en/charmirr.txt +++ b/harbour/contrib/hbct/doc/en/charmirr.txt @@ -30,10 +30,6 @@ ? CharMirr( "racecar" ) // "racecar" ? CharMirr( "racecar ", .T. ) // "racecar " ? CharMirr( "racecar ", .F. ) // " racecar" - $TESTS$ - CharMirr( "racecar" ) == "racecar" - CharMirr( "racecar ", .T. ) == "racecar " - CharMirr( "racecar ", .F. ) == " racecar" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charmix.txt b/harbour/contrib/hbct/doc/en/charmix.txt index 8be2edcc88..2ea3596b77 100644 --- a/harbour/contrib/hbct/doc/en/charmix.txt +++ b/harbour/contrib/hbct/doc/en/charmix.txt @@ -32,12 +32,6 @@ ? CharMix( "AB", "12345" ) // "A1B2" ? CharMix( "HELLO", " " ) // "H E L L O " ? CharMix( "HELLO", "" ) // "HELLO" - $TESTS$ - CharMix( "ABC", "123" ) == "A1B2C3" - CharMix( "ABCDE", "12" ) == "A1B2C1D2E1" - CharMix( "AB", "12345" ) == "A1B2" - CharMix( "HELLO", " " ) == "H E L L O " - CharMix( "HELLO", "" ) == "HELLO" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charone.txt b/harbour/contrib/hbct/doc/en/charone.txt index bf431ab288..cfc9eaaa69 100644 --- a/harbour/contrib/hbct/doc/en/charone.txt +++ b/harbour/contrib/hbct/doc/en/charone.txt @@ -28,11 +28,6 @@ ? CharOne( "A B CCCD" ) // "A B CD" ? CharOne( " ", "A B A B" ) // "A B A B" ? CharOne( "o", "122oooB12o" ) // "122oB12o" - $TESTS$ - CharOne( "122333a123" ) == "123a123" - CharOne( "A B CCCD" ) == "A B CD" - CharOne( " ", "A B A B" ) == "A B A B" - CharOne( "o", "122oooB12o" ) == "122oB12o" $STATUS$ Ready $COMPLIANCE$ @@ -70,10 +65,6 @@ ? WordOne( "12ABAB12" ) // "12AB12" ? WordOne( "1AAAA2" ) // "1AAAA2" ? WordOne( "12", "1212ABAB" ) // "12ABAB" - $TESTS$ - WordOne( "12ABAB12" ) == "12AB12" - WordOne( "1AAAA2" ) == "1AAAA2" - WordOne( "12", "1212ABAB" ) == "12ABAB" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charonly.txt b/harbour/contrib/hbct/doc/en/charonly.txt index 8164c01516..0648dd976f 100644 --- a/harbour/contrib/hbct/doc/en/charonly.txt +++ b/harbour/contrib/hbct/doc/en/charonly.txt @@ -25,9 +25,6 @@ $EXAMPLES$ ? CharOnly( "0123456789", "0211 - 38 99 77" ) // "0211389977" ? CharOnly( "0123456789", "0211/ 389 977" ) // "0211389977" - $TESTS$ - CharOnly( "0123456789", "0211 - 38 99 77" ) == "0211389977" - CharOnly( "0123456789", "0211/ 389 977" ) == "0211389977" $STATUS$ Ready $COMPLIANCE$ @@ -64,9 +61,6 @@ $EXAMPLES$ ? WordOnly( "AABBCCDD", "XXAAYYBBZZ" ) // "AABB" ? WordOnly( "AABBCCDD", "XAAYYYBBZZ" ) // "BB" - $TESTS$ - WordOnly( "AABBCCDD", "XXAAYYBBZZ" ) == "AABB" - WordOnly( "AABBCCDD", "XAAYYYBBZZ" ) == "BB" $STATUS$ Ready $COMPLIANCE$ @@ -102,9 +96,6 @@ $EXAMPLES$ ? CharRem( " ", " 1 2 " ) // "12" ? CharRem( "3y", "xyz123" ) // "xz12" - $TESTS$ - CharRem( " ", " 1 2 " ) == "12" - CharRem( "3y", "xyz123" ) == "xz12" $STATUS$ Ready $COMPLIANCE$ @@ -141,9 +132,6 @@ $EXAMPLES$ ? WordRem( "abcd", "0ab1cd" ) // "0ab1" ? WordRem( "abcd", "ab0cd1" ) // "0cd1" - $TESTS$ - WordRem( "abcd", "0ab1cd" ) == "0ab1" - WordRem( "abcd", "ab0cd1" ) == "0cd1" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charop.txt b/harbour/contrib/hbct/doc/en/charop.txt index cc28685795..aa8a984e72 100644 --- a/harbour/contrib/hbct/doc/en/charop.txt +++ b/harbour/contrib/hbct/doc/en/charop.txt @@ -31,11 +31,6 @@ ? CharAdd( "012345678", Chr( 1 ) ) // --> "123456789" ? CharAdd( "123456789", Chr( 255 ) ) // --> "012345678" ? CharAdd( "0000", Chr( 0 ) + Chr( 1 ) + Chr( 2 ) + Chr( 3 ) ) // --> "0123" - $TESTS$ - CharAdd( "012345678", Chr( 1 ) ) == "123456789" - CharAdd( "012345678", Chr( 1 ) + Chr( 2 ) ) == "133557799" - CharAdd( "123456789", Chr( 255 ) ) == "012345678" - CharAdd( "123456789", Chr( 255 ) + Chr( 254 ) ) == "002244668" $STATUS$ Ready $COMPLIANCE$ @@ -82,9 +77,6 @@ // clear the LSB ? CharAnd( "012345678", Chr( 254 ) ) // --> "002244668" ? CharAnd( "012345678", Chr( 254 ) + Chr( 252 ) ) // --> "002044648" - $TESTS$ - CharAnd( "012345678", Chr( 254 ) ) == "002244668" - CharAnd( "012345678", Chr( 254 ) + Chr( 252 ) ) == "002044648" $STATUS$ Ready $COMPLIANCE$ @@ -127,9 +119,6 @@ $EXAMPLES$ ? CharNot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) ) // --> Chr( 170 ) + Chr( 127 ) + Chr( 85 ) + Chr( 254 ) ? CharNot( CharNot( "This is a test!" ) ) // --> "This is a test!" - $TESTS$ - CharNot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) ) == Chr( 170 ) + Chr( 127 ) + Chr( 85 ) + Chr( 254 ) - CharNot( CharNot( "This is a test!" ) ) == "This is a test!" $STATUS$ Ready $COMPLIANCE$ @@ -176,9 +165,6 @@ // set the LSB ? CharOr( "012345678", Chr( 1 ) ) // --> "113355779" ? CharOr( "012345678", Chr( 1 ) + Chr( 3 ) ) // --> "133357779" - $TESTS$ - CharOr( "012345678", Chr( 1 ) ) == "113355779" - CharOr( "012345678", Chr( 1 ) + Chr( 3 ) ) == "133357779" $STATUS$ Ready $COMPLIANCE$ @@ -224,8 +210,6 @@ $EXAMPLES$ // easy encryption ? CharXor( "This is top secret !", "My Password" ) // --> - $TESTS$ - CharXor( CharXor( "This is top secret !", "My Password" ), "My Password" ) == "This is top secret !" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charophb.txt b/harbour/contrib/hbct/doc/en/charophb.txt index c6b0b72c37..2b377b28c4 100644 --- a/harbour/contrib/hbct/doc/en/charophb.txt +++ b/harbour/contrib/hbct/doc/en/charophb.txt @@ -31,11 +31,6 @@ ? CharSub( "012345678", Chr( 1 ) ) // --> "/01234567" ? CharSub( "123456789", Chr( 255 ) ) // --> "23456789:" ? CharSub( "9999", Chr( 0 ) + Chr( 1 ) + Chr( 2 ) + Chr( 3 ) ) // --> "9876" - $TESTS$ - CharSub( "123456789", Chr( 1 ) ) == "012345678" - CharSub( "123456789", Chr( 1 ) + Chr( 2 ) ) == "002244668" - CharSub( "012345678", Chr( 255 ) ) == "123456789" - CharSub( "012345678", Chr( 255 ) + Chr( 254 ) ) == "133557799" $STATUS$ Ready $COMPLIANCE$ @@ -81,9 +76,6 @@ ? CharShl( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + ; Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) // --> Chr(8)+Chr(16)+Chr(32)+Chr(64)+Chr(128)+Chr(0)+Chr(0)+Chr(0) - $TESTS$ - CharShl( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + ; - Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) == Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ) + Chr( 0 ) + Chr( 0 ) + Chr( 0 ) $STATUS$ Ready $COMPLIANCE$ @@ -128,8 +120,6 @@ $EXAMPLES$ ? CharShr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) // --> Chr(0)+Chr(0)+Chr(0)+Chr(1)+Chr(2)+Chr(4)+Chr(8)+Chr(16) - $TESTS$ - CharShr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) == Chr( 0 ) + Chr( 0 ) + Chr( 0 ) + Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) $STATUS$ Ready $COMPLIANCE$ @@ -174,8 +164,6 @@ $EXAMPLES$ ? CharRll( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) // --> Chr(8)+Chr(16)+Chr(32)+Chr(64)+Chr(128)+Chr(1)+Chr(2)+Chr(4) - $TESTS$ - CharRll( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) == Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ) + Chr( 1 ) + Chr( 2 ) + Chr( 4 ) $STATUS$ Ready $COMPLIANCE$ @@ -220,8 +208,6 @@ $EXAMPLES$ ? CharRlr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) // --> Chr(32)+Chr(64)+Chr(128)+Chr(1)+Chr(2)+Chr(4)+Chr(8)+Chr(16) - $TESTS$ - CharRlr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) == Chr( 32 ) + Chr( 64 ) + Chr( 128 ) + Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charrepl.txt b/harbour/contrib/hbct/doc/en/charrepl.txt index e889adc8d8..46e1c6920f 100644 --- a/harbour/contrib/hbct/doc/en/charrepl.txt +++ b/harbour/contrib/hbct/doc/en/charrepl.txt @@ -46,12 +46,6 @@ ? CharRepl( "abcdefghij", "jhfdb", "12345" ) // "55542" ? CharRepl( "1234", "1234", "234A" ) // "AAAA" ? CharRepl( "1234", "1234", "234A", .T. ) // "234A" - $TESTS$ - CharRepl( "1234", "1x2y3z", "abcd" ) == "axbycz" - CharRepl( "abcdefghij", "jhfdb", "1234567890" ) == "08642" - CharRepl( "abcdefghij", "jhfdb", "12345" ) == "55542" - CharRepl( "1234", "1234", "234A" ) == "AAAA" - CharRepl( "1234", "1234", "234A", .T. ) == "234A" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charsort.txt b/harbour/contrib/hbct/doc/en/charsort.txt index ca4d1c0f21..395bfff811 100644 --- a/harbour/contrib/hbct/doc/en/charsort.txt +++ b/harbour/contrib/hbct/doc/en/charsort.txt @@ -62,14 +62,6 @@ ? CharSort( "b1a4a3a2a1", 2, 1, 0, 1 ) // "a1b1a2a3a4" ? CharSort( "384172852", 1, 1, 0, 0, 4 ) // "134872852" ? CharSort( "qwert", .T. ) // "wtrqe" - $TESTS$ - CharSort( "qwert" ) == "eqrtw" - CharSort( "qwert", 2 ) == "erqwt" - CharSort( "b1a4a3a2a1", 2, 1 ) == "a2a1a3a4b1" - CharSort( "XXXqwert", 1, 1, 3 ) == "XXXeqrtw" - CharSort( "b1a4a3a2a1", 2, 1, 0, 1 ) == "a1b1a2a3a4" - CharSort( "384172852", 1, 1, 0, 0, 4 ) == "134872852" - CharSort( "qwert", .T. ) == "wtrqe" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/charswap.txt b/harbour/contrib/hbct/doc/en/charswap.txt index f56bba3b03..5c27e7d46e 100644 --- a/harbour/contrib/hbct/doc/en/charswap.txt +++ b/harbour/contrib/hbct/doc/en/charswap.txt @@ -24,9 +24,6 @@ $EXAMPLES$ ? CharSwap( "0123456789" ) // "1032547698" ? CharSwap( "ABCDEFGHIJK" ) // "BADCFEHGJIK" - $TESTS$ - CharSwap( "0123456789" ) == "1032547698" - CharSwap( "ABCDEFGHIJK" ) == "BADCFEHGJIK" $STATUS$ Ready $COMPLIANCE$ @@ -68,9 +65,6 @@ $EXAMPLES$ ? WordSwap( "1234567890" ) // "3412785690" ? WordSwap( "1234567890", .T. ) // "4321876590" - $TESTS$ - WordSwap( "1234567890" ) == "3412785690" - WordSwap( "1234567890", .T. ) == "4321876590" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/ctmath2.txt b/harbour/contrib/hbct/doc/en/ctmath2.txt index 93035ee80f..3ddc99446c 100644 --- a/harbour/contrib/hbct/doc/en/ctmath2.txt +++ b/harbour/contrib/hbct/doc/en/ctmath2.txt @@ -21,9 +21,6 @@ $EXAMPLES$ ? Floor( 1.1 ) // --> 1.0 ? Floor( -1.1 ) // --> -2.0 - $TESTS$ - Floor( 1.1 ) == 1.0 - Floor( -1.1 ) == -2.0 $STATUS$ Ready $COMPLIANCE$ @@ -56,9 +53,6 @@ $EXAMPLES$ ? Ceiling( 1.1 ) // --> 2.0 ? Ceiling( -1.1 ) // --> -1.0 - $TESTS$ - Ceiling( 1.1 ) == 2.0 - Ceiling( -1.1 ) == -1.0 $STATUS$ Ready $COMPLIANCE$ @@ -94,10 +88,6 @@ ? Sign( 1.1 ) // --> 1 ? Sign( -1.1 ) // --> -1 ? Sign( 0.0 ) // --> 0 - $TESTS$ - Sign( 1.1 ) == 1 - Sign( -1.1 ) == -1 - Sign( 0.0 ) == 0 $STATUS$ Ready $COMPLIANCE$ @@ -130,9 +120,6 @@ $EXAMPLES$ ? Log10( 10.0 ) // --> 1.0 ? Log10( Sqrt( 10.0 ) ) // --> 0.5 - $TESTS$ - Log10( 10.0 ) == 1.0 - Log10( Sqrt( 10.0 ) ) == 0.5 $STATUS$ Ready $COMPLIANCE$ @@ -168,10 +155,6 @@ ? Fact( 0 ) // --> 1 ? Fact( 1 ) // --> 1 ? Fact( 4 ) // --> 24 - $TESTS$ - Fact( 0 ) == 1 - Fact( 1 ) == 1 - Fact( 4 ) == 24 $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/ctpad.txt b/harbour/contrib/hbct/doc/en/ctpad.txt index e59808677c..1f34105401 100644 --- a/harbour/contrib/hbct/doc/en/ctpad.txt +++ b/harbour/contrib/hbct/doc/en/ctpad.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/finan.txt b/harbour/contrib/hbct/doc/en/finan.txt index 6aaa749d84..a86affe18b 100644 --- a/harbour/contrib/hbct/doc/en/finan.txt +++ b/harbour/contrib/hbct/doc/en/finan.txt @@ -38,9 +38,6 @@ // of 5 per cent per year ? FV( 1000, 0.05, 10 ) // --> 12577.893 - $TESTS$ - FV( 1000, 0.00, 10 ) == 10000.0 - FV( 1000, 0.05, 10 ) == 12577.893 $STATUS$ Ready $COMPLIANCE$ @@ -89,9 +86,6 @@ // you ? PV( 100, 0.005, 60 ) // --> 5172.56 - $TESTS$ - PV( 100, 0.0, 60 ) == 6000.0 - PV( 100, 0.005, 60 ) == 5172.56 $STATUS$ Ready $COMPLIANCE$ @@ -138,9 +132,6 @@ // For 5 years, you have to pay back every month ? Payment( 5172.56, 0.005, 60 ) // --> 100.00 - $TESTS$ - Payment( 5172.56, 0.0, 60 ) == 86.21 - Payment( 5172.56, 0.005, 60 ) == 100.00 $STATUS$ Ready $COMPLIANCE$ @@ -192,9 +183,6 @@ ? Periods( 5172.56, 100, 0.005 ) // --> 60.0 // months to cancel the loan. - $TESTS$ - Periods( 5172.56, 100, 0.005 ) == 60.0 - Periods( 5172.56, 100, 0.0 ) == 51.7256 $STATUS$ Ready $COMPLIANCE$ @@ -238,9 +226,6 @@ // period (=month) is ? Rate( 5172.56, 100, 60 ) // --> 0.005 - $TESTS$ - Rate( 5172.56, 100, 60.0 ) == 0.005 - Rate( 6000.0, 100, 60.0 ) == 0.0 $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/ftoc.txt b/harbour/contrib/hbct/doc/en/ftoc.txt index b590ed3244..43c09acfcd 100644 --- a/harbour/contrib/hbct/doc/en/ftoc.txt +++ b/harbour/contrib/hbct/doc/en/ftoc.txt @@ -28,8 +28,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -70,8 +68,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/justify.txt b/harbour/contrib/hbct/doc/en/justify.txt index 0aa369499b..88009b0821 100644 --- a/harbour/contrib/hbct/doc/en/justify.txt +++ b/harbour/contrib/hbct/doc/en/justify.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/keyset.txt b/harbour/contrib/hbct/doc/en/keyset.txt index 2dff53525c..83e4cf0c52 100644 --- a/harbour/contrib/hbct/doc/en/keyset.txt +++ b/harbour/contrib/hbct/doc/en/keyset.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -83,8 +79,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -115,8 +109,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/misc1.txt b/harbour/contrib/hbct/doc/en/misc1.txt index e54fefb100..6abe9356a0 100644 --- a/harbour/contrib/hbct/doc/en/misc1.txt +++ b/harbour/contrib/hbct/doc/en/misc1.txt @@ -35,8 +35,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/num1.txt b/harbour/contrib/hbct/doc/en/num1.txt index 159f420c0a..de9a6c93fb 100644 --- a/harbour/contrib/hbct/doc/en/num1.txt +++ b/harbour/contrib/hbct/doc/en/num1.txt @@ -23,9 +23,6 @@ ? Celsius( 32.0 ) // --> 0.0 // boiling point of water in standard conditions ? Celsius( 212.0 ) // --> 100.0 - $TESTS$ - Celsius( 32.0 ) == 0.0 - Celsius( 212.0 ) == 100.0 $STATUS$ Ready $COMPLIANCE$ @@ -60,9 +57,6 @@ ? Fahrenheit( 0.0 ) // --> 32.0 // boiling point of water in standard conditions ? Fahrenheit( 100.0 ) // --> 212.0 - $TESTS$ - Fahrenheit( 0.0 ) == 32.0 - Celsius( 100.0 ) == 212.0 $STATUS$ Ready $COMPLIANCE$ @@ -99,8 +93,6 @@ in the system. For platform independance, this is set to DBL_MAX. $EXAMPLES$ - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/numat.txt b/harbour/contrib/hbct/doc/en/numat.txt index 8d98ef3c91..da8ddd4564 100644 --- a/harbour/contrib/hbct/doc/en/numat.txt +++ b/harbour/contrib/hbct/doc/en/numat.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/numconv.txt b/harbour/contrib/hbct/doc/en/numconv.txt index 5fa87240d2..f918e220e6 100644 --- a/harbour/contrib/hbct/doc/en/numconv.txt +++ b/harbour/contrib/hbct/doc/en/numconv.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -83,8 +79,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -115,8 +109,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/pos1.txt b/harbour/contrib/hbct/doc/en/pos1.txt index ec8b73975a..98980ff8f8 100644 --- a/harbour/contrib/hbct/doc/en/pos1.txt +++ b/harbour/contrib/hbct/doc/en/pos1.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -84,8 +80,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -116,8 +110,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/pos2.txt b/harbour/contrib/hbct/doc/en/pos2.txt index f1f38faf9e..de1a2cd718 100644 --- a/harbour/contrib/hbct/doc/en/pos2.txt +++ b/harbour/contrib/hbct/doc/en/pos2.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -83,8 +79,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -115,8 +109,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/posdiff.txt b/harbour/contrib/hbct/doc/en/posdiff.txt index 093c0f52bd..39093dac65 100644 --- a/harbour/contrib/hbct/doc/en/posdiff.txt +++ b/harbour/contrib/hbct/doc/en/posdiff.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/print.txt b/harbour/contrib/hbct/doc/en/print.txt index 7d41fc9bc2..5288aaef9e 100644 --- a/harbour/contrib/hbct/doc/en/print.txt +++ b/harbour/contrib/hbct/doc/en/print.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/range.txt b/harbour/contrib/hbct/doc/en/range.txt index 8d95db0b1f..13eba47d39 100644 --- a/harbour/contrib/hbct/doc/en/range.txt +++ b/harbour/contrib/hbct/doc/en/range.txt @@ -22,10 +22,6 @@ ? RangeRem( "9", "0", "year2002.dbf" ) // "22", testing removal from "9" to Chr(255) // and from Chr(0) to "0" ? RangeRem( "0", "9", "yearcurr.dbf" ) // "yearcurr.dbf", test leaving string untouched - $TESTS$ - RangeRem( "0", "9", "year2002.dbf" ) == "year.dbf" - RangeRem( "9", "0", "year2002.dbf" ) == "22" - RangeRem( "0", "9", "yearcurr.dbf" ) == "yearcurr.dbf" $STATUS$ Started $COMPLIANCE$ @@ -60,10 +56,6 @@ ? RangeRepl( "9", "0", "year2002.dbf", "?" ) // "????2??2????", testing replacement from "9" to Chr(255) // and from Chr(0) to "0" ? RangeRepl( "0", "9", "yearcurr.dbf", "?" ) // "yearcurr.dbf", test leaving string untouched - $TESTS$ - RangeRepl( "0", "9", "year2002.dbf", "?" ) == "year????.dbf" - RangeRepl( "9", "0", "year2002.dbf", "?" ) == "????2??2????" - RangeRepl( "0", "9", "yearcurr.dbf", "?" ) == "yearcurr.dbf" $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/relation.txt b/harbour/contrib/hbct/doc/en/relation.txt index d0da80ebdf..fe869ffec1 100644 --- a/harbour/contrib/hbct/doc/en/relation.txt +++ b/harbour/contrib/hbct/doc/en/relation.txt @@ -20,8 +20,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -54,8 +52,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/remove.txt b/harbour/contrib/hbct/doc/en/remove.txt index c8f86cd67f..5f3dacb365 100644 --- a/harbour/contrib/hbct/doc/en/remove.txt +++ b/harbour/contrib/hbct/doc/en/remove.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -83,8 +79,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/replace.txt b/harbour/contrib/hbct/doc/en/replace.txt index 43560bc306..29c54a7fae 100644 --- a/harbour/contrib/hbct/doc/en/replace.txt +++ b/harbour/contrib/hbct/doc/en/replace.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -51,8 +49,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -83,8 +79,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/screen1.txt b/harbour/contrib/hbct/doc/en/screen1.txt index 40ee4807a6..6d749bada9 100644 --- a/harbour/contrib/hbct/doc/en/screen1.txt +++ b/harbour/contrib/hbct/doc/en/screen1.txt @@ -29,8 +29,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -61,8 +59,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -96,8 +92,6 @@ attributes. $EXAMPLES$ - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ @@ -128,8 +122,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -181,8 +173,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -224,8 +214,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -269,8 +257,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -305,8 +291,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -341,8 +325,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/strdiff.txt b/harbour/contrib/hbct/doc/en/strdiff.txt index 13b4e3e459..dcad6d50cf 100644 --- a/harbour/contrib/hbct/doc/en/strdiff.txt +++ b/harbour/contrib/hbct/doc/en/strdiff.txt @@ -50,13 +50,6 @@ ? StrDiff( "ABC", "AXBC" ) // 1, one character inserted ? StrDiff( "AXBC", "ABC" ) // 6, one character removed ? StrDiff( "AXBC", "ADC" ) // 9, one character removed and one replaced - $TESTS$ - StrDiff( "ABC", "ADC" ) == 3 - StrDiff( "ABC", "AEC" ) == 3 - StrDiff( "CBA", "ABC" ) == 6 - StrDiff( "ABC", "AXBC" ) == 1 - StrDiff( "AXBC", "ABC" ) == 6 - StrDiff( "AXBC", "ADC" ) == 9 $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/strswap.txt b/harbour/contrib/hbct/doc/en/strswap.txt index d1dc9744c6..4f80c3bd85 100644 --- a/harbour/contrib/hbct/doc/en/strswap.txt +++ b/harbour/contrib/hbct/doc/en/strswap.txt @@ -19,8 +19,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/tab.txt b/harbour/contrib/hbct/doc/en/tab.txt index ace6a602f9..1a930b3778 100644 --- a/harbour/contrib/hbct/doc/en/tab.txt +++ b/harbour/contrib/hbct/doc/en/tab.txt @@ -31,14 +31,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - TabExpand( "-" + Chr( 9 ) + "!" ) == "- !" - TabExpand( "----" + Chr( 9 ) + "!" ) == "---- !" - TabExpand( "-" + Chr( 9 ) + "!", , "+" ) == "-+++++++!" - TabExpand( "-" + Chr( 9 ) + "!", 4 ) == "- !" - TabExpand( "----" + Chr( 9 ) + "!", 8 ) == "---- !" - TabExpand( "----" + Chr( 9 ) + "!", 8, "+" ) == "----++++!" - TabExpand( "-" + Chr( 9 ) + "!" + hb_eol() + "----" + Chr( 9 ) + "!", , "+" ) == "-+++++++!" + hb_eol() + "----++++!" $STATUS$ Started $COMPLIANCE$ @@ -83,8 +75,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/token1.txt b/harbour/contrib/hbct/doc/en/token1.txt index 90c9472533..d1b2a455c9 100644 --- a/harbour/contrib/hbct/doc/en/token1.txt +++ b/harbour/contrib/hbct/doc/en/token1.txt @@ -44,11 +44,6 @@ is within the tokenizer list. $EXAMPLES$ AtToken( "Hello, World!" ) // --> 8 (empty strings after tokenizer are not a token !) - $TESTS$ - AtToken( "Hello, World!" ) == 8 - AtToken( "Hello, World!",, 2 ) == 8 - AtToken( "Hello, World!",, 2, 1 ) == 7 - AtToken( "Hello, World!", " ", 2, 1 ) == 8 $STATUS$ Ready $COMPLIANCE$ @@ -113,11 +108,6 @@ ? Token( "Hello, World!",, 2, 1 ) --> "" ? Token( "Hello, World!", ",", 2, 1 ) --> " World!" ? Token( "Hello, World!", " ", 2, 1 ) --> "World!" - $TESTS$ - Token( "Hello, World!" ) == "World" - Token( "Hello, World!",, 2, 1 ) == "" - Token( "Hello, World!", ",", 2, 1 ) == " World!" - Token( "Hello, World!", " ", 2, 1 ) == "World!" $STATUS$ Ready $COMPLIANCE$ @@ -150,10 +140,6 @@ $EXAMPLES$ - $TESTS$ - NumToken( "Hello, World!" ) == 2 - NumToken( "This is good. See you! How do you do?", ".!?" ) == 3 - NumToken( "one,,three,four,,six", ",", 1 ) == 6 $STATUS$ Ready $COMPLIANCE$ @@ -209,11 +195,6 @@ ? TokenLower( "Hello, World, here I am!",, 3 ) // "hello, world, here I am!" ? TokenLower( "Hello, World, here I am!", ",", 3 ) // "hello, World, here I am!" ? TokenLower( "Hello, World, here I am!", " W" ) // "hello, World, here i am!" - $TESTS$ - TokenLower( "Hello, World, here I am!" ) == "hello, world, here i am!" - TokenLower( "Hello, World, here I am!",, 3 ) == "hello, world, here I am!" - TokenLower( "Hello, World, here I am!", ",", 3 ) == "hello, World, here I am!" - TokenLower( "Hello, World, here I am!", " W" ) == "hello, World, here i am!" $STATUS$ Ready $COMPLIANCE$ @@ -271,11 +252,6 @@ ? TokenUpper( "Hello, world, here I am!",, 3 ) // "Hello, World, Here I am!" ? TokenUpper( "Hello, world, here I am!", ",", 3 ) // "Hello, world, here I am!" ? TokenUpper( "Hello, world, here I am!", " w" ) // "Hello, wOrld, Here I Am!" - $TESTS$ - TokenUpper( "Hello, world, here I am!" ) == "Hello, World, Here I Am!" - TokenUpper( "Hello, world, here I am!",, 3 ) == "Hello, World, Here I am!" - TokenUpper( "Hello, world, here I am!", ",", 3 ) == "Hello, world, here I am!" - TokenUpper( "Hello, world, here I am!", " w" ) == "Hello, wOrld, Here I Am!" $STATUS$ Ready $COMPLIANCE$ @@ -317,8 +293,6 @@ use the new 5th and 6th parameter of the Token() function. $EXAMPLES$ see Token() function - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/token2.txt b/harbour/contrib/hbct/doc/en/token2.txt index f054b64979..b6d81b93d8 100644 --- a/harbour/contrib/hbct/doc/en/token2.txt +++ b/harbour/contrib/hbct/doc/en/token2.txt @@ -70,8 +70,6 @@ // GLOBAL TE since 4th parameter is // not given by reference !!! TokenInit( ,,, @cTE1 ) // set counter in TE stored in cTE1 to 1 - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ @@ -128,8 +126,6 @@ ENDDO ? TokenNext( cString, 3 ) // get the 3rd token, counter will remain the same TokenExit() // free the memory used for the global TE - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ @@ -167,8 +163,6 @@ $EXAMPLES$ TokenInit( "a.b.c.d", ".", 1 ) // initialize global TE ? TokenNum() // --> 4 - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ @@ -210,8 +204,6 @@ DO WHILE ! TokenEnd() ? TokenNext( "a.b.c.d" ) // get all tokens successivly ENDDO - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ @@ -251,8 +243,6 @@ ENDDO ? TokenNext( cString, 3 ) // get the 3rd token, counter will remain the same TokenExit() // free the memory used for the global TE - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ @@ -299,8 +289,6 @@ reference), the information from this token environment is used, otherwise the global TE is used. $EXAMPLES$ - - $TESTS$ TokenInit( cString ) // initialize a TE DO WHILE ! TokenEnd() ? "From", TokenAt(), "to", TokenAt( .T. ) - 1 @@ -343,8 +331,6 @@ token environments. $EXAMPLES$ - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ @@ -378,8 +364,6 @@ TokenInit() call. $EXAMPLES$ - $TESTS$ - $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/trig.txt b/harbour/contrib/hbct/doc/en/trig.txt index c4ce486376..e524dd8d6b 100644 --- a/harbour/contrib/hbct/doc/en/trig.txt +++ b/harbour/contrib/hbct/doc/en/trig.txt @@ -59,11 +59,6 @@ $EXAMPLES$ ? Sin( 0.0 ) // --> 0.0 ? Sin( 1.0 ) // --> 0.8414... - $TESTS$ - Sin( 0.0 ) == 0.0 - Sin( Pi() / 4 ) == Sqrt( 1 / 2 ) - Sin( Pi() / 2 ) == 1.0 - Sin( Pi() ) == 0.0 $STATUS$ Ready $COMPLIANCE$ @@ -99,11 +94,6 @@ $EXAMPLES$ ? Cos( 0.0 ) // --> 1.0 ? Cos( 1.0 ) // --> 0.5403... - $TESTS$ - Cos( 0.0 ) == 1.0 - Cos( Pi() / 4 ) == Sqrt( 1 / 2 ) - Cos( Pi() / 2 ) == 0.0 - Cos( Pi() ) == -1.0 $STATUS$ Ready $COMPLIANCE$ @@ -140,10 +130,6 @@ $EXAMPLES$ ? Tan( 0.0 ) // --> 0.0 ? Tan( 1.0 ) // --> 1.5574... - $TESTS$ - Tan( 0.0 ) == 0.0 - Tan( Pi() / 4 ) == 1 - Tan( Pi() ) == 0.0 $STATUS$ Ready $COMPLIANCE$ @@ -179,9 +165,6 @@ Cot(x) = Cos(x)/Sin(x)=1/Tan(x). $EXAMPLES$ ? Cot( 1.0 ) // --> 0.6420... - $TESTS$ - Cot( Pi() / 4 ) == 1 - Cot( Pi() / 2 ) == 0 $STATUS$ Ready $COMPLIANCE$ @@ -218,11 +201,6 @@ $EXAMPLES$ ? Asin( 0.0 ) // --> 0.0 ? Asin( 0.5 ) // --> 0.5235... - $TESTS$ - Asin( 0.0 ) == 0.0 - Asin( Sqrt( 1 / 2 ) ) == Pi() / 4 - Asin( 1.0 ) == Pi() / 2 - Asin( 0.0 ) == 0.0 // and not Pi(), since the smallest angle is returned ! $STATUS$ Ready $COMPLIANCE$ @@ -259,12 +237,6 @@ $EXAMPLES$ ? Acos( 0.0 ) // --> Pi() / 2 ? Acos( 0.5 ) // --> 1.04719... - $TESTS$ - Acos( 0.0 ) == Pi() / 2 - Acos( Sqrt( 1 / 2 ) ) == Pi() / 4 - Acos( 1.0 ) == 0.0 - Acos( -1.0 ) == Pi() - Acos( 0.0 ) == Pi() / 2 // and not -Pi()/2, although cos (-Pi()/2) == 0.0 ! $STATUS$ Ready $COMPLIANCE$ @@ -299,10 +271,6 @@ $EXAMPLES$ ? Atan( 0.0 ) // --> 0.0 ? Atan( 0.5 ) // --> 0.4636... - $TESTS$ - Atan( 0.0 ) == 0.0 - Atan( 1.0 ) == Pi() / 4 - Atan( 0.0 ) == 0.0 // and not Pi(), although Tan( Pi() ) == 0.0 ! $STATUS$ Ready $COMPLIANCE$ @@ -344,10 +312,6 @@ $EXAMPLES$ ? Atn2( 0.0, 1.0 ) // --> 0.0 ? Atn2( Sqrt( 1 / 2 ), Sqrt( 1 / 2 ) ) // --> Pi() / 4 - $TESTS$ - Atn2( 0.0, 1.0 ) == 0.0 - Atn2( Sqrt( 1 / 2 ), Sqrt( 1 / 2 ) ) == Pi() / 4 - Atn2( -Sqrt( 1 / 2 ), -Sqrt( 1 / 2 ) ) == -3 / 4 * Pi() // Atan() would return Pi() / 4 ! $STATUS$ Ready $COMPLIANCE$ @@ -384,9 +348,6 @@ $EXAMPLES$ ? Sinh( 0.0 ) // --> 0.0 ? Sinh( 1.0 ) // --> 1.1752... - $TESTS$ - Sinh( 0.0 ) == 0.0 - Sinh( -0.5 ) == -Sinh( 0.5 ) $STATUS$ Ready $COMPLIANCE$ @@ -423,9 +384,6 @@ $EXAMPLES$ ? Cosh( 0.0 ) // --> 1.0 ? Cosh( 1.0 ) // --> 1.5430... - $TESTS$ - Cosh( 0.0 ) == 1.0 - Cosh( -0.5 ) == Cosh( 0.5 ) $STATUS$ Ready $COMPLIANCE$ @@ -458,9 +416,6 @@ $EXAMPLES$ ? Tanh( 0.0 ) // --> 0.0 ? Tanh( 1.0 ) // --> 0.7615... - $TESTS$ - Tanh( 0.0 ) == 0.0 - Tanh( -0.5 ) == -Tanh( 0.5 ) $STATUS$ Ready $COMPLIANCE$ @@ -494,9 +449,6 @@ $EXAMPLES$ ? RToD( Pi() ) // --> 180 ? Tanh( Pi() / 3 ) // --> 60 - $TESTS$ - RToD( 0.0 ) == 0.0 - RToD( Pi() ) == 180.0 $STATUS$ Ready $COMPLIANCE$ @@ -529,9 +481,6 @@ $EXAMPLES$ ? DToR( 180 ) // --> Pi() ? DToR( 60 ) // --> Pi() / 3 - $TESTS$ - DToR( 0.0 ) == 0.0 - DToR( 180.0 ) == Pi() $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/video.txt b/harbour/contrib/hbct/doc/en/video.txt index 2907424bf3..3875705bcd 100644 --- a/harbour/contrib/hbct/doc/en/video.txt +++ b/harbour/contrib/hbct/doc/en/video.txt @@ -19,8 +19,6 @@ Returns the number of scan lines per character. $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -59,8 +57,6 @@ $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -91,8 +87,6 @@ TODO: Finish documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ @@ -129,8 +123,6 @@ TODO: Finish documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/wordrepl.txt b/harbour/contrib/hbct/doc/en/wordrepl.txt index 691c36fc80..60634d32bd 100644 --- a/harbour/contrib/hbct/doc/en/wordrepl.txt +++ b/harbour/contrib/hbct/doc/en/wordrepl.txt @@ -47,12 +47,6 @@ CSetAtMupa( .T. ) ? WordRepl( "aa", "1aaaa", "ba" ) // "1abaa" ? WordRepl( "aa", "1aaaa", "ba", .T. ) // "1bbba" - $TESTS$ - WordRepl( "CC", "AABBCCDDEE", "XX" ) == "AABBXXDDEE" - WordRepl( "aa", "1aaaa", "ba" ) == "1abaa" - WordRepl( "aa", "1aaaa", "ba", .T. ) == "1baba" - Eval( {|| CSetAtMupa( .T. ), WordRepl( "aa", "1aaaa", "ba" ) } ) == "1abaa" - Eval( {|| CSetAtMupa( .T. ), WordRepl( "aa", "1aaaa", "ba", .T. ) } ) == "1bbba" $STATUS$ Ready $COMPLIANCE$ diff --git a/harbour/contrib/hbct/doc/en/wordtoch.txt b/harbour/contrib/hbct/doc/en/wordtoch.txt index 437edff642..c39a67a54e 100644 --- a/harbour/contrib/hbct/doc/en/wordtoch.txt +++ b/harbour/contrib/hbct/doc/en/wordtoch.txt @@ -20,8 +20,6 @@ TODO: add documentation $EXAMPLES$ - $TESTS$ - $STATUS$ Started $COMPLIANCE$ diff --git a/harbour/contrib/hbct/tests/test.prg b/harbour/contrib/hbct/tests/test.prg new file mode 100644 index 0000000000..b7a188b933 --- /dev/null +++ b/harbour/contrib/hbct/tests/test.prg @@ -0,0 +1,268 @@ +/* + * $Id$ + */ + +#require "hbct" + +#include "hbtest.ch" + +PROCEDURE Main() + + LOCAL nTotal + + HBTEST AddAscii( "0000", 1, 1 ) IS "1000" + HBTEST AddAscii( "0000", 1 ) IS "0001" + HBTEST AddAscii( "AAAA", -255, 1 ) IS "BAAA" + HBTEST AddAscii( "AAAA", -255 ) IS "AAAB" + HBTEST AddAscii( "AAAA", 1, 2, .T. ) IS "ABAA" + HBTEST AddAscii( "AAAA", 257, 2, .T. ) IS "BBAA" + HBTEST AddAscii( "AAAA", 257, 2, .F. ) IS "ABAA" + HBTEST AddAscii( "AAAA", 258,, .T. ) IS "AABC" + HBTEST AddAscii( "ABBA", -257, 3, .T. ) IS "AAAA" + + HBTEST AsciiSum( Replicate( "A", 10000 ) ) IS 650000 + HBTEST AsciiSum( "0123456789" ) IS 525 + HBTEST AsciiSum( NIL ) IS 0 + + HBTEST AscPos( "0123456789" ) IS 57 + HBTEST AscPos( "0123456789", 1 ) IS 48 + HBTEST AscPos( "0123456789", 11 ) IS 0 // to large ! + + HBTEST ValPos( "1234x56789" ) IS 9 + HBTEST ValPos( "1234x56789", 1 ) IS 1 + HBTEST ValPos( "1234x56789", 11 ) IS 0 // to large ! + HBTEST ValPos( "1234x56789", 5 ) IS 0 // "x" is not a digit ! + + HBTEST AfterAtNum( "..", "..This..is..a..test!" ) IS "test!" + HBTEST AfterAtNum( "..", "..This..is..a..test!", 2 ) IS "is..a..test!" + HBTEST AfterAtNum( "..", "..This..is..a..test!", 2, 2 ) IS "a..test!" + HBTEST BeforAtNum( "..", "..This..is..a..test!" ) IS "..This..is..a" + HBTEST BeforAtNum( "..", "..This..is..a..test!", 2 ) IS "..This" + HBTEST BeforAtNum( "..", "..This..is..a..test!", 2, 2 ) IS "..This..is" + + HBTEST AtNum( "..", "..This..is..a..test!" ) IS 14 + HBTEST AtNum( "..", "..This..is..a..test!", 2 ) IS 7 + HBTEST AtNum( "..", "..This..is..a..test!", 2, 2 ) IS 11 + + HBTEST AtRepl( "ABC", "ABCDABCDABC", "xx" ) IS "xxDxxDxx" + HBTEST AtRepl( "ABC", "ABCDABC", "ZYXW" ) IS "ZYXWDZYXW" + HBTEST AtRepl( "ABC", "ABCDABCDABC", "xx", 2 ) IS "xxDxxDABC" + HBTEST AtRepl( "ABC", "ABCDABCDABC", "xx", 2, .T. ) IS "ABCDxxDABC" + + HBTEST CharEven( " 1 2 3 4 5" ) IS "12345" + HBTEST CharEven( " 1 2 3 4 " ) IS "1234" + HBTEST CharEven( " " ) IS "" + + HBTEST CharOdd( "1A2B3C4D5E" ) IS "12345" + HBTEST CharOdd( "1A2B3C4D5" ) IS "12345" + + HBTEST CharSList( "Hello World !" ) IS " !HWdelor" + HBTEST CharSList( "Hello World !" ) IS CharSort( CharList( "Hello World !" ) ) + HBTEST CharSList( NIL ) IS "" + + HBTEST CharHist( "Hello World !" )[ 109 ] IS 3 + HBTEST ( nTotal := 0, AEval( CharHist( "Hello World !" ), {| x | nTotal += x } ), nTotal ) IS Len( "Hello World !" ) + + HBTEST CharList( "Hello World !" ) IS "Helo Wrd!" + HBTEST CharList( NIL ) IS "" + + HBTEST CharNoList( CharNoList( "Hello World !" ) ) IS CharSList( "Hello World !" ) + HBTEST CharNoList( CharNoList( NIL ) ) IS "" + + HBTEST CharMirr( "racecar" ) IS "racecar" + HBTEST CharMirr( "racecar ", .T. ) IS "racecar " + HBTEST CharMirr( "racecar ", .F. ) IS " racecar" + + HBTEST CharMix( "ABC", "123" ) IS "A1B2C3" + HBTEST CharMix( "ABCDE", "12" ) IS "A1B2C1D2E1" + HBTEST CharMix( "AB", "12345" ) IS "A1B2" + HBTEST CharMix( "HELLO", " " ) IS "H E L L O " + HBTEST CharMix( "HELLO", "" ) IS "HELLO" + + HBTEST CharOne( "122333a123" ) IS "123a123" + HBTEST CharOne( "A B CCCD" ) IS "A B CD" + HBTEST CharOne( " ", "A B A B" ) IS "A B A B" + HBTEST CharOne( "o", "122oooB12o" ) IS "122oB12o" + + HBTEST WordOne( "12ABAB12" ) IS "12AB12" + HBTEST WordOne( "1AAAA2" ) IS "1AAAA2" + HBTEST WordOne( "12", "1212ABAB" ) IS "12ABAB" + + HBTEST CharOnly( "0123456789", "0211 - 38 99 77" ) IS "0211389977" + HBTEST CharOnly( "0123456789", "0211/ 389 977" ) IS "0211389977" + + HBTEST WordOnly( "AABBCCDD", "XXAAYYBBZZ" ) IS "AABB" + HBTEST WordOnly( "AABBCCDD", "XAAYYYBBZZ" ) IS "BB" + + HBTEST CharRem( " ", " 1 2 " ) IS "12" + HBTEST CharRem( "3y", "xyz123" ) IS "xz12" + + HBTEST WordRem( "abcd", "0ab1cd" ) IS "0ab1" + HBTEST WordRem( "abcd", "ab0cd1" ) IS "0cd1" + + HBTEST CharAdd( "012345678", Chr( 1 ) ) IS "123456789" + HBTEST CharAdd( "012345678", Chr( 1 ) + Chr( 2 ) ) IS "133557799" + HBTEST CharAdd( "123456789", Chr( 255 ) ) IS "012345678" + HBTEST CharAdd( "123456789", Chr( 255 ) + Chr( 254 ) ) IS "002244668" + HBTEST CharAnd( "012345678", Chr( 254 ) ) IS "002244668" + HBTEST CharAnd( "012345678", Chr( 254 ) + Chr( 252 ) ) IS "002044648" + + HBTEST CharNot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) ) IS Chr( 170 ) + Chr( 127 ) + Chr( 85 ) + Chr( 254 ) + HBTEST CharNot( CharNot( "This is a test!" ) ) IS "This is a test!" + + HBTEST CharOr( "012345678", Chr( 1 ) ) IS "113355779" + HBTEST CharOr( "012345678", Chr( 1 ) + Chr( 3 ) ) IS "133357779" + + HBTEST CharXor( CharXor( "This is top secret !", "My Password" ), "My Password" ) IS "This is top secret !" + + HBTEST CharSub( "123456789", Chr( 1 ) ) IS "012345678" + HBTEST CharSub( "123456789", Chr( 1 ) + Chr( 2 ) ) IS "002244668" + HBTEST CharSub( "012345678", Chr( 255 ) ) IS "123456789" + HBTEST CharSub( "012345678", Chr( 255 ) + Chr( 254 ) ) IS "133557799" + + HBTEST CharShl( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) IS Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ) + Chr( 0 ) + Chr( 0 ) + Chr( 0 ) + HBTEST CharShr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) IS Chr( 0 ) + Chr( 0 ) + Chr( 0 ) + Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + HBTEST CharRll( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) IS Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ) + Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + HBTEST CharRlr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 ) IS Chr( 32 ) + Chr( 64 ) + Chr( 128 ) + Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + + HBTEST CharRepl( "1234", "1x2y3z", "abcd" ) IS "axbycz" + HBTEST CharRepl( "abcdefghij", "jhfdb", "1234567890" ) IS "08642" + HBTEST CharRepl( "abcdefghij", "jhfdb", "12345" ) IS "55542" + HBTEST CharRepl( "1234", "1234", "234A" ) IS "AAAA" + HBTEST CharRepl( "1234", "1234", "234A", .T. ) IS "234A" + + HBTEST CharSort( "qwert" ) IS "eqrtw" + HBTEST CharSort( "qwert", 2 ) IS "erqwt" + HBTEST CharSort( "b1a4a3a2a1", 2, 1 ) IS "a2a1a3a4b1" + HBTEST CharSort( "XXXqwert", 1, 1, 3 ) IS "XXXeqrtw" + HBTEST CharSort( "b1a4a3a2a1", 2, 1, 0, 1 ) IS "a1b1a2a3a4" + HBTEST CharSort( "384172852", 1, 1, 0, 0, 4 ) IS "134872852" + HBTEST CharSort( "qwert", .T. ) IS "wtrqe" + + HBTEST CharSwap( "0123456789" ) IS "1032547698" + HBTEST CharSwap( "ABCDEFGHIJK" ) IS "BADCFEHGJIK" + + HBTEST WordSwap( "1234567890" ) IS "3412785690" + HBTEST WordSwap( "1234567890", .T. ) IS "4321876590" + + HBTEST Floor( 1.1 ) IS 1.0 + HBTEST Floor( -1.1 ) IS -2.0 + HBTEST Ceiling( 1.1 ) IS 2.0 + HBTEST Ceiling( -1.1 ) IS -1.0 + HBTEST Sign( 1.1 ) IS 1 + HBTEST Sign( -1.1 ) IS -1 + HBTEST Sign( 0.0 ) IS 0 + HBTEST Log10( 10.0 ) IS 1.0 + HBTEST Log10( Sqrt( 10.0 ) ) IS 0.5 + HBTEST Fact( 0 ) IS 1 + HBTEST Fact( 1 ) IS 1 + HBTEST Fact( 4 ) IS 24 + HBTEST Round( FV( 1000, 0.00, 10 ), 1 ) IS 10000.0 + HBTEST Round( FV( 1000, 0.05, 10 ), 3 ) IS 12577.893 + HBTEST Round( PV( 100, 0.0, 60 ), 1 ) IS 6000.0 + HBTEST Round( PV( 100, 0.005, 60 ), 2 ) IS 5172.56 + HBTEST Round( Payment( 5172.56, 0.0, 60 ), 2 ) IS 86.21 + HBTEST Round( Payment( 5172.56, 0.005, 60 ), 2 ) IS 100.00 + HBTEST Round( Periods( 5172.56, 100, 0.005 ), 1 ) IS 60.0 + HBTEST Round( Periods( 5172.56, 100, 0.0 ), 4 ) IS 51.7256 + HBTEST Round( Rate( 5172.56, 100, 60.0 ), 3 ) IS 0.005 + HBTEST Round( Rate( 6000.0, 100, 60.0 ), 1 ) IS 0.0 + + HBTEST Round( Celsius( 32.0 ), 1 ) IS 0.0 + HBTEST Round( Celsius( 212.0 ), 1 ) IS 100.0 + HBTEST Round( Fahrenheit( 0.0 ), 1 ) IS 32.0 + HBTEST Round( Celsius( 100.0 ), 1 ) IS 212.0 + + HBTEST RangeRem( "0", "9", "year2002.dbf" ) IS "year.dbf" + HBTEST RangeRem( "9", "0", "year2002.dbf" ) IS "22" + HBTEST RangeRem( "0", "9", "yearcurr.dbf" ) IS "yearcurr.dbf" + + HBTEST RangeRepl( "0", "9", "year2002.dbf", "?" ) IS "year????.dbf" + HBTEST RangeRepl( "9", "0", "year2002.dbf", "?" ) IS "????2??2????" + HBTEST RangeRepl( "0", "9", "yearcurr.dbf", "?" ) IS "yearcurr.dbf" + + HBTEST StrDiff( "ABC", "ADC" ) IS 3 + HBTEST StrDiff( "ABC", "AEC" ) IS 3 + HBTEST StrDiff( "CBA", "ABC" ) IS 6 + HBTEST StrDiff( "ABC", "AXBC" ) IS 1 + HBTEST StrDiff( "AXBC", "ABC" ) IS 6 + HBTEST StrDiff( "AXBC", "ADC" ) IS 9 + + HBTEST TabExpand( "-" + Chr( 9 ) + "!" ) IS "- !" + HBTEST TabExpand( "----" + Chr( 9 ) + "!" ) IS "---- !" + HBTEST TabExpand( "-" + Chr( 9 ) + "!", , "+" ) IS "-+++++++!" + HBTEST TabExpand( "-" + Chr( 9 ) + "!", 4 ) IS "- !" + HBTEST TabExpand( "----" + Chr( 9 ) + "!", 8 ) IS "---- !" + HBTEST TabExpand( "----" + Chr( 9 ) + "!", 8, "+" ) IS "----++++!" + HBTEST TabExpand( "-" + Chr( 9 ) + "!" + hb_eol() + "----" + Chr( 9 ) + "!", , "+" ) IS "-+++++++!" + hb_eol() + "----++++!" + + HBTEST AtToken( "Hello, World!" ) IS 8 + HBTEST AtToken( "Hello, World!",, 2 ) IS 8 + HBTEST AtToken( "Hello, World!",, 2, 1 ) IS 7 + HBTEST AtToken( "Hello, World!", " ", 2, 1 ) IS 8 + + HBTEST Token( "Hello, World!" ) IS "World" + HBTEST Token( "Hello, World!",, 2, 1 ) IS "" + HBTEST Token( "Hello, World!", ",", 2, 1 ) IS " World!" + HBTEST Token( "Hello, World!", " ", 2, 1 ) IS "World!" + + HBTEST NumToken( "Hello, World!" ) IS 2 + HBTEST NumToken( "This is good. See you! How do you do?", ".!?" ) IS 3 + HBTEST NumToken( "one,,three,four,,six", ",", 1 ) IS 6 + + HBTEST TokenLower( "Hello, World, here I am!" ) IS "hello, world, here i am!" + HBTEST TokenLower( "Hello, World, here I am!",, 3 ) IS "hello, world, here I am!" + HBTEST TokenLower( "Hello, World, here I am!", ",", 3 ) IS "hello, World, here I am!" + HBTEST TokenLower( "Hello, World, here I am!", " W" ) IS "hello, World, here i am!" + HBTEST TokenUpper( "Hello, world, here I am!" ) IS "Hello, World, Here I Am!" + HBTEST TokenUpper( "Hello, world, here I am!",, 3 ) IS "Hello, World, Here I am!" + HBTEST TokenUpper( "Hello, world, here I am!", ",", 3 ) IS "Hello, world, here I am!" + HBTEST TokenUpper( "Hello, world, here I am!", " w" ) IS "Hello, wOrld, Here I Am!" + + HBTEST Sin( 0.0 ) IS 0.0 + HBTEST Round( Sin( Pi() / 4 ), 4 ) IS Round( Sqrt( 1 / 2 ), 4 ) + HBTEST Sin( Pi() / 2 ) IS 1.0 + HBTEST Round( Sin( Pi() ), 1 ) IS 0.0 + HBTEST Cos( 0.0 ) IS 1.0 + HBTEST Round( Cos( Pi() / 4 ), 4 ) IS Round( Sqrt( 1 / 2 ), 4 ) + HBTEST Round( Cos( Pi() / 2 ), 1 ) IS 0.0 + HBTEST Cos( Pi() ) IS -1.0 + HBTEST Tan( 0.0 ) IS 0.0 + HBTEST Round( Tan( Pi() / 4 ), 0 ) IS 1 + HBTEST Round( Tan( Pi() ), 1 ) IS 0.0 + HBTEST Cot( Pi() / 4 ) IS 1 + HBTEST Round( Cot( Pi() / 2 ), 0 ) IS 0 + HBTEST Asin( 0.0 ) IS 0.0 + HBTEST Round( Asin( Sqrt( 1 / 2 ) ), 4 ) IS Round( Pi() / 4, 4 ) + HBTEST Asin( 1.0 ) IS Pi() / 2 + HBTEST Asin( 0.0 ) IS 0.0 // and not Pi(), since the smallest angle is returned ! + HBTEST Acos( 0.0 ) IS Pi() / 2 + HBTEST Acos( Sqrt( 1 / 2 ) ) IS Pi() / 4 + HBTEST Acos( 1.0 ) IS 0.0 + HBTEST Acos( -1.0 ) IS Pi() + HBTEST Acos( 0.0 ) IS Pi() / 2 // and not -Pi()/2, although cos (-Pi()/2) IS 0.0 ! + HBTEST Atan( 0.0 ) IS 0.0 + HBTEST Atan( 1.0 ) IS Pi() / 4 + HBTEST Atan( 0.0 ) IS 0.0 // and not Pi(), although Tan( Pi() ) IS 0.0 ! + HBTEST Atn2( 0.0, 1.0 ) IS 0.0 + HBTEST Atn2( Sqrt( 1 / 2 ), Sqrt( 1 / 2 ) ) IS Pi() / 4 + HBTEST Atn2( -Sqrt( 1 / 2 ), -Sqrt( 1 / 2 ) ) IS -3 / 4 * Pi() // Atan() would return Pi() / 4 ! + HBTEST Sinh( 0.0 ) IS 0.0 + HBTEST Sinh( -0.5 ) IS -Sinh( 0.5 ) + HBTEST Cosh( 0.0 ) IS 1.0 + HBTEST Cosh( -0.5 ) IS Cosh( 0.5 ) + HBTEST Tanh( 0.0 ) IS 0.0 + HBTEST Tanh( -0.5 ) IS -Tanh( 0.5 ) + HBTEST RToD( 0.0 ) IS 0.0 + HBTEST RToD( Pi() ) IS 180.0 + HBTEST DToR( 0.0 ) IS 0.0 + HBTEST DToR( 180.0 ) IS Pi() + + HBTEST WordRepl( "CC", "AABBCCDDEE", "XX" ) IS "AABBXXDDEE" + HBTEST WordRepl( "aa", "1aaaa", "ba" ) IS "1abaa" + HBTEST WordRepl( "aa", "1aaaa", "ba", .T. ) IS "1baba" + + HBTEST ( CSetAtMupa( .T. ), WordRepl( "aa", "1aaaa", "ba" ) ) IS "1abaa" + HBTEST ( CSetAtMupa( .T. ), WordRepl( "aa", "1aaaa", "ba", .T. ) ) IS "1bbba" + + RETURN diff --git a/harbour/include/harbour.hbx b/harbour/include/harbour.hbx index 61d8985e95..c58ff9fa1b 100644 --- a/harbour/include/harbour.hbx +++ b/harbour/include/harbour.hbx @@ -1387,8 +1387,9 @@ DYNAMIC __hbdoc_LoadDir DYNAMIC __hbdoc_LoadHBD DYNAMIC __hbdoc_SaveHBD DYNAMIC __hbdoc_ToSource -DYNAMIC __hbtest_Setup DYNAMIC __hbtest_Call +DYNAMIC __hbtest_NumGetDec +DYNAMIC __hbtest_Setup DYNAMIC __HBHash DYNAMIC __HBLogical DYNAMIC __HBNil diff --git a/harbour/src/rtl/Makefile b/harbour/src/rtl/Makefile index 41529d3c6d..b8615c1f9e 100644 --- a/harbour/src/rtl/Makefile +++ b/harbour/src/rtl/Makefile @@ -115,6 +115,7 @@ C_SOURCES := \ hbsockhb.c \ hbstrfmt.c \ hbstrsh.c \ + hbtestc.c \ hbtoken.c \ hbzlib.c \ hbzlibgz.c \ diff --git a/harbour/src/rtl/hbtest.prg b/harbour/src/rtl/hbtest.prg index bfa1362481..9deabe4cb3 100644 --- a/harbour/src/rtl/hbtest.prg +++ b/harbour/src/rtl/hbtest.prg @@ -100,7 +100,7 @@ PROCEDURE __hbtest_Call( cBlock, bBlock, xResultExpected ) ErrorBlock( bOldError ) IF !( ValType( xResult ) == ValType( xResultExpected ) ) - IF ValType( xResultExpected ) == "C" .AND. ValType( xResult ) $ "ABMO" + IF HB_ISSTRING( xResultExpected ) .AND. ValType( xResult ) $ "ABOHPS" lFailed := !( XToStr( xResult ) == xResultExpected ) ELSE lFailed := .T. diff --git a/harbour/src/rtl/hbtestc.c b/harbour/src/rtl/hbtestc.c new file mode 100644 index 0000000000..bac824e23c --- /dev/null +++ b/harbour/src/rtl/hbtestc.c @@ -0,0 +1,62 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Regression tests for the runtime library (main) + * + * Copyright 2012 Viktor Szakats (harbour syenar.net) + * www - http://harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#include "hbapiitm.h" + +HB_FUNC( __HBTEST_NUMGETDEC ) +{ + int iDec; + + hb_itemGetNDDec( hb_param( 1, HB_IT_NUMERIC ), &iDec ); + + hb_retni( iDec ); +}