diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2016-11-10 11:20:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-10 11:20:50 -0800 |
commit | df8390790aae6025e95687a37eea81a4757966d0 (patch) | |
tree | c2659eb553f560bed02b984050462cba961aaf46 /php/tests/test_base.php | |
parent | 9f75c5aa851cd877fb0d93ccc31b8567a6706546 (diff) | |
download | protobuf-df8390790aae6025e95687a37eea81a4757966d0.tar.gz protobuf-df8390790aae6025e95687a37eea81a4757966d0.tar.bz2 protobuf-df8390790aae6025e95687a37eea81a4757966d0.zip |
Fix php c extension on 32-bit machines. (#2348)
Diffstat (limited to 'php/tests/test_base.php')
-rw-r--r-- | php/tests/test_base.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/php/tests/test_base.php b/php/tests/test_base.php index 49886050..d461f0f7 100644 --- a/php/tests/test_base.php +++ b/php/tests/test_base.php @@ -75,20 +75,28 @@ class TestBase extends PHPUnit_Framework_TestCase { $this->assertSame(0, $m->getOptionalInt32()); $this->assertSame(0, $m->getOptionalUint32()); - $this->assertSame(0, $m->getOptionalInt64()); - $this->assertSame(0, $m->getOptionalUint64()); $this->assertSame(0, $m->getOptionalSint32()); - $this->assertSame(0, $m->getOptionalSint64()); $this->assertSame(0, $m->getOptionalFixed32()); - $this->assertSame(0, $m->getOptionalFixed64()); $this->assertSame(0, $m->getOptionalSfixed32()); - $this->assertSame(0, $m->getOptionalSfixed64()); $this->assertSame(0.0, $m->getOptionalFloat()); $this->assertSame(0.0, $m->getOptionalDouble()); $this->assertSame(false, $m->getOptionalBool()); $this->assertSame('', $m->getOptionalString()); $this->assertSame('', $m->getOptionalBytes()); $this->assertNull($m->getOptionalMessage()); + if (PHP_INT_SIZE == 4) { + $this->assertSame("0", $m->getOptionalInt64()); + $this->assertSame("0", $m->getOptionalUint64()); + $this->assertSame("0", $m->getOptionalSint64()); + $this->assertSame("0", $m->getOptionalFixed64()); + $this->assertSame("0", $m->getOptionalSfixed64()); + } else { + $this->assertSame(0, $m->getOptionalInt64()); + $this->assertSame(0, $m->getOptionalUint64()); + $this->assertSame(0, $m->getOptionalSint64()); + $this->assertSame(0, $m->getOptionalFixed64()); + $this->assertSame(0, $m->getOptionalSfixed64()); + } } // This test is to avoid the warning of no test by php unit. |