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

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

Issue 14332002: Add endian parameter to the get/set functions in ByteData. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/byte_array_test.dart
===================================================================
--- runtime/tests/vm/dart/byte_array_test.dart (revision 21661)
+++ runtime/tests/vm/dart/byte_array_test.dart (working copy)
@@ -991,7 +991,7 @@
for (int i = 0; i < array.length; ++i) {
array[i] = 0xFF - i;
}
- byte_array.setUint32(0, 0xBF800000);
+ byte_array.setUint32(0, 0xBF800000, Endianness.LITTLE_ENDIAN);
Expect.equals(0, byte_array.getInt8(0));
Expect.equals(0, byte_array.getInt8(1));
Expect.equals(-128, byte_array.getInt8(2));
@@ -1009,18 +1009,22 @@
Expect.equals(0xF9, byte_array.getUint8(6));
Expect.equals(0xF8, byte_array.getUint8(7));
Expect.equals(0, byte_array.getInt16(0));
- Expect.equals(-16512, byte_array.getInt16(2));
- Expect.equals(-1285, byte_array.getInt16(4));
- Expect.equals(-1799, byte_array.getInt16(6));
- Expect.equals(0x0000, byte_array.getUint16(0));
- Expect.equals(0xBF80, byte_array.getUint16(2));
- Expect.equals(0xFAFB, byte_array.getUint16(4));
- Expect.equals(0xF8F9, byte_array.getUint16(6));
- Expect.equals(-1082130432, byte_array.getInt32(0));
- Expect.equals(0xBF800000, byte_array.getUint32(0));
- Expect.equals(-506097523945897984, byte_array.getInt64(0));
- Expect.equals(0xF8F9FAFBBF800000, byte_array.getUint64(0));
- Expect.equals(-1.0, byte_array.getFloat32(0));
+ Expect.equals(-16512, byte_array.getInt16(2, Endianness.LITTLE_ENDIAN));
+ Expect.equals(-1285, byte_array.getInt16(4, Endianness.LITTLE_ENDIAN));
+ Expect.equals(-1799, byte_array.getInt16(6, Endianness.LITTLE_ENDIAN));
+ Expect.equals(0x0000, byte_array.getUint16(0, Endianness.LITTLE_ENDIAN));
+ Expect.equals(0xBF80, byte_array.getUint16(2, Endianness.LITTLE_ENDIAN));
+ Expect.equals(0xFAFB, byte_array.getUint16(4, Endianness.LITTLE_ENDIAN));
+ Expect.equals(0xF8F9, byte_array.getUint16(6, Endianness.LITTLE_ENDIAN));
+ Expect.equals(-1082130432,
+ byte_array.getInt32(0, Endianness.LITTLE_ENDIAN));
+ Expect.equals(0xBF800000,
+ byte_array.getUint32(0, Endianness.LITTLE_ENDIAN));
+ Expect.equals(-506097523945897984,
+ byte_array.getInt64(0, Endianness.LITTLE_ENDIAN));
+ Expect.equals(0xF8F9FAFBBF800000,
+ byte_array.getUint64(0, Endianness.LITTLE_ENDIAN));
+ Expect.equals(-1.0, byte_array.getFloat32(0, Endianness.LITTLE_ENDIAN));
// TODO: byte_array.getFloat64(0)
}

Powered by Google App Engine
This is Rietveld 408576698