]> git.pld-linux.org Git - packages/php-pecl-libsodium.git/blobdiff - tests-php53.patch
add patch to pass tests on php5.3
[packages/php-pecl-libsodium.git] / tests-php53.patch
diff --git a/tests-php53.patch b/tests-php53.patch
new file mode 100644 (file)
index 0000000..1dc8c6d
--- /dev/null
@@ -0,0 +1,28 @@
+--- php-pecl-libsodium-1.0.2/tests/utils.phpt  2016-01-28 21:43:00.641808352 +0200
++++ php-pecl-libsodium-1.0.2/tests/utils.phpt  2016-01-28 21:45:37.116534064 +0200
+@@ -11,15 +11,15 @@
+ $c = 'string';
+ var_dump(!\Sodium\memcmp($b, $c));
+ var_dump(!\Sodium\memcmp($b, 'String'));
+-$v = hex2bin('FFFF800102030405060708');
++$v = "\xFF\xFF\x80\x01\x02\x03\x04\x05\x06\x07\x08";
+ \Sodium\increment($v);
+ var_dump(bin2hex($v));
+ if (\Sodium\library_version_major() > 7 ||
+     (\Sodium\library_version_major() == 7 &&
+      \Sodium\library_version_minor() >= 6)) {
+-    $v_1 = hex2bin('0102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F');
+-    $v_2 = hex2bin('0202030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F');
++    $v_1 = "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
++    $v_2 = "\x02\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
+     var_dump(\Sodium\compare($v_1, $v_2));
+     \Sodium\increment($v_1);
+     var_dump(\Sodium\compare($v_1, $v_2));
+@@ -32,5 +32,5 @@
+ $str = 'stdClass';
+ \Sodium\memzero($str);
+-$obj = json_decode(json_encode(['foo' => 'bar']));
++$obj = json_decode(json_encode(array('foo' => 'bar')));
+ var_dump($obj);
+ ?>
This page took 0.029595 seconds and 4 git commands to generate.