Advisor: mark that 'Rate of reading fixed position' may be wrong, requires further...
[phpmyadmin/thilanka.git] / test / libraries / common / PMA_pow_test.php
blobff55e16b81a6203c9d638ed3732e7528f08decf8
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Tests for PMA_pow() function from common.lib.php
6 * @package phpMyAdmin-test
7 * @version $Id: PMA_pow_test.php
8 * @group common.lib-tests
9 */
12 * Include to test.
14 require_once 'libraries/common.lib.php';
16 class PMA_pow_test extends PHPUnit_Framework_TestCase
18 public function testIntOverflow()
20 $this->assertEquals('1267650600228229401496703205376',
21 PMA_pow(2, 100));
24 public function testBcpow()
26 if (function_exists('bcpow')) {
27 $this->assertEquals('1267650600228229401496703205376',
28 PMA_pow(2, 100, 'bcpow'));
29 } else {
30 $this->markTestSkipped('function bcpow() does not exist');
34 public function testGmppow()
36 if (function_exists('gmp_pow')) {
37 $this->assertEquals('1267650600228229401496703205376',
38 PMA_pow(2, 100, 'gmp_pow'));
39 } else {
40 $this->markTestSkipped('function gmp_pow() does not exist');
44 public function _testNegativeExp()
46 $this->assertEquals(0.25,
47 PMA_pow(2, -2));
50 public function _testNegativeExpPow()
52 if (function_exists('pow')) {
53 $this->assertEquals(0.25,
54 PMA_pow(2, -2, 'pow'));
55 } else {
56 $this->markTestSkipped('function pow() does not exist');
60 public function _testNegativeExpBcpow()
62 if (function_exists('bcpow')) {
63 $this->assertEquals(0.25,
64 PMA_pow(2, -2, 'bcpow'));
65 } else {
66 $this->markTestSkipped('function bcpow() does not exist');
70 public function _testNegativeExpGmppow()
72 if (function_exists('gmp_pow')) {
73 $this->assertEquals(0.25,
74 PMA_pow(2, -2, 'gmp_pow'));
75 } else {
76 $this->markTestSkipped('function gmp_pow() does not exist');