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

Unified Diff: tests/standalone/float_array_test.dart

Issue 11144021: Fix crashes in intrinsified float32/float64 array setters when attempting to store a Smi. Added tes… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | « runtime/vm/intrinsifier_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/float_array_test.dart
===================================================================
--- tests/standalone/float_array_test.dart (revision 13660)
+++ tests/standalone/float_array_test.dart (working copy)
@@ -82,6 +82,17 @@
Expect.equals(-1, list.indexOf(20.0));
}
+void testBadValues32() {
+ var list = new Float32List(10);
+ list[0] = 2.0;
+ Expect.throws(() {
+ list[0] = 2;
+ });
+ Expect.throws(() {
+ list[0] = "hello";
+ });
+}
+
void testCreateFloat64Array() {
Float64List floatArray;
@@ -155,6 +166,17 @@
Expect.equals(-1, list.indexOf(20.0));
}
+void testBadValues64() {
+ var list = new Float64List(10);
+ list[0] = 2.0;
+ Expect.throws(() {
+ list[0] = 2;
+ });
+ Expect.throws(() {
+ list[0] = "hello";
+ });
+}
+
main() {
for (int i = 0; i < 2000; i++) {
testCreateFloat32Array();
@@ -168,4 +190,7 @@
testIndexOutOfRange64();
testIndexOf64();
}
+ // These two take a long time in checked mode.
+ testBadValues32();
+ testBadValues64();
}
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698