Skip to content

Commit 05ef57f

Browse files
committed
Fix output buffering in test
1 parent 0a8518b commit 05ef57f

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

ext/ffi/tests/trampoline_reset.phpt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,22 @@ class Test
2222
}
2323
}
2424

25-
Test::works1();
26-
Test::works2();
25+
$header = '
26+
typedef struct _IO_FILE FILE;
27+
extern FILE *stdout;
28+
int fprintf(FILE *, const char *, ...);
29+
int fflush(FILE *);
30+
';
31+
$ffi = FFI::cdef($header, 'libc.so.6');
2732

28-
$ffi = FFI::cdef('int printf(const char *format, ...);', 'libc.so.6');
29-
$ffi->printf("Hello %s!\n", "world");
30-
31-
Test::breaks();
33+
Test::foo();
34+
Test::bar();
35+
$ffi->fprintf($ffi->stdout, "FFI\n");
36+
$ffi->fflush($ffi->stdout);
37+
Test::baz();
3238
?>
3339
--EXPECT--
34-
works1 called
35-
works2 called
36-
breaks called
37-
Hello world!
40+
foo called
41+
bar called
42+
FFI
43+
baz called

0 commit comments

Comments
 (0)