From 862fa6e6e54d30df944d973d95e53325e1a1d4c8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 15 Feb 2009 21:26:57 +0000 Subject: [PATCH] 2009-02-16 22:28 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + contrib/gtwvg/tests/gtwvg.hbp + contrib/hbapollo/tests/hbapollo.hbp + contrib/hbbtree/tests/hbbtree.hbp + contrib/hbbtree/tests/test.hbm + Added hbmk files. * contrib/hbbtree/tests/hbmk.bat * contrib/hbbtree/tests/test.prg * Cleaned hbct dependency. * contrib/hbbtree/Makefile * contrib/hbbtree/common.mak - contrib/hbbtree/hb_btree.api + contrib/hbbtree/hb_btree.h * contrib/hbbtree/hb_btree.c * contrib/hbbtree/tests/ctest.c * Renamed hb_btree.api -> hb_btree.h * contrib/examples/terminal/terminal.hbp + Added {win} filter. --- harbour/ChangeLog | 22 ++++++++++++++++ .../contrib/examples/terminal/terminal.hbp | 2 +- harbour/contrib/gtwvg/tests/gtwvg.hbp | 6 +++++ harbour/contrib/hbapollo/tests/hbapollo.hbp | 5 ++++ harbour/contrib/hbbtree/Makefile | 2 +- harbour/contrib/hbbtree/common.mak | 2 +- harbour/contrib/hbbtree/hb_btree.c | 2 +- .../hbbtree/{hb_btree.api => hb_btree.h} | 0 harbour/contrib/hbbtree/tests/ctest.c | 26 +++++++++---------- harbour/contrib/hbbtree/tests/hbbtree.hbp | 5 ++++ harbour/contrib/hbbtree/tests/hbmk.bat | 2 +- harbour/contrib/hbbtree/tests/test.hbm | 5 ++++ harbour/contrib/hbbtree/tests/test.prg | 6 +++-- 13 files changed, 65 insertions(+), 20 deletions(-) create mode 100644 harbour/contrib/gtwvg/tests/gtwvg.hbp create mode 100644 harbour/contrib/hbapollo/tests/hbapollo.hbp rename harbour/contrib/hbbtree/{hb_btree.api => hb_btree.h} (100%) create mode 100644 harbour/contrib/hbbtree/tests/hbbtree.hbp create mode 100644 harbour/contrib/hbbtree/tests/test.hbm diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3996e4334b..9cf375d746 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,28 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-16 22:28 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + + contrib/gtwvg/tests/gtwvg.hbp + + contrib/hbapollo/tests/hbapollo.hbp + + contrib/hbbtree/tests/hbbtree.hbp + + contrib/hbbtree/tests/test.hbm + + Added hbmk files. + + * contrib/hbbtree/tests/hbmk.bat + * contrib/hbbtree/tests/test.prg + * Cleaned hbct dependency. + + * contrib/hbbtree/Makefile + * contrib/hbbtree/common.mak + - contrib/hbbtree/hb_btree.api + + contrib/hbbtree/hb_btree.h + * contrib/hbbtree/hb_btree.c + * contrib/hbbtree/tests/ctest.c + * Renamed hb_btree.api -> hb_btree.h + + * contrib/examples/terminal/terminal.hbp + + Added {win} filter. + 2009-02-16 20:54 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk/hbmk.prg + Added support for '#' comment lines in .hbm files. diff --git a/harbour/contrib/examples/terminal/terminal.hbp b/harbour/contrib/examples/terminal/terminal.hbp index 5ec70f04ad..262e9a8d83 100644 --- a/harbour/contrib/examples/terminal/terminal.hbp +++ b/harbour/contrib/examples/terminal/terminal.hbp @@ -2,6 +2,6 @@ # $Id$ # -libs=gtwvg hbwin xhb comdlg32 comctl32 shell32 ole32 oleaut32 +{win}libs=gtwvg hbwin xhb comdlg32 comctl32 shell32 ole32 oleaut32 mt=yes gui=yes diff --git a/harbour/contrib/gtwvg/tests/gtwvg.hbp b/harbour/contrib/gtwvg/tests/gtwvg.hbp new file mode 100644 index 0000000000..1a6c212779 --- /dev/null +++ b/harbour/contrib/gtwvg/tests/gtwvg.hbp @@ -0,0 +1,6 @@ +# +# $Id$ +# + +{win}libs=gtwvg hbwin +gui=yes diff --git a/harbour/contrib/hbapollo/tests/hbapollo.hbp b/harbour/contrib/hbapollo/tests/hbapollo.hbp new file mode 100644 index 0000000000..73d7178aa6 --- /dev/null +++ b/harbour/contrib/hbapollo/tests/hbapollo.hbp @@ -0,0 +1,5 @@ +# +# $Id$ +# + +libs={!dos}hbapollo {win}sde61 diff --git a/harbour/contrib/hbbtree/Makefile b/harbour/contrib/hbbtree/Makefile index d884df4c31..8dcc568995 100644 --- a/harbour/contrib/hbbtree/Makefile +++ b/harbour/contrib/hbbtree/Makefile @@ -8,7 +8,7 @@ C_SOURCES=\ hb_btree.c \ C_HEADERS=\ - hb_btree.api \ + hb_btree.h \ PRG_SOURCES=\ tbtree.prg \ diff --git a/harbour/contrib/hbbtree/common.mak b/harbour/contrib/hbbtree/common.mak index c02b74715e..2390ed9b1c 100644 --- a/harbour/contrib/hbbtree/common.mak +++ b/harbour/contrib/hbbtree/common.mak @@ -7,7 +7,7 @@ LIBNAME = $(LIBPREF)hbbtree LIB_PATH = $(LIB_DIR)$(LIBNAME)$(LIBEXT) C_HEADERS = \ - hb_btree.api \ + hb_btree.h \ PRG_HEADERS = \ hb_btree.ch \ diff --git a/harbour/contrib/hbbtree/hb_btree.c b/harbour/contrib/hbbtree/hb_btree.c index ee505af73f..d492061207 100644 --- a/harbour/contrib/hbbtree/hb_btree.c +++ b/harbour/contrib/hbbtree/hb_btree.c @@ -181,7 +181,7 @@ see ChangeLog 2002-07-14 14:14 UTC+0500 April White #include "hbapierr.h" #include "hbinit.h" -#include "hb_btree.api" +#include "hb_btree.h" HB_EXTERN_BEGIN diff --git a/harbour/contrib/hbbtree/hb_btree.api b/harbour/contrib/hbbtree/hb_btree.h similarity index 100% rename from harbour/contrib/hbbtree/hb_btree.api rename to harbour/contrib/hbbtree/hb_btree.h diff --git a/harbour/contrib/hbbtree/tests/ctest.c b/harbour/contrib/hbbtree/tests/ctest.c index cac635860a..4ac7d418a2 100644 --- a/harbour/contrib/hbbtree/tests/ctest.c +++ b/harbour/contrib/hbbtree/tests/ctest.c @@ -36,20 +36,20 @@ #include "hbapi.h" #include "hbapiitm.h" -#include "hb_btree.api" +#include "hb_btree.h" static void display( const char *cKey, LONG lData, BOOL NewLine ) { int n; char buffer[ 80 ]; - + if( *cKey ) n = sprintf( buffer, "%s %ld", cKey, lData ); else n = sprintf( buffer, "%ld", lData ); hb_conOutStd( buffer, n ); - + if( NewLine ) hb_conOutStd( hb_conNewLine(), strlen( hb_conNewLine() ) ); } @@ -58,7 +58,7 @@ static void display( const char *cKey, LONG lData, BOOL NewLine ) static void insertdata( struct hb_BTree * pBTree ) { PHB_ITEM data = hb_itemNew( NULL ); - + hb_BTreeInsert( pBTree, ( BYTE * ) "fuweqgsz", hb_itemPutNL( data, 1 ) ); hb_BTreeInsert( pBTree, ( BYTE * ) "sjruexrd", hb_itemPutNL( data, 2 ) ); hb_BTreeInsert( pBTree, ( BYTE * ) "fvveitnz", hb_itemPutNL( data, 3 ) ); @@ -145,7 +145,7 @@ static void insertdata( struct hb_BTree * pBTree ) HB_FUNC( CTEST ) { struct hb_BTree * pBTree; - + display( "Harbour API test", 0, TRUE ); pBTree = hb_BTreeNew( ( BYTE * ) "test_3.out", 2048, 90, HB_BTREE_UNIQUE, 0 ); if ( pBTree != NULL ) @@ -159,11 +159,11 @@ HB_FUNC( CTEST ) display( "Min ", a[ hb_BTreeINFO_MINKEYS ], FALSE ); display( "Flag", a[ hb_BTreeINFO_FLAGS ], FALSE ); display( "Keys", a[ hb_BTreeINFO_KEYCOUNT ], TRUE ); -*/ +*/ insertdata( pBTree ); -/* +/* display( "Keys", hb_BTreeInfo( pBTree, hb_BTreeINFO_KEYCOUNT ), TRUE ); -*/ +*/ display( "Forward traversal", 0, TRUE ); hb_BTreeGoTop( pBTree ); while ( TRUE ) @@ -173,7 +173,7 @@ HB_FUNC( CTEST ) if ( 1 != hb_BTreeSkip( pBTree, 1 ) ) break; } - + hb_conOutStd( hb_conNewLine(), strlen( hb_conNewLine() ) ); display( "Reverse traversal", 0, TRUE ); hb_BTreeGoBottom( pBTree ); @@ -184,7 +184,7 @@ HB_FUNC( CTEST ) if ( -1 != hb_BTreeSkip( pBTree, -1 ) ) break; } - + hb_conOutStd( hb_conNewLine(), strlen( hb_conNewLine() ) ); display( "Test SEEK", 0, TRUE ); display( hb_BTreeSeek( pBTree, ( BYTE * ) "cdntyzrf", 36, FALSE ) == 1 ? ".T." : ".F.", 0, TRUE ); @@ -199,7 +199,7 @@ HB_FUNC( CTEST ) hb_BTreeSkip( pBTree, 1 ); display( ( char * ) hb_BTreeKey( pBTree ), hb_BTreeData( pBTree ), FALSE ); display( " dmfmivqb ?", 0, TRUE ); - + hb_conOutStd( hb_conNewLine(), strlen( hb_conNewLine() ) ); display( "Test soft SEEK of an existing key", 0, TRUE ); display( hb_BTreeSeek( pBTree, ( BYTE * ) "cdntyzrf", 0, TRUE ) == 1 ? ".T." : ".F.", 0, TRUE ); @@ -207,7 +207,7 @@ HB_FUNC( CTEST ) hb_BTreeSkip( pBTree, 1 ); display( ( char * ) hb_BTreeKey( pBTree ), hb_BTreeData( pBTree ), FALSE ); display( " dmfmivqb ?", 0, TRUE ); - + hb_conOutStd( hb_conNewLine(), strlen( hb_conNewLine() ) ); display( "Test soft SEEK of a missing key, that should force EOF", 0, TRUE ); display( hb_BTreeSeek( pBTree, ( BYTE * ) "zzzzzz", 0, FALSE ) == 1 ? ".T." : ".F.", 0, TRUE ); @@ -215,7 +215,7 @@ HB_FUNC( CTEST ) hb_BTreeSkip( pBTree, 1 ); display( ( char * ) hb_BTreeKey( pBTree ), hb_BTreeData( pBTree ), FALSE ); display( " dmfmivqb ?", 0, TRUE ); - + hb_conOutStd( hb_conNewLine(), strlen( hb_conNewLine() ) ); hb_BTreeClose( pBTree ); } diff --git a/harbour/contrib/hbbtree/tests/hbbtree.hbp b/harbour/contrib/hbbtree/tests/hbbtree.hbp new file mode 100644 index 0000000000..169445d02e --- /dev/null +++ b/harbour/contrib/hbbtree/tests/hbbtree.hbp @@ -0,0 +1,5 @@ +# +# $Id$ +# + +libs=hbbtree diff --git a/harbour/contrib/hbbtree/tests/hbmk.bat b/harbour/contrib/hbbtree/tests/hbmk.bat index 2a28191147..d5670c7251 100644 --- a/harbour/contrib/hbbtree/tests/hbmk.bat +++ b/harbour/contrib/hbbtree/tests/hbmk.bat @@ -2,6 +2,6 @@ @rem $Id$ @rem -@set HB_USER_LIBS=user32.lib hbct.lib hbbtree.lib +@set HB_USER_LIBS=hbbtree.lib @..\..\..\bin\hbmk %* test.prg ttest.prg ctest.c diff --git a/harbour/contrib/hbbtree/tests/test.hbm b/harbour/contrib/hbbtree/tests/test.hbm new file mode 100644 index 0000000000..7e771d2e79 --- /dev/null +++ b/harbour/contrib/hbbtree/tests/test.hbm @@ -0,0 +1,5 @@ +# +# $Id$ +# + +test.prg ttest.prg ctest.c diff --git a/harbour/contrib/hbbtree/tests/test.prg b/harbour/contrib/hbbtree/tests/test.prg index a5cb39ef0d..c5aee05cb6 100644 --- a/harbour/contrib/hbbtree/tests/test.prg +++ b/harbour/contrib/hbbtree/tests/test.prg @@ -40,9 +40,11 @@ Procedure Main() local n, a local c + local attr - if fileattr( "test_1.out") == 1 + 32 - setfattr( "test_1.out", 32 ) + hb_FGetAttr( "test_1.out", @attr ) + if attr == 1 + 32 + hb_FSetAttr( "test_1.out", 32 ) ferase( "test_1.out" ) endif