Chromium Code Reviews| Index: tests/lib/typeddata/float32x4_list_test.dart |
| diff --git a/tests/lib/typeddata/float32x4_list_test.dart b/tests/lib/typeddata/float32x4_list_test.dart |
| index 230d837d8d5a2c7987caace3f0f3eb48e1927c1e..941d31652009883f755d9416f94172b960736e2d 100644 |
| --- a/tests/lib/typeddata/float32x4_list_test.dart |
| +++ b/tests/lib/typeddata/float32x4_list_test.dart |
| @@ -28,6 +28,72 @@ testLoadStore(array) { |
| Expect.equals(4.0, array[1].w); |
| } |
|
srdjan
2013/04/10 15:33:23
s/Deop/Deopt/ below.
Cutch
2013/04/10 16:36:13
Done.
|
| +testLoadStoreDeop(array, index, value) { |
| + array[index] = value; |
| + Expect.equals(value.x, array[index].x); |
| + Expect.equals(value.y, array[index].y); |
| + Expect.equals(value.z, array[index].z); |
| + Expect.equals(value.w, array[index].w); |
| +} |
| + |
| +testLoadStoreDeopDriver() { |
| + Float32x4List list = new Float32x4List(4); |
| + Float32x4 value = new Float32x4(1.0, 2.0, 3.0, 4.0); |
| + for (int i = 0; i < 3000; i++) { |
| + testLoadStoreDeop(list, 0, value); |
| + } |
| + try { |
| + // Invalid index. |
| + testLoadStoreDeop(list, 5, value); |
| + } catch (_) {} |
| + for (int i = 0; i < 3000; i++) { |
| + testLoadStoreDeop(list, 0, value); |
| + } |
| + try { |
| + // null list. |
| + testLoadStoreDeop(null, 0, value); |
| + } catch (_) {} |
| + for (int i = 0; i < 3000; i++) { |
| + testLoadStoreDeop(list, 0, value); |
| + } |
| + try { |
| + // null value. |
| + testLoadStoreDeop(list, 0, null); |
| + } catch (_) {} |
| + for (int i = 0; i < 3000; i++) { |
| + testLoadStoreDeop(list, 0, value); |
| + } |
| + try { |
| + // non-smi index. |
| + testLoadStoreDeop(list, 3.14159, value); |
| + } catch (_) {} |
| + for (int i = 0; i < 3000; i++) { |
| + testLoadStoreDeop(list, 0, value); |
| + } |
| + try { |
| + // non-Float32x4 value. |
| + testLoadStoreDeop(list, 0, 4.toDouble()); |
| + } catch (_) {} |
| + for (int i = 0; i < 3000; i++) { |
| + testLoadStoreDeop(list, 0, value); |
| + } |
| + try { |
| + // non-Float32x4List list. |
| + testLoadStoreDeop([new Float32x4(2.0, 3.0, 4.0, 5.0)], 0, value); |
| + } catch (_) {} |
| + for (int i = 0; i < 3000; i++) { |
| + testLoadStoreDeop(list, 0, value); |
| + } |
| +} |
| + |
| +testListZero() { |
| + Float32x4List list = new Float32x4List(1); |
| + Expect.equals(0.0, list[0].x); |
| + Expect.equals(0.0, list[0].y); |
| + Expect.equals(0.0, list[0].z); |
| + Expect.equals(0.0, list[0].w); |
| +} |
| + |
| testView(array) { |
| Expect.equals(8, array.length); |
| Expect.isTrue(array is List<Float32x4>); |
| @@ -64,4 +130,8 @@ main() { |
| for (int i = 0; i < 3000; i++) { |
| testLoadStore(list); |
| } |
| + for (int i = 0; i < 3000; i++) { |
| + testListZero(); |
| + } |
| + testLoadStoreDeopDriver(); |
| } |