| 1 | # Test vectors for conversion between MP ints and C ints |
| 2 | # |
| 3 | # $Id: mpint,v 1.1 1999/11/25 11:38:33 mdw Exp $ |
| 4 | |
| 5 | # The tests look messy because I'm fighting with atoi here as well as the |
| 6 | # integer conversion routines I'm trying to test. |
| 7 | |
| 8 | fromuint { |
| 9 | 0 0; |
| 10 | 1 1; |
| 11 | -5 0xfffffffb; |
| 12 | 0x7fffffff 0x7fffffff; |
| 13 | -0x80000000 0x80000000; # Bastard torture test |
| 14 | } |
| 15 | |
| 16 | fromint { |
| 17 | 0 0; |
| 18 | 1 1; |
| 19 | -5 -5; |
| 20 | 0x7fffffff 0x7fffffff; |
| 21 | -0x80000000 -0x80000000; # Bastard torture test |
| 22 | } |
| 23 | |
| 24 | touint { |
| 25 | 0 0; |
| 26 | 1 1; |
| 27 | -5 -5; |
| 28 | 0x7fffffff 0x7fffffff; |
| 29 | 0x80000000 -0x80000000; # Bastard torture test |
| 30 | } |
| 31 | |
| 32 | toint { |
| 33 | 0 0; |
| 34 | 1 1; |
| 35 | -5 -5; |
| 36 | 0x7fffffff 0x7fffffff; |
| 37 | -0x80000000 -0x80000000; # Bastard torture test |
| 38 | } |
| 39 | |