Gather up another utility.
[u/mdw/catacomb] / tests / mpint
CommitLineData
70b904c5 1# Test vectors for conversion between MP ints and C ints
2#
e6991bb2 3# $Id: mpint,v 1.4 2002/01/13 19:51:34 mdw Exp $
70b904c5 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
8fromuint {
9 0 0;
10 1 1;
11 -5 0xfffffffb;
12 0x7fffffff 0x7fffffff;
fa9c3bb5 13 0x80000000 0x80000000; # Bastard torture test
e6991bb2 14 0xffffffff 0xffffffff;
70b904c5 15}
16
17fromint {
18 0 0;
19 1 1;
20 -5 -5;
21 0x7fffffff 0x7fffffff;
22 -0x80000000 -0x80000000; # Bastard torture test
23}
24
25touint {
26 0 0;
27 1 1;
28 -5 -5;
29 0x7fffffff 0x7fffffff;
30 0x80000000 -0x80000000; # Bastard torture test
e6991bb2 31 0xffffffff 0xffffffff;
70b904c5 32}
33
34toint {
35 0 0;
36 1 1;
37 -5 -5;
38 0x7fffffff 0x7fffffff;
39 -0x80000000 -0x80000000; # Bastard torture test
40}