2008-04-13 21:59 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

* source/rtl/mod.c
     ! Fixed error object to be C5x compatible when wrong or too 
       few parameters were passed to MOD(). Now the previously 
       corrected MOD() regression tests pass. (I misinterpreted 
       the problem in the previous ChangeLog entry.)

   * utils/hbtest/rt_math.prg
     + Added two new tests for MOD()
This commit is contained in:
Viktor Szakats
2008-04-13 20:05:38 +00:00
parent ed876c2900
commit 26fde59322
3 changed files with 19 additions and 5 deletions

View File

@@ -8,6 +8,16 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-04-13 21:59 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* source/rtl/mod.c
! Fixed error object to be C5x compatible when wrong or too
few parameters were passed to MOD(). Now the previously
corrected MOD() regression tests pass. (I misinterpreted
the problem in the previous ChangeLog entry.)
* utils/hbtest/rt_math.prg
+ Added two new tests for MOD()
2008-04-13 19:19 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* common.mak
+ utils/hbtest/rt_main.h
@@ -37,10 +47,6 @@
* utils/hbtest/rt_math.prg
! Corrected expected C5.2/5.3 result for 'MOD()'.
TOFIX: The Harbour result is different, and in contrary to
C5.x it won't allow to substitue values from the
error handler, when wrong types were passed initially,
which is IMO a bug.
* utils/hbtest/rt_misc.prg
! Some results synced with C5.x (where the result could be

View File

@@ -99,7 +99,13 @@ HB_FUNC( MOD )
}
}
else
hb_errRT_BASE_SubstR( EG_ARG, 1085, NULL, "%", HB_ERR_ARGS_BASEPARAMS );
{
PHB_ITEM pItemNIL = hb_itemNew( NULL );
hb_errRT_BASE_SubstR( EG_ARG, 1085, NULL, "%", 2, hb_pcount() > 0 ? hb_param( 1, HB_IT_ANY ) : pItemNIL, hb_pcount() > 1 ? hb_param( 2, HB_IT_ANY ) : pItemNIL );
hb_itemRelease( pItemNIL );
}
}
/*

View File

@@ -361,6 +361,8 @@ FUNCTION Main_MATH()
/* MOD() */
TEST_LINE( MOD() , "E BASE 1085 Argument error % A:2:U:NIL;U:NIL F:S" )
TEST_LINE( MOD( NIL ) , "E BASE 1085 Argument error % A:2:U:NIL;U:NIL F:S" )
TEST_LINE( MOD( 100 ) , "E BASE 1085 Argument error % A:2:N:100;U:NIL F:S" )
TEST_LINE( MOD( "A", "B" ) , "E BASE 1085 Argument error % A:2:C:A;C:B F:S" )
TEST_LINE( MOD( "A", 100 ) , "E BASE 1085 Argument error % A:2:C:A;N:100 F:S" )
TEST_LINE( MOD( 100, "B" ) , "E BASE 1085 Argument error % A:2:N:100;C:B F:S" )