Skip to content

Commit 5c313c7

Browse files
dcharkesCommit Queue
authored andcommitted
[ffi] Format tests/ffi/ with new style - manual
Tests with cfe/analyzer expectations have comments for error locations. Opt out some parts of these tests. Change-Id: Iab2ae121dc11af71088566a86c68ceb9a307a561 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399103 Commit-Queue: Daco Harkes <[email protected]> Reviewed-by: Bob Nystrom <[email protected]>
1 parent 5224f34 commit 5c313c7

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

tests/ffi/static_checks/address_position_cascade_test.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ external void myNonLeafNative(Pointer<Void> buff);
1212
external void myNativeWith2Param(Pointer<Void> buffer, Pointer<Int8> buffer2);
1313

1414
@Native<Void Function(Pointer<Void>, Pointer<Int8>, Pointer<Void>)>(
15-
isLeaf: true)
15+
isLeaf: true,
16+
)
1617
external void myNativeWith3Param(
17-
Pointer<Void> buffer, Pointer<Int8> buffer2, Pointer<Void> buffer3);
18+
Pointer<Void> buffer,
19+
Pointer<Int8> buffer2,
20+
Pointer<Void> buffer3,
21+
);
1822

1923
void testDefinedLeaf() {
2024
final buffer = Int8List.fromList([1]);
@@ -36,6 +40,7 @@ void testDefinedLeaf() {
3640
// ^^^^^^^^^^^^^^
3741
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
3842

43+
// dart format off
3944
myNativeWith3Param(
4045
buffer.address.cast(),
4146
/* */ buffer.address.cast<Void>(),
@@ -107,6 +112,7 @@ void testDefinedLeaf() {
107112
// ^^^^^^^^^^^^^^
108113
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE
109114
}
115+
// dart format on
110116

111117
void testUndefinedLeaf() {
112118
final buffer = Int8List.fromList([1]);

tests/ffi/static_checks/vmspecific_static_checks_array_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//
77
// SharedObjects=ffi_test_dynamic_library ffi_test_functions
88

9+
// dart format off
10+
911
import 'dart:ffi';
1012

1113
void main() {}

tests/ffi/static_checks/vmspecific_static_checks_native_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ void addressOf() {
163163
// [analyzer] COMPILE_TIME_ERROR.ARGUMENT_MUST_BE_NATIVE
164164
// [cfe] Argument to 'Native.addressOf' must be annotated with @Native.
165165

166+
// dart format off
167+
166168
Native.addressOf(_valid);
167169
//^^^^^^^^^^^^^^^^^^^^^^^^
168170
// [analyzer] COMPILE_TIME_ERROR.MUST_BE_A_NATIVE_FUNCTION_TYPE

tests/ffi/static_checks/vmspecific_static_checks_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ void testNativeCallableListenerGeneric2() {
417417
generic<NativeVoidFunc>();
418418
}
419419

420+
// dart format off
421+
420422
void testNativeCallableListenerWrongNativeFunctionSignature() {
421423
/**/ NativeCallable<NativeVoidFunc>.listener(myVoidFunc2);
422424
// ^^^^^^^^^^^
@@ -1399,6 +1401,8 @@ final class AbiSpecificInteger1 extends AbiSpecificInteger {
13991401
external int b;
14001402
}
14011403

1404+
// dart format on
1405+
14021406
class AbiSpecificInteger2 implements AbiSpecificInteger {
14031407
// ^^^^^^^^^^^^^^^^^^^
14041408
// [cfe] Class 'Object' cannot be extended or implemented.

0 commit comments

Comments
 (0)