@@ -9,29 +9,30 @@ import 'dart:io';
9
9
10
10
import 'package:expect/expect.dart' ;
11
11
12
- import 'dylib_utils.dart' ;
13
- import 'ffi_test_helpers.dart' ;
14
12
import 'callback_tests_utils.dart' ;
13
+ import 'dylib_utils.dart' ;
15
14
16
15
DynamicLibrary ffiTestFunctions = dlopenPlatformSpecific ("ffi_test_functions" );
17
16
18
17
testLeafCall () {
19
18
// Note: This test currently fails on Windows AOT: https://dartbug.com/40579
20
19
// Regular calls should transition generated -> native.
21
- final isThreadInGenerated = ffiTestFunctions.lookupFunction <
22
- Int8 Function (), int Function ()> ("IsThreadInGenerated" );
20
+ final isThreadInGenerated = ffiTestFunctions
21
+ .lookupFunction < Int8 Function (), int Function ()> ("IsThreadInGenerated" );
23
22
Expect .equals (0 , isThreadInGenerated ());
24
23
// Leaf calls should remain in generated state.
25
- final isThreadInGeneratedLeaf = ffiTestFunctions.lookupFunction<
26
- Int8 Function (), int Function ()> ("IsThreadInGenerated" , isLeaf: true );
24
+ final isThreadInGeneratedLeaf = ffiTestFunctions
25
+ .lookupFunction< Int8 Function (), int Function ()> ("IsThreadInGenerated" ,
26
+ isLeaf: true );
27
27
Expect .equals (1 , isThreadInGeneratedLeaf ());
28
28
}
29
29
30
30
testLeafCallApi () {
31
31
// Note: This will only crash as expected in debug build mode. In other modes
32
32
// it's effectively skip.
33
- final f = ffiTestFunctions.lookupFunction<
34
- Void Function (), void Function ()> ("TestLeafCallApi" , isLeaf: true );
33
+ final f = ffiTestFunctions.lookupFunction< Void Function (), void Function ()> (
34
+ "TestLeafCallApi" ,
35
+ isLeaf: true );
35
36
// Calling Dart_.. API is unsafe from leaf calls since we explicitly haven't
36
37
// made the generated -> native transition.
37
38
f ();
@@ -45,7 +46,8 @@ testCallbackLeaf() {
45
46
// Note: This will only crash as expected in debug build mode. In other modes
46
47
// it's effectively skip.
47
48
CallbackTest ("CallbackLeaf" , Pointer .fromFunction< Void Function ()> (nop),
48
- isLeaf: true ).run ();
49
+ isLeaf: true )
50
+ .run ();
49
51
}
50
52
51
53
main () {
0 commit comments