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

Unified Diff: tests/language/vm/optimized_guarded_field_test.dart

Issue 104583002: Small cleanup and more test coverage for guarded fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/optimized_guarded_field_test.dart
===================================================================
--- tests/language/vm/optimized_guarded_field_test.dart (revision 30852)
+++ tests/language/vm/optimized_guarded_field_test.dart (working copy)
@@ -6,6 +6,7 @@
// VMOptions=--optimization_counter_threshold=10
import "package:expect/expect.dart";
+import "dart:typed_data";
class A {
var foo;
@@ -52,6 +53,24 @@
}
+class D {
+ final List f;
+ final Uint8List g;
+ D(this.f, this.g);
+ D.named(this.f, this.g);
+}
+
+
+test_guarded_length() {
+ var a = new D(new List(5), new Uint8List(5));
+ var b = new D.named(new List(5), new Uint8List(5));
+ Expect.equals(5, a.f.length);
+ Expect.equals(5, b.f.length);
+ Expect.equals(5, a.g.length);
+ Expect.equals(5, b.g.length);
+}
+
+
main() {
var a = new A();
var b = new B();
@@ -76,4 +95,7 @@
// Regression test for fields initialized in native code (Error._stackTrace).
test_stacktrace();
+
+ // Test guarded list length.
+ for (var i = 0; i < 20; i++) test_guarded_length();
}
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698