Skip to content

Commit 36117c4

Browse files
munificentCommit Queue
authored andcommitted
Format tests/lib/typed_data/ using 3.8 style.
Change-Id: I85d53883d8f976246cae6f3caece157f906cf829 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426320 Auto-Submit: Bob Nystrom <[email protected]> Commit-Queue: Lasse Nielsen <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]>
1 parent 8717ff6 commit 36117c4

12 files changed

+433
-169
lines changed

tests/lib/typed_data/bytes_builder_test.dart

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,24 @@ main() {
4848
bytes = b.takeBytes();
4949
testLength(0);
5050
Expect.isTrue(bytes is Uint8List);
51-
Expect.listEquals(
52-
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], bytes);
51+
Expect.listEquals([
52+
0,
53+
1,
54+
2,
55+
3,
56+
4,
57+
5,
58+
6,
59+
7,
60+
8,
61+
9,
62+
10,
63+
11,
64+
12,
65+
13,
66+
14,
67+
15,
68+
], bytes);
5369

5470
b.addByte(0);
5571
testLength(1);

tests/lib/typed_data/float32x4_compare_test.dart

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import "package:expect/expect.dart";
1010

1111
testEqual() {
1212
var a = new Float32x4(
13-
double.nan, double.infinity, double.negativeInfinity, double.nan);
13+
double.nan,
14+
double.infinity,
15+
double.negativeInfinity,
16+
double.nan,
17+
);
1418
var b = new Float32x4(0.0, 0.0, 0.0, double.nan);
1519
var c = a.equal(b);
1620
var d = b.equal(a);
@@ -26,7 +30,11 @@ testEqual() {
2630

2731
testNotEqual() {
2832
var a = new Float32x4(
29-
double.nan, double.infinity, double.negativeInfinity, double.nan);
33+
double.nan,
34+
double.infinity,
35+
double.negativeInfinity,
36+
double.nan,
37+
);
3038
var b = new Float32x4(0.0, 0.0, 0.0, double.nan);
3139
var c = a.notEqual(b);
3240
var d = b.notEqual(a);
@@ -42,7 +50,11 @@ testNotEqual() {
4250

4351
testLessThan() {
4452
var a = new Float32x4(
45-
double.nan, double.infinity, double.negativeInfinity, double.nan);
53+
double.nan,
54+
double.infinity,
55+
double.negativeInfinity,
56+
double.nan,
57+
);
4658
var b = new Float32x4(0.0, 0.0, 0.0, double.nan);
4759
var c = a.lessThan(b);
4860
var d = b.lessThan(a);
@@ -58,7 +70,11 @@ testLessThan() {
5870

5971
testLessThanOrEqual() {
6072
var a = new Float32x4(
61-
double.nan, double.infinity, double.negativeInfinity, double.nan);
73+
double.nan,
74+
double.infinity,
75+
double.negativeInfinity,
76+
double.nan,
77+
);
6278
var b = new Float32x4(0.0, 0.0, 0.0, double.nan);
6379
var c = a.lessThanOrEqual(b);
6480
var d = b.lessThanOrEqual(a);
@@ -74,7 +90,11 @@ testLessThanOrEqual() {
7490

7591
testGreaterThan() {
7692
var a = new Float32x4(
77-
double.nan, double.infinity, double.negativeInfinity, double.nan);
93+
double.nan,
94+
double.infinity,
95+
double.negativeInfinity,
96+
double.nan,
97+
);
7898
var b = new Float32x4(0.0, 0.0, 0.0, double.nan);
7999
var c = a.greaterThan(b);
80100
var d = b.greaterThan(a);
@@ -90,7 +110,11 @@ testGreaterThan() {
90110

91111
testGreaterThanOrEqual() {
92112
var a = new Float32x4(
93-
double.nan, double.infinity, double.negativeInfinity, double.nan);
113+
double.nan,
114+
double.infinity,
115+
double.negativeInfinity,
116+
double.nan,
117+
);
94118
var b = new Float32x4(0.0, 0.0, 0.0, double.nan);
95119
var c = a.greaterThanOrEqual(b);
96120
var d = b.greaterThan(a);

tests/lib/typed_data/float64x2_clamp_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ void testClamp() {
3232
void testNonZeroClamp() {
3333
Float64x2 l = new Float64x2(-pow(123456.789, 123.1) as double, -234567.89);
3434
Float64x2 u = new Float64x2(pow(123456.789, 123.1) as double, 234567.89);
35-
Float64x2 v =
36-
new Float64x2(-pow(123456789.123, 123.1) as double, 234567890.123);
35+
Float64x2 v = new Float64x2(
36+
-pow(123456789.123, 123.1) as double,
37+
234567890.123,
38+
);
3739
Float64x2 a = v.clamp(l, u);
3840
Expect.equals(a.x, -pow(123456.789, 123) as double);
3941
Expect.equals(a.y, 234567.89);

tests/lib/typed_data/polymorphic_unmodifiable_typed_data_test.dart

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ testUint16() {
115115
writeUint16(internal);
116116
}
117117

118-
var view =
119-
new Uint16List.view(new Uint16List(kListSize).buffer, 0, kListSize);
118+
var view = new Uint16List.view(
119+
new Uint16List(kListSize).buffer,
120+
0,
121+
kListSize,
122+
);
120123
for (var i = 0; i < kLoopSize; i++) {
121124
readUint16(view);
122125
}
@@ -196,8 +199,11 @@ testUint32() {
196199
writeUint32(internal);
197200
}
198201

199-
var view =
200-
new Uint32List.view(new Uint32List(kListSize).buffer, 0, kListSize);
202+
var view = new Uint32List.view(
203+
new Uint32List(kListSize).buffer,
204+
0,
205+
kListSize,
206+
);
201207
for (var i = 0; i < kLoopSize; i++) {
202208
readUint32(view);
203209
}
@@ -277,8 +283,11 @@ testUint64() {
277283
writeUint64(internal);
278284
}
279285

280-
var view =
281-
new Uint64List.view(new Uint64List(kListSize).buffer, 0, kListSize);
286+
var view = new Uint64List.view(
287+
new Uint64List(kListSize).buffer,
288+
0,
289+
kListSize,
290+
);
282291
for (var i = 0; i < kLoopSize; i++) {
283292
readUint64(view);
284293
}
@@ -358,8 +367,11 @@ testFloat32() {
358367
writeFloat32(internal);
359368
}
360369

361-
var view =
362-
new Float32List.view(new Float32List(kListSize).buffer, 0, kListSize);
370+
var view = new Float32List.view(
371+
new Float32List(kListSize).buffer,
372+
0,
373+
kListSize,
374+
);
363375
for (var i = 0; i < kLoopSize; i++) {
364376
readFloat32(view);
365377
}
@@ -399,8 +411,11 @@ testFloat64() {
399411
writeFloat64(internal);
400412
}
401413

402-
var view =
403-
new Float64List.view(new Float64List(kListSize).buffer, 0, kListSize);
414+
var view = new Float64List.view(
415+
new Float64List(kListSize).buffer,
416+
0,
417+
kListSize,
418+
);
404419
for (var i = 0; i < kLoopSize; i++) {
405420
readFloat64(view);
406421
}
@@ -443,8 +458,11 @@ testInt32x4() {
443458
writeInt32x4(internal);
444459
}
445460

446-
var view =
447-
new Int32x4List.view(new Int32x4List(kListSize).buffer, 0, kListSize);
461+
var view = new Int32x4List.view(
462+
new Int32x4List(kListSize).buffer,
463+
0,
464+
kListSize,
465+
);
448466
for (var i = 0; i < kLoopSize; i++) {
449467
readInt32x4(view);
450468
}
@@ -487,8 +505,11 @@ testFloat32x4() {
487505
writeFloat32x4(internal);
488506
}
489507

490-
var view =
491-
new Float32x4List.view(new Float32x4List(kListSize).buffer, 0, kListSize);
508+
var view = new Float32x4List.view(
509+
new Float32x4List(kListSize).buffer,
510+
0,
511+
kListSize,
512+
);
492513
for (var i = 0; i < kLoopSize; i++) {
493514
readFloat32x4(view);
494515
}
@@ -529,8 +550,11 @@ testFloat64x2() {
529550
writeFloat64x2(internal);
530551
}
531552

532-
var view =
533-
new Float64x2List.view(new Float64x2List(kListSize).buffer, 0, kListSize);
553+
var view = new Float64x2List.view(
554+
new Float64x2List(kListSize).buffer,
555+
0,
556+
kListSize,
557+
);
534558
for (var i = 0; i < kLoopSize; i++) {
535559
readFloat64x2(view);
536560
}

tests/lib/typed_data/simd_type_null_params_test.dart

Lines changed: 68 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,59 @@ main() {
2727
Expect.equals(true, throwsTypeError(() => float32x4 / dynamicNull));
2828
Expect.equals(true, throwsTypeError(() => float32x4.lessThan(dynamicNull)));
2929
Expect.equals(
30-
true, throwsTypeError(() => float32x4.lessThanOrEqual(dynamicNull)));
30+
true,
31+
throwsTypeError(() => float32x4.lessThanOrEqual(dynamicNull)),
32+
);
3133
Expect.equals(
32-
true, throwsTypeError(() => float32x4.greaterThan(dynamicNull)));
34+
true,
35+
throwsTypeError(() => float32x4.greaterThan(dynamicNull)),
36+
);
3337
Expect.equals(
34-
true, throwsTypeError(() => float32x4.greaterThanOrEqual(dynamicNull)));
38+
true,
39+
throwsTypeError(() => float32x4.greaterThanOrEqual(dynamicNull)),
40+
);
3541
Expect.equals(true, throwsTypeError(() => float32x4.equal(dynamicNull)));
3642
Expect.equals(true, throwsTypeError(() => float32x4.notEqual(dynamicNull)));
3743
Expect.equals(true, throwsTypeError(() => float32x4.scale(dynamicNull)));
3844
Expect.equals(
39-
true, throwsTypeError(() => float32x4.clamp(dynamicNull, float32x4)));
45+
true,
46+
throwsTypeError(() => float32x4.clamp(dynamicNull, float32x4)),
47+
);
4048
Expect.equals(
41-
true, throwsTypeError(() => float32x4.clamp(float32x4, dynamicNull)));
49+
true,
50+
throwsTypeError(() => float32x4.clamp(float32x4, dynamicNull)),
51+
);
4252
Expect.equals(true, throwsTypeError(() => float32x4.shuffle(dynamicNull)));
43-
Expect.equals(true,
44-
throwsTypeError(() => float32x4.shuffleMix(float32x4, dynamicNull)));
4553
Expect.equals(
46-
true, throwsTypeError(() => float32x4.shuffleMix(dynamicNull, 0)));
54+
true,
55+
throwsTypeError(() => float32x4.shuffleMix(float32x4, dynamicNull)),
56+
);
57+
Expect.equals(
58+
true,
59+
throwsTypeError(() => float32x4.shuffleMix(dynamicNull, 0)),
60+
);
4761
Expect.equals(true, throwsTypeError(() => float32x4.withX(dynamicNull)));
4862
Expect.equals(true, throwsTypeError(() => float32x4.withY(dynamicNull)));
4963
Expect.equals(true, throwsTypeError(() => float32x4.withZ(dynamicNull)));
5064
Expect.equals(true, throwsTypeError(() => float32x4.withW(dynamicNull)));
5165
Expect.equals(true, throwsTypeError(() => float32x4.min(dynamicNull)));
5266
Expect.equals(true, throwsTypeError(() => float32x4.max(dynamicNull)));
5367
Expect.equals(
54-
true, throwsTypeError(() => Float32x4(dynamicNull, 0.0, 0.0, 0.0)));
68+
true,
69+
throwsTypeError(() => Float32x4(dynamicNull, 0.0, 0.0, 0.0)),
70+
);
5571
Expect.equals(
56-
true, throwsTypeError(() => Float32x4(0.0, dynamicNull, 0.0, 0.0)));
72+
true,
73+
throwsTypeError(() => Float32x4(0.0, dynamicNull, 0.0, 0.0)),
74+
);
5775
Expect.equals(
58-
true, throwsTypeError(() => Float32x4(0.0, 0.0, dynamicNull, 0.0)));
76+
true,
77+
throwsTypeError(() => Float32x4(0.0, 0.0, dynamicNull, 0.0)),
78+
);
5979
Expect.equals(
60-
true, throwsTypeError(() => Float32x4(0.0, 0.0, 0.0, dynamicNull)));
80+
true,
81+
throwsTypeError(() => Float32x4(0.0, 0.0, 0.0, dynamicNull)),
82+
);
6183

