2.11.3-rc1, 2.11.4-dev
[phpmyadmin/crack.git] / test / PMA_pow_test.php
blobcc245aac8d7207b7b70ff426dfaf1c11a570bdf7
1 <?php
2 /* vim: expandtab sw=4 ts=4 sts=4: */
3 /**
4 * tests for PMA_pow()
6 * @version $Id$
7 * @package phpMyAdmin-test
8 */
10 /**
13 require_once 'PHPUnit/Framework.php';
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');