]> git.pld-linux.org Git - packages/php-pecl-libsodium.git/commitdiff
add patch to pass tests on php5.3
authorElan Ruusamäe <glen@delfi.ee>
Thu, 28 Jan 2016 19:48:19 +0000 (21:48 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 28 Jan 2016 19:48:19 +0000 (21:48 +0200)
php-pecl-libsodium.spec
tests-php53.patch [new file with mode: 0644]

index 596b878ebe16ee39ef5a46085a79730021139f03..3a93e30f60ff0b969c92d69fa9021dbc1c67d1d8 100644 (file)
@@ -17,6 +17,7 @@ Source0:      http://pecl.php.net/get/%{modname}-%{version}.tgz
 URL:           http://pecl.php.net/package/libsodium
 # See https://github.com/jedisct1/libsodium-php/pull/70
 Patch0:                %{modname}-pr70.patch
+Patch1:                tests-php53.patch
 BuildRequires: %{php_name}-devel >= 4:5.3
 BuildRequires: libsodium-devel >= 0.6.0
 BuildRequires: pkgconfig
@@ -40,6 +41,7 @@ Documentation: https://paragonie.com/book/pecl-libsodium
 mv %{modname}-%{version}/* .
 
 %patch0 -p1
+%patch1 -p1
 
 # Sanity check, really often broken
 extver=$(sed -n '/#define PHP_LIBSODIUM_VERSION/{s/.* "//;s/".*$//;p}' php_libsodium.h)
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.108533 seconds and 4 git commands to generate.