@@ -22,13 +22,12 @@ void _runJavaGC() {
22
22
);
23
23
final bean = managementFactory
24
24
.staticMethodId (
25
- 'getRuntimeMXBean' ,
26
- '()Ljava/lang/management/RuntimeMXBean;' ,
27
- )
25
+ 'getRuntimeMXBean' ,
26
+ '()Ljava/lang/management/RuntimeMXBean;' ,
27
+ )
28
28
.call (managementFactory, JObject .type, []);
29
- final pid = bean.jClass
30
- .instanceMethodId ('getPid' , '()J' )
31
- .call (bean, jlong.type, []);
29
+ final pid =
30
+ bean.jClass.instanceMethodId ('getPid' , '()J' ).call (bean, jlong.type, []);
32
31
ProcessResult result;
33
32
do {
34
33
result = Process .runSync ('jcmd' , [pid.toString (), 'GC.run' ]);
@@ -136,9 +135,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
136
135
final rand = e.getRandom ();
137
136
expect (rand, isNotNull);
138
137
final _ = e.getRandomLong ();
139
- final id = e
140
- .getRandomNumericString (rand)!
141
- .toDartString (releaseOriginal: true );
138
+ final id =
139
+ e.getRandomNumericString (rand)! .toDartString (releaseOriginal: true );
142
140
expect (int .parse (id), lessThan (10000 ));
143
141
e.setNumber (145 );
144
142
expect (
@@ -343,13 +341,17 @@ void registerTests(String groupName, TestRunnerCallback test) {
343
341
expect (
344
342
(map.get (
345
343
'Hello' .toJString ()..releasedBy (arena),
346
- )! ..releasedBy (arena)).getNumber (),
344
+ )!
345
+ ..releasedBy (arena))
346
+ .getNumber (),
347
347
1 ,
348
348
);
349
349
expect (
350
350
(map.get (
351
351
'World' .toJString ()..releasedBy (arena),
352
- )! ..releasedBy (arena)).getNumber (),
352
+ )!
353
+ ..releasedBy (arena))
354
+ .getNumber (),
353
355
2 ,
354
356
);
355
357
expect (
@@ -380,7 +382,9 @@ void registerTests(String groupName, TestRunnerCallback test) {
380
382
expect (
381
383
(map.get (
382
384
'Hello' .toJString ()..releasedBy (arena),
383
- )! ..releasedBy (arena)).getNumber (),
385
+ )!
386
+ ..releasedBy (arena))
387
+ .getNumber (),
384
388
0 ,
385
389
);
386
390
});
@@ -442,7 +446,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
442
446
final exampleStaticParent = GrandParent .varStaticParent (
443
447
S : Example .type,
444
448
Example ()..releasedBy (arena),
445
- )! ..releasedBy (arena);
449
+ )!
450
+ ..releasedBy (arena);
446
451
expect (
447
452
(exampleStaticParent.value! ..releasedBy (arena)).getNumber (),
448
453
0 ,
@@ -460,7 +465,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
460
465
final exampleParent = grandParent.varParent (
461
466
S : Example .type,
462
467
Example ()..releasedBy (arena),
463
- )! ..releasedBy (arena);
468
+ )!
469
+ ..releasedBy (arena);
464
470
expect (
465
471
exampleParent.parentValue!
466
472
.as (JString .type, releaseOriginal: true )
@@ -504,7 +510,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
504
510
final stack = MyStack .of$1 (
505
511
'Hello' .toJString ()..releasedBy (arena),
506
512
T : JString .type,
507
- )! ..releasedBy (arena);
513
+ )!
514
+ ..releasedBy (arena);
508
515
expect (stack, isA <MyStack <JString ?>>());
509
516
expect (stack.$type, isA <$MyStack$Type $<JString ?>>());
510
517
expect (stack.pop ()! .toDartString (releaseOriginal: true ), 'Hello' );
@@ -516,7 +523,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
516
523
'Hello' .toJString ()..releasedBy (arena),
517
524
'World' .toJString ()..releasedBy (arena),
518
525
T : JString .type,
519
- )! ..releasedBy (arena);
526
+ )!
527
+ ..releasedBy (arena);
520
528
expect (stack, isA <MyStack <JString ?>>());
521
529
expect (stack.$type, isA <$MyStack$Type $<JString ?>>());
522
530
expect (stack.pop ()! .toDartString (releaseOriginal: true ), 'World' );
@@ -531,7 +539,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
531
539
T : JObject .type,
532
540
'Hello' .toJString ()..releasedBy (arena),
533
541
array,
534
- )! ..releasedBy (arena);
542
+ )!
543
+ ..releasedBy (arena);
535
544
expect (stack, isA <MyStack <JObject ?>>());
536
545
expect (stack.$type, isA <$MyStack$Type $<JObject ?>>());
537
546
expect (
@@ -573,7 +582,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
573
582
final stack = MyStack .fromArrayOfArrayOfGrandParents (
574
583
S : JString .type,
575
584
twoDimentionalArray,
576
- )! ..releasedBy (arena);
585
+ )!
586
+ ..releasedBy (arena);
577
587
expect (stack, isA <MyStack <JString ?>>());
578
588
expect (stack.$type, isA <$MyStack$Type $<JString ?>>());
579
589
expect (stack.pop ()! .toDartString (releaseOriginal: true ), 'Hello' );
@@ -601,8 +611,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
601
611
return (s! .toDartString (releaseOriginal: true ) * 2 ).toJString ();
602
612
},
603
613
varCallback: (JInteger ? t) {
604
- final result = (t ! . intValue (releaseOriginal : true ) * 2 )
605
- .toJInteger ();
614
+ final result =
615
+ (t ! . intValue (releaseOriginal : true ) * 2 ) .toJInteger ();
606
616
varCallbackResult.complete (result);
607
617
return result;
608
618
},
@@ -776,7 +786,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
776
786
group ('Dart exceptions are handled' , () {
777
787
for (final exception in [UnimplementedError (), 'Hello!' ]) {
778
788
for (final sameThread in [true , false ]) {
779
- test ('on ${sameThread ? 'the same thread' : 'another thread' }'
789
+ test (
790
+ 'on ${sameThread ? 'the same thread' : 'another thread' }'
780
791
' throwing $exception ' , () async {
781
792
await using ((arena) async {
782
793
final runnable = MyRunnable .implement (
@@ -882,7 +893,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
882
893
sevenHundred = (await toDartFuture (
883
894
sevenHundredBoxed,
884
895
JInteger .type,
885
- )).intValue ();
896
+ ))
897
+ .intValue ();
886
898
}
887
899
expect (sevenHundred, 700 );
888
900
@@ -918,7 +930,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
918
930
)..releasedBy (arena);
919
931
final stringArray = genericInterface.arrayOf (
920
932
'hello' .toJString ()..releasedBy (arena),
921
- )! ..releasedBy (arena);
933
+ )!
934
+ ..releasedBy (arena);
922
935
expect (stringArray, hasLength (1 ));
923
936
expect (stringArray[0 ]! .toDartString (releaseOriginal: true ), 'hello' );
924
937
expect (
@@ -931,7 +944,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
931
944
final intArray = genericInterface.genericArrayOf (
932
945
U : JInteger .type,
933
946
42. toJInteger ()..releasedBy (arena),
934
- )! ..releasedBy (arena);
947
+ )!
948
+ ..releasedBy (arena);
935
949
expect (
936
950
genericInterface
937
951
.firstOfGenericArray (U : JInteger .type, intArray)!
@@ -943,7 +957,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
943
957
U : JInteger .type,
944
958
'hello' .toJString ()..releasedBy (arena),
945
959
42. toJInteger ()..releasedBy (arena),
946
- )! ..releasedBy (arena);
960
+ )!
961
+ ..releasedBy (arena);
947
962
expect (
948
963
jmap['hello' .toJString ()..releasedBy (arena)]! .intValue (
949
964
releaseOriginal: true ,
@@ -969,21 +984,19 @@ void registerTests(String groupName, TestRunnerCallback test) {
969
984
expect (
970
985
$R2250 .new ,
971
986
isA<
972
- $R2250 <$T > Function <$T extends JObject ?>({
973
- required JType <$T > T ,
974
- required void Function ($T ? ) foo,
975
- bool foo$async,
976
- })
977
- > (),
987
+ $R2250 <$T > Function <$T extends JObject ?>({
988
+ required JType <$T > T ,
989
+ required void Function ($T ? ) foo,
990
+ bool foo$async,
991
+ })> (),
978
992
);
979
993
expect (
980
994
$R2250$Child .new ,
981
995
isA<
982
- $R2250$Child Function ({
983
- required void Function (JObject ? ) foo,
984
- bool foo$async,
985
- })
986
- > (),
996
+ $R2250$Child Function ({
997
+ required void Function (JObject ? ) foo,
998
+ bool foo$async,
999
+ })> (),
987
1000
);
988
1001
});
989
1002
});
@@ -1062,7 +1075,9 @@ void registerTests(String groupName, TestRunnerCallback test) {
1062
1075
expect (
1063
1076
(annotated.nullableArray (
1064
1077
false ,
1065
- )! ..releasedBy (arena))[0 ].toDartString (releaseOriginal: true ),
1078
+ )!
1079
+ ..releasedBy (arena))[0 ]
1080
+ .toDartString (releaseOriginal: true ),
1066
1081
'hello' ,
1067
1082
);
1068
1083
expect (annotated.nullableArrayOfNullable (true ), isNull);
@@ -1087,7 +1102,9 @@ void registerTests(String groupName, TestRunnerCallback test) {
1087
1102
expect (
1088
1103
(annotated.nullableList (
1089
1104
false ,
1090
- )! ..releasedBy (arena))[0 ].toDartString (releaseOriginal: true ),
1105
+ )!
1106
+ ..releasedBy (arena))[0 ]
1107
+ .toDartString (releaseOriginal: true ),
1091
1108
'hello' ,
1092
1109
);
1093
1110
expect (annotated.nullableListOfNullable (true ), isNull);
@@ -1188,8 +1205,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
1188
1205
);
1189
1206
expect (
1190
1207
annotated
1191
- // Requires `V`.
1192
- .nullableReturnMethodGenericEcho (object, true , V : JString .type),
1208
+ // Requires `V`.
1209
+ .nullableReturnMethodGenericEcho (object, true , V : JString .type),
1193
1210
isNull,
1194
1211
);
1195
1212
expect (
@@ -1202,8 +1219,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
1202
1219
);
1203
1220
expect (
1204
1221
annotated
1205
- // `V` is optional.
1206
- .nullableReturnMethodGenericEcho2 (object, true ),
1222
+ // `V` is optional.
1223
+ .nullableReturnMethodGenericEcho2 (object, true ),
1207
1224
isNull,
1208
1225
);
1209
1226
expect (
@@ -1270,8 +1287,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
1270
1287
final annotated = newNonNullTestObject (arena);
1271
1288
expect (
1272
1289
(annotated.classGenericList ()..releasedBy (arena)).first.toDartString (
1273
- releaseOriginal: true ,
1274
- ),
1290
+ releaseOriginal: true ,
1291
+ ),
1275
1292
'hello' ,
1276
1293
);
1277
1294
expect (
@@ -1282,14 +1299,19 @@ void registerTests(String groupName, TestRunnerCallback test) {
1282
1299
expect (
1283
1300
(annotated.nullableClassGenericList (
1284
1301
false ,
1285
- )! ..releasedBy (arena)).first.toDartString (releaseOriginal: true ),
1302
+ )!
1303
+ ..releasedBy (arena))
1304
+ .first
1305
+ .toDartString (releaseOriginal: true ),
1286
1306
'hello' ,
1287
1307
);
1288
1308
expect (annotated.nullableClassGenericListOfNullable (true ), isNull);
1289
1309
expect (
1290
1310
(annotated.nullableClassGenericListOfNullable (
1291
1311
false ,
1292
- )! ..releasedBy (arena)).first,
1312
+ )!
1313
+ ..releasedBy (arena))
1314
+ .first,
1293
1315
isNull,
1294
1316
);
1295
1317
});
0 commit comments