Annotation of embedaddon/php/ext/gmp/tests/007.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: gmp_div_qr() tests
3: --SKIPIF--
4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
5: --FILE--
6: <?php
7:
8: var_dump(gmp_div_qr());
9: var_dump(gmp_div_qr(""));
10:
11: var_dump($r = gmp_div_qr(0,1));
12: var_dump(gmp_strval($r[0]));
13: var_dump(gmp_strval($r[1]));
14: var_dump($r = gmp_div_qr(1,0));
15: var_dump($r = gmp_div_qr(12653,23482734));
16: var_dump(gmp_strval($r[0]));
17: var_dump(gmp_strval($r[1]));
18: var_dump($r = gmp_div_qr(12653,23482734, 10));
19: var_dump(gmp_strval($r[0]));
20: var_dump(gmp_strval($r[1]));
21: var_dump($r = gmp_div_qr(1123123,123));
22: var_dump(gmp_strval($r[0]));
23: var_dump(gmp_strval($r[1]));
24: var_dump($r = gmp_div_qr(1123123,123, 1));
25: var_dump(gmp_strval($r[0]));
26: var_dump(gmp_strval($r[1]));
27: var_dump($r = gmp_div_qr(1123123,123, 2));
28: var_dump(gmp_strval($r[0]));
29: var_dump(gmp_strval($r[1]));
30: var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_ZERO));
31: var_dump(gmp_strval($r[0]));
32: var_dump(gmp_strval($r[1]));
33: var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_PLUSINF));
34: var_dump(gmp_strval($r[0]));
35: var_dump(gmp_strval($r[1]));
36: var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_MINUSINF));
37: var_dump(gmp_strval($r[0]));
38: var_dump(gmp_strval($r[1]));
39:
40: $fp = fopen(__FILE__, 'r');
41:
42: var_dump(gmp_div_qr($fp, $fp));
43: var_dump(gmp_div_qr(array(), array()));
44:
45: echo "Done\n";
46: ?>
47: --EXPECTF--
48: Warning: gmp_div_qr() expects at least 2 parameters, 0 given in %s on line %d
49: NULL
50:
51: Warning: gmp_div_qr() expects at least 2 parameters, 1 given in %s on line %d
52: NULL
53: array(2) {
54: [0]=>
55: resource(%d) of type (GMP integer)
56: [1]=>
57: resource(%d) of type (GMP integer)
58: }
59: string(1) "0"
60: string(1) "0"
61:
62: Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
63: bool(false)
64: array(2) {
65: [0]=>
66: resource(%d) of type (GMP integer)
67: [1]=>
68: resource(%d) of type (GMP integer)
69: }
70: string(1) "0"
71: string(5) "12653"
72: NULL
73:
74: Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
75: bool(false)
76:
77: Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
78: bool(false)
79: array(2) {
80: [0]=>
81: resource(%d) of type (GMP integer)
82: [1]=>
83: resource(%d) of type (GMP integer)
84: }
85: string(4) "9131"
86: string(2) "10"
87: array(2) {
88: [0]=>
89: resource(%d) of type (GMP integer)
90: [1]=>
91: resource(%d) of type (GMP integer)
92: }
93: string(4) "9132"
94: string(4) "-113"
95: array(2) {
96: [0]=>
97: resource(%d) of type (GMP integer)
98: [1]=>
99: resource(%d) of type (GMP integer)
100: }
101: string(4) "9131"
102: string(2) "10"
103: array(2) {
104: [0]=>
105: resource(%d) of type (GMP integer)
106: [1]=>
107: resource(%d) of type (GMP integer)
108: }
109: string(4) "9131"
110: string(2) "10"
111: array(2) {
112: [0]=>
113: resource(%d) of type (GMP integer)
114: [1]=>
115: resource(%d) of type (GMP integer)
116: }
117: string(4) "9132"
118: string(4) "-113"
119: array(2) {
120: [0]=>
121: resource(%d) of type (GMP integer)
122: [1]=>
123: resource(%d) of type (GMP integer)
124: }
125: string(4) "9131"
126: string(2) "10"
127:
128: Warning: gmp_div_qr(): supplied resource is not a valid GMP integer resource in %s on line %d
129: bool(false)
130:
131: Warning: gmp_div_qr(): Unable to convert variable to GMP - wrong type in %s on line %d
132: bool(false)
133: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>