2 /* vim: set expandtab sw=4 ts=4 sts=4: */
6 * @package phpMyAdmin-test
12 require_once 'PHPUnit/Framework.php';
13 require_once './libraries/common.lib.php';
16 * @package phpMyAdmin-test
18 class PMA_pow_test
extends PHPUnit_Framework_TestCase
20 public function testIntOverflow()
22 $this->assertEquals('1267650600228229401496703205376',
26 public function testBcpow()
28 if (function_exists('bcpow')) {
29 $this->assertEquals('1267650600228229401496703205376',
30 PMA_pow(2, 100, 'bcpow'));
32 $this->markTestSkipped('function bcpow() does not exist');
36 public function testGmppow()
38 if (function_exists('gmp_pow')) {
39 $this->assertEquals('1267650600228229401496703205376',
40 PMA_pow(2, 100, 'gmp_pow'));
42 $this->markTestSkipped('function gmp_pow() does not exist');
46 public function _testNegativeExp()
48 $this->assertEquals(0.25,
52 public function _testNegativeExpPow()
54 if (function_exists('pow')) {
55 $this->assertEquals(0.25,
56 PMA_pow(2, -2, 'pow'));
58 $this->markTestSkipped('function pow() does not exist');
62 public function _testNegativeExpBcpow()
64 if (function_exists('bcpow')) {
65 $this->assertEquals(0.25,
66 PMA_pow(2, -2, 'bcpow'));
68 $this->markTestSkipped('function bcpow() does not exist');
72 public function _testNegativeExpGmppow()
74 if (function_exists('gmp_pow')) {
75 $this->assertEquals(0.25,
76 PMA_pow(2, -2, 'gmp_pow'));
78 $this->markTestSkipped('function gmp_pow() does not exist');