Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: tests/lib/mirrors/invocation_fuzz_test.dart

Issue 594183003: Mark _Bigint._mulAdd and conversion methods in typed_data as invisible. Strengthen the mirror invoc… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/lib.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/invocation_fuzz_test.dart
diff --git a/tests/lib/mirrors/invocation_fuzz_test.dart b/tests/lib/mirrors/invocation_fuzz_test.dart
index 4d81cf8526e83c7a6c17bb76a25c5dd4d0251841..7ec1b87b5463118da3b594bf9e74161c6ddb5be1 100644
--- a/tests/lib/mirrors/invocation_fuzz_test.dart
+++ b/tests/lib/mirrors/invocation_fuzz_test.dart
@@ -3,14 +3,14 @@
// BSD-style license that can be found in the LICENSE file.
// This test reflectively enumerates all the methods in the system and tries to
-// invoke them will all nulls. This may result in Dart exceptions or hangs, but
-// should never result in crashes or JavaScript exceptions.
+// invoke them will various basic values (nulls, ints, etc). This may result in
+// Dart exceptions or hangs, but should never result in crashes or JavaScript
+// exceptions.
library test.invoke_natives;
import 'dart:mirrors';
import 'dart:async';
-import 'package:expect/expect.dart';
// Methods to be skipped, by qualified name.
var blacklist = [
@@ -26,11 +26,17 @@ var blacklist = [
// These prevent the test from exiting.
'dart.async._scheduleAsyncCallback',
'dart.async._setTimerFactoryClosure',
-
'dart.isolate._startMainIsolate',
'dart.isolate._startIsolate',
'dart.io.sleep',
'dart.io.HttpServer.HttpServer.listenOn',
+ new RegExp(r'dart.io.*'), /// smi: ok
+
+ // Runtime exceptions we can't catch because they occur too early in event
+ // dispatch to be caught in a zone.
+ 'dart.isolate._isolateScheduleImmediate',
+ 'dart.io._Timer._createTimer', /// smi: ok
+ 'dart.async.runZoned', /// string: ok
// These either cause the VM to segfault or throw uncatchable API errors.
// TODO(15274): Fix them and remove from blacklist.
@@ -43,7 +49,10 @@ var blacklist = [
'dart.io._FileSystemWatcher._listenOnSocket',
'dart.io.SystemEncoding.decode',
'dart.io.SystemEncoding.encode',
- 'dart.core._Bigint._mulAdd', // TODO(regis): Is this an intrinsic issue?
+ 'dart.core.StringBuffer.toString', /// emptyarray: ok
+
+ // See Object_toString and Issue 20583
+ 'dart.core.Error._objectToString', /// string: ok
];
bool isBlacklisted(Symbol qualifiedSymbol) {
@@ -68,7 +77,8 @@ checkMethod(MethodMirror m, ObjectMirror target, [origin]) {
if (m.isRegularMethod) {
task.action =
- () => target.invoke(m.simpleName, new List(m.parameters.length));
+ () => target.invoke(m.simpleName,
+ new List.filled(m.parameters.length, fuzzArgument));
} else if (m.isGetter) {
task.action =
() => target.getField(m.simpleName);
@@ -107,8 +117,9 @@ checkClass(classMirror) {
task.name = MirrorSystem.getName(m.qualifiedName);
task.action = () {
- var instance = classMirror.newInstance(m.constructorName,
- new List(m.parameters.length));
+ var instance = classMirror.newInstance(
+ m.constructorName,
+ new List.filled(m.parameters.length, fuzzArgument));
checkInstance(instance, task.name);
};
queue.add(task);
@@ -149,13 +160,21 @@ doOneTask() {
testZone.createTimer(Duration.ZERO, doOneTask);
}
+var fuzzArgument;
+
main([args]) {
+ fuzzArgument = null;
+ fuzzArgument = 1; /// smi: ok
+ fuzzArgument = false; /// false: ok
+ fuzzArgument = 'string'; /// string: ok
+ fuzzArgument = new List(0); /// emptyarray: ok
+
currentMirrorSystem().libraries.values.forEach(checkLibrary);
var valueObjects =
[true, false, null,
0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF,
- "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ'];
+ "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "𝄞", #symbol];
valueObjects.forEach((v) => checkInstance(reflect(v), 'value object'));
uncaughtErrorHandler(self, parent, zone, error, stack) {};
« no previous file with comments | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698