mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Test passing null pointers to mp_divmod_into.
I've got opt_val_mpint already in the test system, so it makes sense to use it.
This commit is contained in:
parent
791f1cc068
commit
82df83719a
@ -370,6 +370,18 @@ class mpint(MyTestBase):
|
|||||||
self.assertEqual(int(mp_div(n, d)), q)
|
self.assertEqual(int(mp_div(n, d)), q)
|
||||||
self.assertEqual(int(mp_mod(n, d)), r)
|
self.assertEqual(int(mp_mod(n, d)), r)
|
||||||
|
|
||||||
|
# Make sure divmod_into can handle not getting one
|
||||||
|
# of its output pointers (or even both).
|
||||||
|
mp_clear(mq)
|
||||||
|
mp_divmod_into(n, d, mq, None)
|
||||||
|
self.assertEqual(int(mq), q)
|
||||||
|
mp_clear(mr)
|
||||||
|
mp_divmod_into(n, d, None, mr)
|
||||||
|
self.assertEqual(int(mr), r)
|
||||||
|
mp_divmod_into(n, d, None, None)
|
||||||
|
# No tests we can do after that last one - we just
|
||||||
|
# insist that it isn't allowed to have crashed!
|
||||||
|
|
||||||
def testBitwise(self):
|
def testBitwise(self):
|
||||||
p = 0x3243f6a8885a308d313198a2e03707344a4093822299f31d0082efa98ec4e
|
p = 0x3243f6a8885a308d313198a2e03707344a4093822299f31d0082efa98ec4e
|
||||||
e = 0x2b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190
|
e = 0x2b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190
|
||||||
|
@ -48,7 +48,7 @@ FUNC4(void, mp_cond_add_into, val_mpint, val_mpint, val_mpint, uint)
|
|||||||
FUNC4(void, mp_cond_sub_into, val_mpint, val_mpint, val_mpint, uint)
|
FUNC4(void, mp_cond_sub_into, val_mpint, val_mpint, val_mpint, uint)
|
||||||
FUNC3(void, mp_cond_swap, val_mpint, val_mpint, uint)
|
FUNC3(void, mp_cond_swap, val_mpint, val_mpint, uint)
|
||||||
FUNC2(void, mp_cond_clear, val_mpint, uint)
|
FUNC2(void, mp_cond_clear, val_mpint, uint)
|
||||||
FUNC4(void, mp_divmod_into, val_mpint, val_mpint, val_mpint, val_mpint)
|
FUNC4(void, mp_divmod_into, val_mpint, val_mpint, opt_val_mpint, opt_val_mpint)
|
||||||
FUNC2(val_mpint, mp_div, val_mpint, val_mpint)
|
FUNC2(val_mpint, mp_div, val_mpint, val_mpint)
|
||||||
FUNC2(val_mpint, mp_mod, val_mpint, val_mpint)
|
FUNC2(val_mpint, mp_mod, val_mpint, val_mpint)
|
||||||
FUNC2(void, mp_reduce_mod_2to, val_mpint, uint)
|
FUNC2(void, mp_reduce_mod_2to, val_mpint, uint)
|
||||||
|
Loading…
Reference in New Issue
Block a user