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

Unified Diff: runtime/tests/vm/dart/random_walk_fuzzer.dart

Issue 2759973004: Fix observatory tests broken by running dartfmt. Temporarily reverted formatting for evaluate_activ… (Closed)
Patch Set: Created 3 years, 9 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
Index: runtime/tests/vm/dart/random_walk_fuzzer.dart
diff --git a/runtime/tests/vm/dart/random_walk_fuzzer.dart b/runtime/tests/vm/dart/random_walk_fuzzer.dart
index 71c05136fe1e54e660242f5fa7cb03cb99350a88..224fab9f86573ab5b188e63a9c9b0cf9b4c20499 100644
--- a/runtime/tests/vm/dart/random_walk_fuzzer.dart
+++ b/runtime/tests/vm/dart/random_walk_fuzzer.dart
@@ -47,7 +47,7 @@ void main(List<String> args) {
seed = (seed << 8) | f.readByteSync();
seed = (seed << 8) | f.readByteSync();
f.close();
- } catch(e) {
+ } catch (e) {
print("Failed to read from /dev/urandom: $e");
}
@@ -108,7 +108,7 @@ void addInstance(var instance) {
}
void addInstanceMirror(InstanceMirror mirror,
- [Candidate origin, String message]) {
+ [Candidate origin, String message]) {
var c = new Candidate<InstanceMirror>();
c.mirror = mirror;
c.origin = origin;
@@ -170,18 +170,18 @@ void setupInterestingValues() {
addInstance(double.MIN_POSITIVE);
addInstance(double.MAX_FINITE);
- addInstance("foo"); // ASCII string
- addInstance("blåbærgrød"); // Latin1 string
- addInstance("Îñţérñåţîöñåļîžåţîờñ"); // Unicode string
- addInstance("𝄞"); // Surrogate pairs
- addInstance("𝄞"[0]); // Surrogate pairs
- addInstance("𝄞"[1]); // Surrogate pairs
- addInstance("\u{0}"); // Non-printing charater
- addInstance("\u{1}"); // Non-printing charater
- addInstance("f\u{0}oo"); // Internal NUL
- addInstance("blåbæ\u{0}rgrød"); // Internal NUL
- addInstance("Îñţérñåţîö\u{0}ñåļîžåţîờñ"); // Internal NUL
- addInstance("\u{0}𝄞"); // Internal NUL
+ addInstance("foo"); // ASCII string
+ addInstance("blåbærgrød"); // Latin1 string
+ addInstance("Îñţérñåţîöñåļîžåţîờñ"); // Unicode string
+ addInstance("𝄞"); // Surrogate pairs
+ addInstance("𝄞"[0]); // Surrogate pairs
+ addInstance("𝄞"[1]); // Surrogate pairs
+ addInstance("\u{0}"); // Non-printing charater
+ addInstance("\u{1}"); // Non-printing charater
+ addInstance("f\u{0}oo"); // Internal NUL
+ addInstance("blåbæ\u{0}rgrød"); // Internal NUL
+ addInstance("Îñţérñåţîö\u{0}ñåļîžåţîờñ"); // Internal NUL
+ addInstance("\u{0}𝄞"); // Internal NUL
for (int len = 0; len < 8; len++) {
addInstance(fillInt(new Int8List(len)));
@@ -199,6 +199,7 @@ void setupInterestingValues() {
randomInstance(ignore) {
return randomElementOf(candidateArguments).mirror.reflectee;
}
+
for (int len = 0; len < 8; len++) {
addInstance(new List.generate(len, randomInstance));
}
@@ -218,7 +219,7 @@ void fillFloat(TypedData d) {
void setupClasses() {
currentMirrorSystem().libraries.values.forEach((lib) {
- if (lib.simpleName == #fuzzer) return; // Don't recurse.
+ if (lib.simpleName == #fuzzer) return; // Don't recurse.
addObjectMirror(lib);
lib.declarations.values.forEach((decl) {
if (decl is ClassMirror) {
@@ -230,11 +231,12 @@ void setupClasses() {
MethodMirror randomMethodOf(receiver) {
if (receiver is ClassMirror) {
- return randomElementOf(receiver.declarations.values.where(
- (d) => d is MethodMirror && d.isStatic).toList());
+ return randomElementOf(receiver.declarations.values
+ .where((d) => d is MethodMirror && d.isStatic)
+ .toList());
} else if (receiver is LibraryMirror) {
- return randomElementOf(receiver.declarations.values.where(
- (d) => d is MethodMirror).toList());
+ return randomElementOf(
+ receiver.declarations.values.where((d) => d is MethodMirror).toList());
} else if (receiver is InstanceMirror) {
var methods = [];
var cls = receiver.type;
@@ -283,19 +285,19 @@ void fuzz(Candidate c) {
if (method.isConstructor) {
try {
result = receiver.newInstance(method.simpleName, positional, named);
- } catch(e) {}
+ } catch (e) {}
} else if (method.isRegularMethod) {
try {
result = receiver.invoke(method.simpleName, positional, named);
- } catch(e) {}
+ } catch (e) {}
} else if (method.isGetter) {
try {
result = receiver.getField(method.simpleName);
- } catch(e) {}
+ } catch (e) {}
} else if (method.isSetter) {
try {
result = receiver.setField(method.simpleName, positional[0]);
- } catch(e) {}
+ } catch (e) {}
}
if (result != null) {
@@ -339,7 +341,7 @@ Map randomNamedArgumentsFor(MethodMirror method) {
void garbageCollect() {
// Chain a bunch of moderately sized arrays, then let go of them. Using a
- // moderate size avoids our allocations going directly to a large object
+ // moderate size avoids our allocations going directly to a large object
// page in old space.
var n;
for (int i = 0; i < 2048; i++) {
« no previous file with comments | « runtime/tests/vm/dart/optimized_stacktrace_line_test.dart ('k') | runtime/tests/vm/dart/redirection_type_shuffling_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698