2 /* vim: set expandtab sw=4 ts=4 sts=4: */
7 * @package phpMyAdmin-test
13 require_once 'PHPUnit/Framework.php';
14 require_once './libraries/common.lib.php';
17 * @package phpMyAdmin-test
19 class PMA_pow_test
extends PHPUnit_Framework_TestCase
21 public function testIntOverflow()
23 $this->assertEquals('1267650600228229401496703205376',
27 public function testBcpow()
29 if (function_exists('bcpow')) {
30 $this->assertEquals('1267650600228229401496703205376',
31 PMA_pow(2, 100, 'bcpow'));
33 $this->markTestSkipped('function bcpow() does not exist');
37 public function testGmppow()
39 if (function_exists('gmp_pow')) {
40 $this->assertEquals('1267650600228229401496703205376',
41 PMA_pow(2, 100, 'gmp_pow'));
43 $this->markTestSkipped('function gmp_pow() does not exist');
47 public function _testNegativeExp()
49 $this->assertEquals(0.25,
53 public function _testNegativeExpPow()
55 if (function_exists('pow')) {
56 $this->assertEquals(0.25,
57 PMA_pow(2, -2, 'pow'));
59 $this->markTestSkipped('function pow() does not exist');
63 public function _testNegativeExpBcpow()
65 if (function_exists('bcpow')) {
66 $this->assertEquals(0.25,
67 PMA_pow(2, -2, 'bcpow'));
69 $this->markTestSkipped('function bcpow() does not exist');
73 public function _testNegativeExpGmppow()
75 if (function_exists('gmp_pow')) {
76 $this->assertEquals(0.25,
77 PMA_pow(2, -2, 'gmp_pow'));
79 $this->markTestSkipped('function gmp_pow() does not exist');