From 41311e6258786cdbc112e3f96b78302550dd4f9f Mon Sep 17 00:00:00 2001 From: Andi Jahja Date: Thu, 8 Jul 1999 01:31:49 +0000 Subject: [PATCH] test program for extend system --- harbour/tests/working/extend1.prg | 50 +++++++++++++++++++ harbour/tests/working/extend2.c | 79 +++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 harbour/tests/working/extend1.prg create mode 100644 harbour/tests/working/extend2.c diff --git a/harbour/tests/working/extend1.prg b/harbour/tests/working/extend1.prg new file mode 100644 index 0000000000..a0e751966a --- /dev/null +++ b/harbour/tests/working/extend1.prg @@ -0,0 +1,50 @@ +// Testing Harbour Extended system. +// +// NOTE: compile extend1.prg and extend2.c and link both files + +function Main() + + SET CENTURY ON + + QOut( "Testing Harbour Extended system:" ) + QOut( "================================" ) + QOut( "" ); + + QOut( "Strings:" ) + QOut( ' _parc() and _retc() with Strings1( "Hello" ) =>', Strings1( "Hello" ) ) + QOut( ' _parc() and _retc() with Strings2( { "Hello" } ) =>', Strings2( { "Hello" } ) ) + QOut( ' _parclen() with Length( "Hello word" ) => ', Length( "Hello word" ) ) + QOut( "" ); + + QOut( "Logicals:" ) + QOut( ' _parl() and _retl() with Logical1( .T. ) =>', Logical1( .T. ) ) + QOut( ' _parl() and _parl() with Logical2( { .T. } ) =>', Logical2( { .T. } ) ) + QOut( "" ); + + QOut( "Dates: (SET CENTURY ON)" ) + QOut( ' _pards() and _retds() with Date1( CToD( "01/01/2000" ) ) =>', Date1( CToD( "01/01/2000" ) ) ) + QOut( ' _pards() and retds() with Date2( { CToD( "01/01/2000" ) } ) =>', Date2( { CToD( "01/01/2000" ) } ) ) + QOut( "" ); + + QOut( "Numbers:" ) + QOut( ' _parni() and _retni() with Int1( 1 ) =>', Int1( 1 ) ) + QOut( ' _parni() and _retni() with Int2( { 1 } ) =>', Int2( { 1 } ) ) + QOut( ' _parnl() and _retnl() with Long1( 123456789 ) =>', Long1( 123456789 ) ) + QOut( ' _parnl() and _retnl() with Long2( { 123456789 } ) =>', Long2( { 123456789 } ) ) + QOut( ' _parnd() and _retnd() with Double1( 1234567.89 ) =>', Double1( 1234567.89 ) ) + QOut( ' _parnd() and _retnd() with Double2( { 1234567.89 } ) =>', Double2( { 1234567.89 } ) ) + QOut( "" ); + + __Accept( "Press return to continue..." ) + + QOut( "Arrays:" ) + QOut( ' _parinfa() with Arrays( { 1, "a", .T. }, 0 ) =>', Arrays( { 1, "a", .T. }, 0 ) ) + QOut( ' _parinfa() with Arrays( { 1, "a", .T. }, 2 ) =>', Arrays( { 1, "a", .T. }, 2 ), "( IT_STRING )" ) + QOut( "" ); + + QOut( "Parameters info:" ) + QOut( ' _parinfo() with Params( 1, "a", .T., 0 ) =>', Params( 1, "a", .T., 0 ) ) + QOut( ' _parinfo() with Params( 1, "a", .T., 3 ) =>', Params( 1, "a", .T., 3 ), "( IT_LOGICAL )" ) + QOut( "" ); + +return nil diff --git a/harbour/tests/working/extend2.c b/harbour/tests/working/extend2.c new file mode 100644 index 0000000000..320c99651a --- /dev/null +++ b/harbour/tests/working/extend2.c @@ -0,0 +1,79 @@ +// Testing Harbour Extended system. +// +// NOTE: compile extend1.prg and extend2.c and link both files +#include + +HARBOUR HB_STRINGS1() +{ + _retc( _parc( 1 ) ); +} + +HARBOUR HB_STRINGS2() +{ + _retc( _parc( 1, 1 ) ); +} + +HARBOUR HB_LENGTH() +{ + _retni( _parclen( 1 ) ); +} + +HARBOUR HB_LOGICAL1() +{ + _retl( _parl( 1 ) ); +} + +HARBOUR HB_LOGICAL2() +{ + _retl( _parl( 1, 1 ) ); +} + +HARBOUR HB_DATE1() +{ + _retds( _pards( 1 ) ); +} + +HARBOUR HB_DATE2() +{ + _retds( _pards( 1, 1 ) ); +} + +HARBOUR HB_INT1() +{ + _retni( _parni( 1 ) ); +} + +HARBOUR HB_INT2() +{ + _retni( _parni( 1, 1 ) ); +} + +HARBOUR HB_LONG1() +{ + _retnl( _parnl( 1 ) ); +} + +HARBOUR HB_LONG2() +{ + _retnl( _parnl( 1, 1 ) ); +} + +HARBOUR HB_DOUBLE1() +{ + _retnd( _parnd( 1 ) ); +} + +HARBOUR HB_DOUBLE2() +{ + _retnd( _parnd( 1, 1 ) ); +} + +HARBOUR HB_ARRAYS() +{ + _retnl( _parinfa( 1, _parni( 2 ) ) ); +} + +HARBOUR HB_PARAMS() +{ + _retni( _parinfo( _parni( 4 ) ) ); +} \ No newline at end of file