Annotation of embedaddon/php/ext/gmp/tests/033.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: gmp_setbit() basic tests
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: $n = gmp_init(-1);
                      9: gmp_setbit($n, 10, -1);
                     10: var_dump(gmp_strval($n));
                     11: 
                     12: $n = gmp_init(5);
                     13: gmp_setbit($n, -20, 0);
                     14: var_dump(gmp_strval($n));
                     15: 
                     16: $n = gmp_init(5);
                     17: gmp_setbit($n, 2, 0);
                     18: var_dump(gmp_strval($n));
                     19: 
                     20: $n = gmp_init(5);
                     21: gmp_setbit($n, 1, 1);
                     22: var_dump(gmp_strval($n));
                     23: 
                     24: $n = gmp_init("100000000000");
                     25: gmp_setbit($n, 23, 1);
                     26: var_dump(gmp_strval($n));
                     27: 
                     28: gmp_setbit($n, 23, 0);
                     29: var_dump(gmp_strval($n));
                     30: 
                     31: gmp_setbit($n, 3);
                     32: var_dump(gmp_strval($n));
                     33: 
                     34: $b = "";
                     35: gmp_setbit($b, 23);
                     36: gmp_setbit($b);
                     37: gmp_setbit($b, 23,1,1);
                     38: gmp_setbit($b,array());
                     39: $a = array();
                     40: gmp_setbit($a,array());
                     41: 
                     42: echo "Done\n";
                     43: ?>
                     44: --EXPECTF--    
                     45: string(2) "-1"
                     46: 
                     47: Warning: gmp_setbit(): Index must be greater than or equal to zero in %s on line %d
                     48: string(1) "5"
                     49: string(1) "1"
                     50: string(1) "7"
                     51: string(12) "100008388608"
                     52: string(12) "100000000000"
                     53: string(12) "100000000008"
                     54: 
                     55: Warning: gmp_setbit(): supplied argument is not a valid GMP integer resource in %s on line %d
                     56: 
                     57: Warning: gmp_setbit() expects at least 2 parameters, 1 given in %s on line %d
                     58: 
                     59: Warning: gmp_setbit() expects at most 3 parameters, 4 given in %s on line %d
                     60: 
                     61: Warning: gmp_setbit() expects parameter 2 to be long, array given in %s on line %d
                     62: 
                     63: Warning: gmp_setbit() expects parameter 2 to be long, array given in %s on line %d
                     64: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>