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

Unified Diff: test/typed_buffers_test.dart

Issue 1385333007: Use the new test runner. (Closed) Base URL: git@github.com:dart-lang/typed_data@master
Patch Set: Code review changes Created 5 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 | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/typed_buffers_test.dart
diff --git a/test/typed_buffers_test.dart b/test/typed_buffers_test.dart
index 1cb37b00ea5a63b20585bf18f3b1c374cec2c54f..b5f907cd8e21caa4b049888541180f129efa2ae3 100644
--- a/test/typed_buffers_test.dart
+++ b/test/typed_buffers_test.dart
@@ -4,10 +4,11 @@
// Tests typed-data buffer classes.
-import "package:typed_data/typed_buffers.dart";
-import "package:unittest/unittest.dart";
import "dart:typed_data";
+import "package:test/test.dart";
+import "package:typed_data/typed_buffers.dart";
+
main() {
testUint(8, (l) => new Uint8Buffer(l));
testInt(8, (l) => new Int8Buffer(l));
@@ -18,8 +19,12 @@ main() {
testInt(16, (l) => new Int16Buffer(l));
testUint(32, (l) => new Uint32Buffer(l)); /// 01: ok
testInt(32, (l) => new Int32Buffer(l));
- testUint(64, (l) => new Uint64Buffer(l)); /// 01: continued
- testInt(64, (l) => new Int64Buffer(l)); /// 01: continued
+ testUint(64, (l) => new Uint64Buffer(l), /// 01: continued
+ // JS doesn't support 64-bit ints, so only test this on the VM.
+ testOn: "dart-vm");
+ testInt(64, (l) => new Int64Buffer(l), /// 01: continued
+ // JS doesn't support 64-bit ints, so only test this on the VM.
+ testOn: "dart-vm");
testInt32x4Buffer(intSamples);
@@ -52,21 +57,21 @@ Rounder roundInt(bits) {
int clampUint8(x) => x < 0 ? 0 : x > 255 ? 255 : x;
-void testUint(int bits, var buffer) {
+void testUint(int bits, var buffer, {String testOn}) {
int min = 0;
Function round = roundUint(bits);
int max = round(-1);
test("Uint${bits}Buffer", () {
testIntBuffer(bits, min, max, buffer, round);
- });
+ }, testOn: testOn);
}
-void testInt(int bits, var buffer) {
+void testInt(int bits, var buffer, {String testOn}) {
int min = -(1 << (bits - 1));
int max = -(min + 1);
test("Int${bits}Buffer", () {
testIntBuffer(bits, min, max, buffer, roundInt(bits));
- });
+ }, testOn: testOn);
}
const List<int> intSamples = const [
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698