public function testIsBigEndian() { list(, $result) = unpack('L', pack('V', 1)); $actual = BigEndian::isBigEndian(); $expected = $result !== 1; $this->assertEquals($expected, $actual); }
public function testConstructInitializeGmpValues() { $encoder = new GmpNegativeEncoder(); $gmp_x00 = $this->getPropertyValue($encoder, 'gmp_x00'); $gmp_x7f = $this->getPropertyValue($encoder, 'gmp_x7f'); $gmp_x80 = $this->getPropertyValue($encoder, 'gmp_x80'); $gmp_xff = $this->getPropertyValue($encoder, 'gmp_xff'); $gmp_x100 = $this->getPropertyValue($encoder, 'gmp_x100'); $is32Bit = $this->getPropertyValue($encoder, 'is32Bit'); $this->assertNotNull($gmp_x00); $this->assertNotNull($gmp_x7f); $this->assertNotNull($gmp_x80); $this->assertNotNull($gmp_xff); $this->assertNotNull($gmp_x100); $this->assertEquals(0, gmp_intval($gmp_x00)); $this->assertEquals(127, gmp_intval($gmp_x7f)); $this->assertEquals(128, gmp_intval($gmp_x80)); $this->assertEquals(255, gmp_intval($gmp_xff)); $this->assertEquals(256, gmp_intval($gmp_x100)); $this->assertEquals(BigEndian::is32Bit(), $is32Bit); }
/** * @return boolean */ public function is32Bit() { return BigEndian::is32Bit(); }
/** * Constructor * * @param \Protobuf\Configuration $config */ public function __construct(Configuration $config) { $this->config = $config; $this->isBigEndian = BigEndian::isBigEndian(); $this->negativeEncoder = $config->getPlatformFactory()->getNegativeEncoder(); }
/** * Constructor * * @param \Protobuf\Configuration $config */ public function __construct(Configuration $config) { $this->config = $config; $this->isBigEndian = BigEndian::isBigEndian(); }