there's all the signed-int parsers working

This commit is contained in:
Meredith L. Patterson 2013-11-24 20:40:48 -06:00
parent 282c42139d
commit b13d5045e2
4 changed files with 109 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<?php
include_once 'hammer.php';
class Int64Test extends PHPUnit_Framework_TestCase
{
protected $parser;
protected function setUp()
{
$this->parser = h_int64();
}
public function testSuccess()
{
$result = h_parse($this->parser, "\xff\xff\xff\xfe\x00\x00\x00\x00");
$this->assertEquals(-0x200000000, $result);
}
public function testFailure()
{
$result = h_parse($this->parser, "\xff\xff\xff\xfe\x00\x00\x00");
$this->assertEquals(NULL, $result);
}
}
?>