Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439 Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
30 lines
966 B
PHP
30 lines
966 B
PHP
<?php
|
|
/**
|
|
* BaconQrCode
|
|
*
|
|
* @link http://github.com/Bacon/BaconQrCode For the canonical source repository
|
|
* @copyright 2013 Ben 'DASPRiD' Scholzen
|
|
* @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
|
|
*/
|
|
|
|
namespace BaconQrCode\Common;
|
|
|
|
use PHPUnit_Framework_TestCase as TestCase;
|
|
|
|
class BitUtilsTest extends TestCase
|
|
{
|
|
public function testUnsignedRightShift()
|
|
{
|
|
$this->assertEquals(1, BitUtils::unsignedRightShift(1, 0));
|
|
$this->assertEquals(1, BitUtils::unsignedRightShift(10, 3));
|
|
$this->assertEquals(536870910, BitUtils::unsignedRightShift(-10, 3));
|
|
}
|
|
|
|
public function testNumberOfTrailingZeros()
|
|
{
|
|
$this->assertEquals(32, BitUtils::numberOfTrailingZeros(0));
|
|
$this->assertEquals(1, BitUtils::numberOfTrailingZeros(10));
|
|
$this->assertEquals(0, BitUtils::numberOfTrailingZeros(15));
|
|
$this->assertEquals(2, BitUtils::numberOfTrailingZeros(20));
|
|
}
|
|
} |