diff --git a/LibTest/typed_data/Float32List/setRange_A06_t01.dart b/LibTest/typed_data/Float32List/setRange_A06_t01.dart new file mode 100644 index 0000000000..0b15abed93 --- /dev/null +++ b/LibTest/typed_data/Float32List/setRange_A06_t01.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test data of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + List ints = Uint32List.fromList([1, 2, 3, 4]); + Float32List floats = Float32List(4); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (floats as List).setRange(0, 4, ints); + }); +} diff --git a/LibTest/typed_data/Float32List/setRange_A06_t02.dart b/LibTest/typed_data/Float32List/setRange_A06_t02.dart new file mode 100644 index 0000000000..e8a52ed377 --- /dev/null +++ b/LibTest/typed_data/Float32List/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test less-sized list elements +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + List ints = Uint16List.fromList([1, 2, 3, 4]); + Float32List floats = Float32List(4); + Expect.throws(() { + (floats as List).setRange(0, 4, ints); + }); +} diff --git a/LibTest/typed_data/Float32List/setRange_A06_t03.dart b/LibTest/typed_data/Float32List/setRange_A06_t03.dart new file mode 100644 index 0000000000..2b11db345c --- /dev/null +++ b/LibTest/typed_data/Float32List/setRange_A06_t03.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test larger-sized list elements +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + List ints = Uint64List.fromList([1, 2, 3, 4]); + Float32List floats = Float32List(4); + Expect.throws(() { + (floats as List).setRange(0, 4, ints); + }); +} diff --git a/LibTest/typed_data/Float32x4List/setRange_A06_t01.dart b/LibTest/typed_data/Float32x4List/setRange_A06_t01.dart new file mode 100644 index 0000000000..1f88d225d6 --- /dev/null +++ b/LibTest/typed_data/Float32x4List/setRange_A06_t01.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test list elements of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var ints = Int32x4List.fromList([Int32x4(1, 1, 1, 1), Int32x4(2, 2, 2, 2)]); + Float32x4List floats = Float32x4List(2); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (floats as dynamic).setRange(0, 2, ints); + }); +} diff --git a/LibTest/typed_data/Float32x4List/setRange_A06_t02.dart b/LibTest/typed_data/Float32x4List/setRange_A06_t02.dart new file mode 100644 index 0000000000..a7a52d779e --- /dev/null +++ b/LibTest/typed_data/Float32x4List/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test less-sized list elements +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var ints = Int16List.fromList([1, 2, 3, 4]); + Float32x4List floats = Float32x4List(4); + Expect.throws(() { + (floats as dynamic).setRange(0, 4, ints); + }); +} diff --git a/LibTest/typed_data/Float32x4List/setRange_A06_t03.dart b/LibTest/typed_data/Float32x4List/setRange_A06_t03.dart new file mode 100644 index 0000000000..6c27bc6a0f --- /dev/null +++ b/LibTest/typed_data/Float32x4List/setRange_A06_t03.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test less-sized list elements +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var ints = Int64List.fromList([1, 2, 3, 4]); + Float32x4List floats = Float32x4List(4); + Expect.throws(() { + (floats as dynamic).setRange(0, 4, ints); + }); +} diff --git a/LibTest/typed_data/Float64List/setRange_A06_t01.dart b/LibTest/typed_data/Float64List/setRange_A06_t01.dart new file mode 100644 index 0000000000..4c5c715258 --- /dev/null +++ b/LibTest/typed_data/Float64List/setRange_A06_t01.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test list elements of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + List ints = Uint64List.fromList([1, 2, 3, 4]); + Float64List floats = Float64List(4); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (floats as List).setRange(0, 4, ints); + }); +} diff --git a/LibTest/typed_data/Float64List/setRange_A06_t02.dart b/LibTest/typed_data/Float64List/setRange_A06_t02.dart new file mode 100644 index 0000000000..1a7a4781e7 --- /dev/null +++ b/LibTest/typed_data/Float64List/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test less-sized list elements +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + List ints = Uint32List.fromList([1, 2, 3, 4]); + Float64List floats = Float64List(4); + Expect.throws(() { + (floats as List).setRange(0, 4, ints); + }); +} diff --git a/LibTest/typed_data/Float64List/setRange_A06_t03.dart b/LibTest/typed_data/Float64List/setRange_A06_t03.dart new file mode 100644 index 0000000000..760ad793a0 --- /dev/null +++ b/LibTest/typed_data/Float64List/setRange_A06_t03.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test less-sized list elements +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var ints = Int32x4List.fromList([Int32x4(1, 1, 1, 1), Int32x4(2, 2, 2, 2)]); + Float64List floats = Float64List(2); + Expect.throws(() { + (floats as dynamic).setRange(0, 2, ints); + }); +} diff --git a/LibTest/typed_data/Float64x2List/setRange_A06_t01.dart b/LibTest/typed_data/Float64x2List/setRange_A06_t01.dart new file mode 100644 index 0000000000..ae28595c4c --- /dev/null +++ b/LibTest/typed_data/Float64x2List/setRange_A06_t01.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test list elements of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var ints = Int32x4List.fromList([Int32x4(1, 1, 1, 1), Int32x4(2, 2, 2, 2)]); + Float64x2List floats = Float64x2List(2); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (floats as dynamic).setRange(0, 2, ints); + }); +} diff --git a/LibTest/typed_data/Float64x2List/setRange_A06_t02.dart b/LibTest/typed_data/Float64x2List/setRange_A06_t02.dart new file mode 100644 index 0000000000..56cc09fbc8 --- /dev/null +++ b/LibTest/typed_data/Float64x2List/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test less-sized list elements +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var ints = Int64List.fromList([1, 2, 3, 4]); + Float64x2List floats = Float64x2List(4); + Expect.throws(() { + (floats as dynamic).setRange(0, 4, ints); + }); +} diff --git a/LibTest/typed_data/Int16List/setRange_A06_t01.dart b/LibTest/typed_data/Int16List/setRange_A06_t01.dart new file mode 100644 index 0000000000..8a08bf8b87 --- /dev/null +++ b/LibTest/typed_data/Int16List/setRange_A06_t01.dart @@ -0,0 +1,31 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Uint8List uint8List = Uint8List.fromList([255, 255]); + Uint16List uint16List = Uint16List.fromList([0xFFFF, 1]); + Uint32List uint32List = Uint32List.fromList([0xFFFFFFFF, 2]); + Int16List int16List = Int16List(2); + int16List.setRange(0, 2, uint8List); + Expect.listEquals([255, 255], int16List); + int16List.setRange(0, 2, uint16List); + Expect.listEquals([-1, 1], int16List); + int16List.setRange(0, 2, uint32List); + Expect.listEquals([-1, 2], int16List); +} diff --git a/LibTest/typed_data/Int16List/setRange_A06_t02.dart b/LibTest/typed_data/Int16List/setRange_A06_t02.dart new file mode 100644 index 0000000000..be02b5862e --- /dev/null +++ b/LibTest/typed_data/Int16List/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` elements is not a subtype of `Int16` +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Int16List int16List = Int16List(4); + Expect.throws(() { + (int16List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Int32List/setRange_A06_t01.dart b/LibTest/typed_data/Int32List/setRange_A06_t01.dart new file mode 100644 index 0000000000..d2c2ff214c --- /dev/null +++ b/LibTest/typed_data/Int32List/setRange_A06_t01.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Uint16List uint16List = Uint16List.fromList([0xFFFF, 1]); + Uint32List uint32List = Uint32List.fromList([0xFFFFFFFF, 2]); + Int32List int32List = Int32List(2); + int32List.setRange(0, 2, uint16List); + Expect.listEquals([65535, 1], int32List); + int32List.setRange(0, 2, uint32List); + Expect.listEquals([-1, 2], int32List); +} diff --git a/LibTest/typed_data/Int32List/setRange_A06_t02.dart b/LibTest/typed_data/Int32List/setRange_A06_t02.dart new file mode 100644 index 0000000000..28f343e9e6 --- /dev/null +++ b/LibTest/typed_data/Int32List/setRange_A06_t02.dart @@ -0,0 +1,25 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Uint64List uint64List = Uint64List.fromList([0xFFFFFFFFFFFFFFFF, 1]); + Int32List int32List = Int32List(2); + int32List.setRange(0, 2, uint64List); + Expect.listEquals([-1, 1], int32List); +} diff --git a/LibTest/typed_data/Int32List/setRange_A06_t03.dart b/LibTest/typed_data/Int32List/setRange_A06_t03.dart new file mode 100644 index 0000000000..30fc27ea02 --- /dev/null +++ b/LibTest/typed_data/Int32List/setRange_A06_t03.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test data of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Int32List int32List = Int32List(4); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (int32List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Int32List/setRange_A06_t04.dart b/LibTest/typed_data/Int32List/setRange_A06_t04.dart new file mode 100644 index 0000000000..7e25d67dcb --- /dev/null +++ b/LibTest/typed_data/Int32List/setRange_A06_t04.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test elements of a larger size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float64List.fromList([1, 2, 3, 4]); + Int32List int32List = Int32List(4); + Expect.throws(() { + (int32List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Int32x4List/setRange_A05_t01.dart b/LibTest/typed_data/Int32x4List/setRange_A05_t01.dart new file mode 100644 index 0000000000..64d4d310bc --- /dev/null +++ b/LibTest/typed_data/Int32x4List/setRange_A05_t01.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test list elements of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = + Float32x4List.fromList([Float32x4(1, 1, 1, 1), Float32x4(2, 2, 2, 2)]); + Int32x4List ints = Int32x4List(2); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (ints as dynamic).setRange(0, 2, floats); + }); +} diff --git a/LibTest/typed_data/Int32x4List/setRange_A05_t02.dart b/LibTest/typed_data/Int32x4List/setRange_A05_t02.dart new file mode 100644 index 0000000000..a048fc5b7a --- /dev/null +++ b/LibTest/typed_data/Int32x4List/setRange_A05_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test less-sized list elements +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1.1, 2.2, 3.3, 4.4]); + Int32x4List ints = Int32x4List(4); + Expect.throws(() { + (ints as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Int64List/setRange_A06_t01.dart b/LibTest/typed_data/Int64List/setRange_A06_t01.dart new file mode 100644 index 0000000000..732c3363d5 --- /dev/null +++ b/LibTest/typed_data/Int64List/setRange_A06_t01.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Uint32List uint32List = Uint32List.fromList([0xFFFFFFFF, 1]); + Uint64List uint64List = Uint64List.fromList([0xFFFFFFFFFFFFFFFF, 2]); + Int64List int64List = Int64List(2); + int64List.setRange(0, 2, uint32List); + Expect.listEquals([4294967295, 1], int64List); + int64List.setRange(0, 2, uint64List); + Expect.listEquals([-1, 2], int64List); +} diff --git a/LibTest/typed_data/Int64List/setRange_A06_t02.dart b/LibTest/typed_data/Int64List/setRange_A06_t02.dart new file mode 100644 index 0000000000..b2878a3619 --- /dev/null +++ b/LibTest/typed_data/Int64List/setRange_A06_t02.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test data of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float64List.fromList([1, 2, 3, 4]); + Int64List int64List = Int64List(4); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (int64List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Int64List/setRange_A06_t03.dart b/LibTest/typed_data/Int64List/setRange_A06_t03.dart new file mode 100644 index 0000000000..64b861a818 --- /dev/null +++ b/LibTest/typed_data/Int64List/setRange_A06_t03.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test elements of a smaller size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Int64List int64List = Int64List(4); + Expect.throws(() { + (int64List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Int64List/setRange_A06_t04.dart b/LibTest/typed_data/Int64List/setRange_A06_t04.dart new file mode 100644 index 0000000000..db0973f2a0 --- /dev/null +++ b/LibTest/typed_data/Int64List/setRange_A06_t04.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test elements of a larger size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = + Float64x2List.fromList([Float64x2(1.1, 2.2), Float64x2(3.3, 4.4)]); + Int64List int64List = Int64List(2); + Expect.throws(() { + (int64List as dynamic).setRange(0, 2, floats); + }); +} diff --git a/LibTest/typed_data/Int8List/setRange_A06_t01.dart b/LibTest/typed_data/Int8List/setRange_A06_t01.dart new file mode 100644 index 0000000000..8c7c7583d8 --- /dev/null +++ b/LibTest/typed_data/Int8List/setRange_A06_t01.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Uint8List uint8List = Uint8List.fromList([255, 1]); + Uint16List uint16List = Uint16List.fromList([0xFFFF, 2]); + Int8List int8list = Int8List(2); + int8list.setRange(0, 2, uint8List); + Expect.listEquals([-1, 1], int8list); + int8list.setRange(0, 2, uint16List); + Expect.listEquals([-1, 2], int8list); +} diff --git a/LibTest/typed_data/Int8List/setRange_A06_t02.dart b/LibTest/typed_data/Int8List/setRange_A06_t02.dart new file mode 100644 index 0000000000..f3ba41c6f0 --- /dev/null +++ b/LibTest/typed_data/Int8List/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` elements is not a subtype of `Int8` +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Int8List int8list = Int8List(4); + Expect.throws(() { + (int8list as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Uint16List/setRange_A06_t01.dart b/LibTest/typed_data/Uint16List/setRange_A06_t01.dart new file mode 100644 index 0000000000..6d1afcb25c --- /dev/null +++ b/LibTest/typed_data/Uint16List/setRange_A06_t01.dart @@ -0,0 +1,31 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Int8List int8List = Int8List.fromList([-1, 127]); + Int16List int16List = Int16List.fromList([-32767, 1]); + Int32List int32List = Int32List.fromList([0xFFFFFFFF, 2]); + Uint16List uint16List = Uint16List(2); + uint16List.setRange(0, 2, int8List); + Expect.listEquals([65535, 127], uint16List); + uint16List.setRange(0, 2, int16List); + Expect.listEquals([32769, 1], uint16List); + uint16List.setRange(0, 2, int32List); + Expect.listEquals([65535, 2], uint16List); +} diff --git a/LibTest/typed_data/Uint16List/setRange_A06_t02.dart b/LibTest/typed_data/Uint16List/setRange_A06_t02.dart new file mode 100644 index 0000000000..de5f0e30a3 --- /dev/null +++ b/LibTest/typed_data/Uint16List/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` elements is not a subtype of `Uint16` +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Uint16List uint16List = Uint16List(4); + Expect.throws(() { + (uint16List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Uint32List/setRange_A06_t01.dart b/LibTest/typed_data/Uint32List/setRange_A06_t01.dart new file mode 100644 index 0000000000..c761bf484f --- /dev/null +++ b/LibTest/typed_data/Uint32List/setRange_A06_t01.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Int16List int16List = Int16List.fromList([-32767, 1]); + Int32List int32List = Int32List.fromList([0xFFFFFFFF, 2]); + Uint32List uint32List = Uint32List(2); + uint32List.setRange(0, 2, int16List); + Expect.listEquals([4294934529, 1], uint32List); + uint32List.setRange(0, 2, int32List); + Expect.listEquals([4294967295, 2], uint32List); +} diff --git a/LibTest/typed_data/Uint32List/setRange_A06_t02.dart b/LibTest/typed_data/Uint32List/setRange_A06_t02.dart new file mode 100644 index 0000000000..e385ea09d7 --- /dev/null +++ b/LibTest/typed_data/Uint32List/setRange_A06_t02.dart @@ -0,0 +1,25 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Int64List int64List = Int64List.fromList([0xFFFFFFFFFFFFFFFF, 1]); + Uint32List uint32List = Uint32List(2); + uint32List.setRange(0, 2, int64List); + Expect.listEquals([4294967295, 1], uint32List); +} diff --git a/LibTest/typed_data/Uint32List/setRange_A06_t03.dart b/LibTest/typed_data/Uint32List/setRange_A06_t03.dart new file mode 100644 index 0000000000..5115ea2a70 --- /dev/null +++ b/LibTest/typed_data/Uint32List/setRange_A06_t03.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test data of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Uint32List uint32List = Uint32List(4); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (uint32List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Uint32List/setRange_A06_t04.dart b/LibTest/typed_data/Uint32List/setRange_A06_t04.dart new file mode 100644 index 0000000000..0bd2ac621c --- /dev/null +++ b/LibTest/typed_data/Uint32List/setRange_A06_t04.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test elements of a larger size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float64List.fromList([1, 2, 3, 4]); + Uint32List uint32List = Uint32List(4); + Expect.throws(() { + (uint32List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Uint64List/setRange_A06_t01.dart b/LibTest/typed_data/Uint64List/setRange_A06_t01.dart new file mode 100644 index 0000000000..36bc84c7c2 --- /dev/null +++ b/LibTest/typed_data/Uint64List/setRange_A06_t01.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Int32List int32List = Int32List.fromList([0xFFFFFFFF, 1]); + Int64List int64List = Int64List.fromList([0xFFFFFFFFFFFFFFFF, 2]); + Uint64List uint64List = Uint64List(2); + uint64List.setRange(0, 2, int32List); + Expect.listEquals([-1, 1], uint64List); + uint64List.setRange(0, 2, int64List); + Expect.listEquals([-1, 2], uint64List); +} diff --git a/LibTest/typed_data/Uint64List/setRange_A06_t02.dart b/LibTest/typed_data/Uint64List/setRange_A06_t02.dart new file mode 100644 index 0000000000..b4f537190f --- /dev/null +++ b/LibTest/typed_data/Uint64List/setRange_A06_t02.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test data of the same size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float64List.fromList([1, 2, 3, 4]); + Uint64List uint64List = Uint64List(4); + Expect.throws(() { + // Check that it's no memcopy of the same-sized data + (uint64List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Uint64List/setRange_A06_t03.dart b/LibTest/typed_data/Uint64List/setRange_A06_t03.dart new file mode 100644 index 0000000000..cd525315ed --- /dev/null +++ b/LibTest/typed_data/Uint64List/setRange_A06_t03.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test elements of a smaller size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Uint64List uint64List = Uint64List(4); + Expect.throws(() { + (uint64List as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Uint64List/setRange_A06_t04.dart b/LibTest/typed_data/Uint64List/setRange_A06_t04.dart new file mode 100644 index 0000000000..31ecb4c35d --- /dev/null +++ b/LibTest/typed_data/Uint64List/setRange_A06_t04.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` is not subtype of this list. Test elements of a larger size +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = + Float64x2List.fromList([Float64x2(1.1, 2.2), Float64x2(3.3, 4.4)]); + Uint64List uint64List = Uint64List(2); + Expect.throws(() { + (uint64List as dynamic).setRange(0, 2, floats); + }); +} diff --git a/LibTest/typed_data/Uint8ClampedList/setRange_A06_t01.dart b/LibTest/typed_data/Uint8ClampedList/setRange_A06_t01.dart new file mode 100644 index 0000000000..6bff1bad01 --- /dev/null +++ b/LibTest/typed_data/Uint8ClampedList/setRange_A06_t01.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Int8List int8List = Int8List.fromList([-1, 1]); + Int16List int16List = Int16List.fromList([-2, 300]); + Uint8ClampedList uint8ClampedList = Uint8ClampedList(2); + uint8ClampedList.setRange(0, 2, int8List); + Expect.listEquals([0, 1], uint8ClampedList); + uint8ClampedList.setRange(0, 2, int16List); + Expect.listEquals([0, 255], uint8ClampedList); +} diff --git a/LibTest/typed_data/Uint8ClampedList/setRange_A06_t02.dart b/LibTest/typed_data/Uint8ClampedList/setRange_A06_t02.dart new file mode 100644 index 0000000000..1d5ec537d9 --- /dev/null +++ b/LibTest/typed_data/Uint8ClampedList/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` elements is not a subtype of `Int8` +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Uint8ClampedList uint8ClampedList = Uint8ClampedList(4); + Expect.throws(() { + (uint8ClampedList as dynamic).setRange(0, 4, floats); + }); +} diff --git a/LibTest/typed_data/Uint8List/setRange_A06_t01.dart b/LibTest/typed_data/Uint8List/setRange_A06_t01.dart new file mode 100644 index 0000000000..3e15383bb6 --- /dev/null +++ b/LibTest/typed_data/Uint8List/setRange_A06_t01.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is not an error if run-time type of the +/// `iterable` elements is an integer +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + Int8List int8List = Int8List.fromList([-127, 127]); + Int16List int16List = Int16List.fromList([-1024, 1024]); + Uint8List uint8list = Uint8List(2); + uint8list.setRange(0, 2, int8List); + Expect.listEquals([129, 127], uint8list); + uint8list.setRange(0, 2, int16List); + Expect.listEquals([0, 0], uint8list); +} diff --git a/LibTest/typed_data/Uint8List/setRange_A06_t02.dart b/LibTest/typed_data/Uint8List/setRange_A06_t02.dart new file mode 100644 index 0000000000..28d29c993e --- /dev/null +++ b/LibTest/typed_data/Uint8List/setRange_A06_t02.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion +/// void setRange( +/// int start, +/// int end, +/// Iterable iterable, [ +/// int skipCount = 0 +/// ]) +/// +/// @description Checks that it is a run time error if run-time type of the +/// `iterable` elements is not a subtype of `Int8` +/// @author sgrekhov22@gmail.com + +import "dart:typed_data"; +import "../../../Utils/expect.dart"; + +void main() { + var floats = Float32List.fromList([1, 2, 3, 4]); + Uint8List uint8list = Uint8List(4); + Expect.throws(() { + (uint8list as dynamic).setRange(0, 4, floats); + }); +}