6284
// Float32x4.splat
6385
Expect.equals(true, throwsTypeError(() => Float32x4.splat(dynamicNull)));
@@ -70,9 +92,13 @@ main() {
7092
Expect.equals(true, throwsTypeError(() => float64x2 / dynamicNull));
7193
Expect.equals(true, throwsTypeError(() => float64x2.scale(dynamicNull)));
7294
Expect.equals(
73-
true, throwsTypeError(() => float64x2.clamp(dynamicNull, float64x2)));
95+
true,
96+
throwsTypeError(() => float64x2.clamp(dynamicNull, float64x2)),
97+
);
7498
Expect.equals(
75-
true, throwsTypeError(() => float64x2.clamp(float64x2, dynamicNull)));
99+
true,
100+
throwsTypeError(() => float64x2.clamp(float64x2, dynamicNull)),
101+
);
76102
Expect.equals(true, throwsTypeError(() => float64x2.withX(dynamicNull)));
77103
Expect.equals(true, throwsTypeError(() => float64x2.withY(dynamicNull)));
78104
Expect.equals(true, throwsTypeError(() => Float64x2(dynamicNull, 0.0)));
@@ -92,9 +118,13 @@ main() {
92118
Expect.equals(true, throwsTypeError(() => int32x4 | dynamicNull));
93119
Expect.equals(true, throwsTypeError(() => int32x4.shuffle(dynamicNull)));
94120
Expect.equals(
95-
true, throwsTypeError(() => int32x4.shuffleMix(int32x4, dynamicNull)));
121+
true,
122+
throwsTypeError(() => int32x4.shuffleMix(int32x4, dynamicNull)),
123+
);
96124
Expect.equals(
97-
true, throwsTypeError(() => int32x4.shuffleMix(dynamicNull, 0)));
125+
true,
126+
throwsTypeError(() => int32x4.shuffleMix(dynamicNull, 0)),
127+
);
98128
Expect.equals(true, throwsTypeError(() => int32x4.withX(dynamicNull)));
99129
Expect.equals(true, throwsTypeError(() => int32x4.withY(dynamicNull)));
100130
Expect.equals(true, throwsTypeError(() => int32x4.withZ(dynamicNull)));
@@ -109,17 +139,29 @@ main() {
109139
Expect.equals(true, throwsTypeError(() => Int32x4(0, 0, dynamicNull, 0)));
110140
Expect.equals(true, throwsTypeError(() => Int32x4(0, 0, 0, dynamicNull)));
111141
Expect.equals(
112-
true, throwsTypeError(() => int32x4.select(dynamicNull, float32x4)));
142+
true,
143+
throwsTypeError(() => int32x4.select(dynamicNull, float32x4)),
144+
);
113145
Expect.equals(
114-
true, throwsTypeError(() => int32x4.select(float32x4, dynamicNull)));
146+
true,
147+
throwsTypeError(() => int32x4.select(float32x4, dynamicNull)),
148+
);
115149

116150
// Int32x4.bool
117-
Expect.equals(true,
118-
throwsTypeError(() => Int32x4.bool(dynamicNull, false, false, false)));
119-
Expect.equals(true,
120-
throwsTypeError(() => Int32x4.bool(false, dynamicNull, false, false)));
121-
Expect.equals(true,
122-
throwsTypeError(() => Int32x4.bool(false, false, dynamicNull, false)));
123-
Expect.equals(true,
124-
throwsTypeError(() => Int32x4.bool(false, false, false, dynamicNull)));
151+
Expect.equals(
152+
true,
153+
throwsTypeError(() => Int32x4.bool(dynamicNull, false, false, false)),
154+
);
155+
Expect.equals(
156+
true,
157+
throwsTypeError(() => Int32x4.bool(false, dynamicNull, false, false)),
158+
);
159+
Expect.equals(
160+
true,
161+
throwsTypeError(() => Int32x4.bool(false, false, dynamicNull, false)),
162+
);
163+
Expect.equals(
164+
true,
165+
throwsTypeError(() => Int32x4.bool(false, false, false, dynamicNull)),
166+
);
125167
}

0 commit comments

Comments
 (0)