2019-06-18 13:17:14 +00:00
|
|
|
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
2019-11-27 17:23:31 +00:00
|
|
|
|
2021-07-16 09:13:28 +00:00
|
|
|
// VMOptions=--enable-isolate-groups
|
2019-11-27 17:23:31 +00:00
|
|
|
// VMOptions=--no-enable-isolate-groups
|
2019-06-18 13:17:14 +00:00
|
|
|
//
|
|
|
|
// Checks that the VM throws an appropriate exception when FFI objects are
|
|
|
|
// passed between isolates.
|
|
|
|
|
|
|
|
import 'dart:ffi';
|
|
|
|
import 'dart:isolate';
|
|
|
|
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
|
|
|
|
main(args) async {
|
|
|
|
try {
|
2019-07-02 23:12:13 +00:00
|
|
|
await Isolate.spawn(print, Pointer<Void>.fromAddress(1));
|
2019-06-18 13:17:14 +00:00
|
|
|
} catch (e) {
|
|
|
|
Expect.type<ArgumentError>(e);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
throw "Test didn't throw an exception!";
|
|
|
|
}
|