mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-19 02:23:09 +00:00
ZVAL_STRINGL please work
This commit is contained in:
committed by
Justin Boswell
parent
5397cc35bf
commit
e0123d4653
+49
-1
@@ -11,7 +11,7 @@ final class CrcTest extends CrtTestCase {
|
||||
|
||||
public function testCrc32ZeroesOneShot() {
|
||||
$input = implode(array_map("chr", array_fill(0, 32, 0)));
|
||||
$output = CRT::crc32($input);
|
||||
$output = CRT::crc32($input, 0);
|
||||
$expected = 0x190A55AD;
|
||||
$this->assertEquals($output, $expected);
|
||||
}
|
||||
@@ -25,6 +25,54 @@ final class CrcTest extends CrtTestCase {
|
||||
$this->assertEquals($output, $expected);
|
||||
}
|
||||
|
||||
public function testCrc32ValuesOneShot() {
|
||||
$input = implode(array_map("chr", range(0, 31)));
|
||||
$output = CRT::crc32($input, 0);
|
||||
$expected = 0x91267E8A;
|
||||
$this->assertEquals($output, $expected);
|
||||
}
|
||||
|
||||
public function testCrc32ValuesIterated() {
|
||||
$output = 0;
|
||||
foreach (range(0, 31) as $n) {
|
||||
$output = CRT::crc32(chr($n), $output);
|
||||
}
|
||||
$expected = 0x91267E8A;
|
||||
$this->assertEquals($output, $expected);
|
||||
}
|
||||
|
||||
public function testCrc32cZeroesOneShot() {
|
||||
$input = implode(array_map("chr", array_fill(0, 32, 0)));
|
||||
$output = CRT::crc32c($input, 0);
|
||||
$expected = 0x8A9136AA;
|
||||
$this->assertEquals($output, $expected);
|
||||
}
|
||||
|
||||
public function testCrc32cZeroesIterated() {
|
||||
$output = 0;
|
||||
for ($i = 0; $i < 32; $i++) {
|
||||
$output = CRT::crc32c("\x00", $output);
|
||||
}
|
||||
$expected = 0x8A9136AA;
|
||||
$this->assertEquals($output, $expected);
|
||||
}
|
||||
|
||||
public function testCrc32cValuesOneShot() {
|
||||
$input = implode(array_map("chr", range(0, 31)));
|
||||
$output = CRT::crc32c($input, 0);
|
||||
$expected = 0x46DD794E;
|
||||
$this->assertEquals($output, $expected);
|
||||
}
|
||||
|
||||
public function testCrc32ZeroesIterated() {
|
||||
$output = 0;
|
||||
for ($i = 0; $i < 32; $i++) {
|
||||
$output = CRT::crc32("\x00", $output);
|
||||
}
|
||||
$expected = 0x190A55AD;
|
||||
$this->assertEquals($output, $expected);
|
||||
}
|
||||
|
||||
public function testCrc32ValuesOneShot() {
|
||||
$input = implode(array_map("chr", range(0, 31)));
|
||||
$output = CRT::crc32($input);
|
||||
|
||||
Reference in New Issue
Block a user