From cdfe11f80d5affd6d5386d84dff0d81323b60bc4 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Mon, 18 Feb 2019 11:47:09 -0500 Subject: [PATCH] Fix ffi test on Windows Fixes a bug in test added in 5661feb1ef929111ef7765672fcb49813eee86fc, by checking that the relevant SO exists. Also adds an additional test that is based on zend_printf, and should work on both Linux and Windows. --- ext/ffi/tests/bug77632.phpt | 9 ++++++++- ext/ffi/tests/bug77632b.phpt | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 ext/ffi/tests/bug77632b.phpt diff --git a/ext/ffi/tests/bug77632.phpt b/ext/ffi/tests/bug77632.phpt index ebaf3dccf9..314424548a 100644 --- a/ext/ffi/tests/bug77632.phpt +++ b/ext/ffi/tests/bug77632.phpt @@ -1,7 +1,14 @@ --TEST-- Bug #77632 (FFI Segfaults When Called With Variadics) --SKIPIF-- - + --INI-- ffi.enable=1 --FILE-- diff --git a/ext/ffi/tests/bug77632b.phpt b/ext/ffi/tests/bug77632b.phpt new file mode 100644 index 0000000000..a988306745 --- /dev/null +++ b/ext/ffi/tests/bug77632b.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #77632 (FFI function pointers with variadics) +--SKIPIF-- + +--INI-- +ffi.enable=1 +--FILE-- +zend_printf)(...$args); +$args2 = ["Hello, %s from zend_printf\n", "world"]; +($libc->zend_printf)(...$args2); +?> +--EXPECT-- +test from zend_printf +Hello, world from zend_printf -- 2.49.0