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

Unified Diff: tests/standalone/typed_data_view_test.dart

Issue 12531009: Fix typo in method calls for [] and []= operators in views. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « tests/standalone/standalone.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/typed_data_view_test.dart
===================================================================
--- tests/standalone/typed_data_view_test.dart (revision 0)
+++ tests/standalone/typed_data_view_test.dart (revision 0)
@@ -0,0 +1,35 @@
+import 'dart:typeddata';
+
+validate(TypedData list, num expected) {
+ for (int i = 0; i < list.length; i++) {
+ Expect.equals(expected, list[i]);
+ }
+}
+
+main() {
+ var list = new Int8List(128);
+ for (var i = 0; i < list.length; i++) {
+ list[i] = 42;
+ }
+ var ba = list.buffer;
+
+ var slist = new Int16List.view(ba, 0, 32);
+ validate(slist, 10794);
+ var uslist = new Uint16List.view(ba, 0, 32);
+ validate(uslist, 10794);
+
+ var ilist = new Int32List.view(ba, 0, 16);
+ validate(ilist, 707406378);
+ var uilist = new Uint32List.view(ba, 0, 16);
+ validate(uilist, 707406378);
+
+ var llist = new Int64List.view(ba, 0, 8);
+ validate(llist, 3038287259199220266);
+ var ullist = new Uint64List.view(ba, 0, 8);
+ validate(ullist, 3038287259199220266);
+
+ var flist = new Float32List.view(ba, 0, 16);
+ validate(flist, 1.511366173271439e-13);
+ var dlist = new Float64List.view(ba, 0, 8);
+ validate(dlist, 1.4260258159703532e-105);
+}
« no previous file with comments | « tests/standalone/standalone.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698