diff --git a/LibTest/ffi/Bool/Bool_A02_t01.dart b/LibTest/ffi/Bool/Bool_A02_t01.dart index 0341a08d8a..e050ea1ca8 100644 --- a/LibTest/ffi/Bool/Bool_A02_t01.dart +++ b/LibTest/ffi/Bool/Bool_A02_t01.dart @@ -17,7 +17,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(1, p1.elementAt(1).address - p1.address); + Expect.equals(1, (p1 + 1).address - p1.address); Expect.equals(1, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Char/Char_A02_t01.dart b/LibTest/ffi/Char/Char_A02_t01.dart index 52e313d2b0..36289080f4 100644 --- a/LibTest/ffi/Char/Char_A02_t01.dart +++ b/LibTest/ffi/Char/Char_A02_t01.dart @@ -23,7 +23,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(1, p1.elementAt(1).address - p1.address); + Expect.equals(1, (p1 + 1).address - p1.address); Expect.equals(1, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Int/Int_A02_t01.dart b/LibTest/ffi/Int/Int_A02_t01.dart index 379b13eef5..16486a61ac 100644 --- a/LibTest/ffi/Int/Int_A02_t01.dart +++ b/LibTest/ffi/Int/Int_A02_t01.dart @@ -21,7 +21,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(4, p1.elementAt(1).address - p1.address); + Expect.equals(4, (p1 + 1).address - p1.address); Expect.equals(4, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Int16/Int16_A02_t01.dart b/LibTest/ffi/Int16/Int16_A02_t01.dart index da7345ec58..31218792a1 100644 --- a/LibTest/ffi/Int16/Int16_A02_t01.dart +++ b/LibTest/ffi/Int16/Int16_A02_t01.dart @@ -15,7 +15,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(2, p1.elementAt(1).address - p1.address); + Expect.equals(2, (p1 + 1).address - p1.address); Expect.equals(2, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Int32/Int32_A02_t01.dart b/LibTest/ffi/Int32/Int32_A02_t01.dart index 304518671c..e7da53c263 100644 --- a/LibTest/ffi/Int32/Int32_A02_t01.dart +++ b/LibTest/ffi/Int32/Int32_A02_t01.dart @@ -15,7 +15,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(4, p1.elementAt(1).address - p1.address); + Expect.equals(4, (p1 + 1).address - p1.address); Expect.equals(4, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Int64/Int64_A02_t01.dart b/LibTest/ffi/Int64/Int64_A02_t01.dart index 313406a0b9..cd075b4842 100644 --- a/LibTest/ffi/Int64/Int64_A02_t01.dart +++ b/LibTest/ffi/Int64/Int64_A02_t01.dart @@ -15,7 +15,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(8, p1.elementAt(1).address - p1.address); + Expect.equals(8, (p1 + 1).address - p1.address); Expect.equals(8, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Int8/Int8_A02_t01.dart b/LibTest/ffi/Int8/Int8_A02_t01.dart index 4d3cd770b8..986a7b56ed 100644 --- a/LibTest/ffi/Int8/Int8_A02_t01.dart +++ b/LibTest/ffi/Int8/Int8_A02_t01.dart @@ -15,7 +15,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(1, p1.elementAt(1).address - p1.address); + Expect.equals(1, (p1 + 1).address - p1.address); Expect.equals(1, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/IntPtr/IntPtr_A01_t03.dart b/LibTest/ffi/IntPtr/IntPtr_A01_t03.dart index 140eceb8f9..d662b67696 100644 --- a/LibTest/ffi/IntPtr/IntPtr_A01_t03.dart +++ b/LibTest/ffi/IntPtr/IntPtr_A01_t03.dart @@ -15,10 +15,10 @@ void main() { Pointer p1 = calloc(3); try { if (sizeOf() == 4) { - Expect.equals(4, p1.elementAt(1).address - p1.address); - Expect.equals(4, p1.elementAt(2).address - p1.elementAt(1).address); + Expect.equals(4, (p1 + 1).address - p1.address); + Expect.equals(4, (p1 + 2).address - (p1 + 1).address); } else { - Expect.equals(8, p1.elementAt(1).address - p1.address); + Expect.equals(8, (p1 + 1).address - p1.address); Expect.equals(8, sizeOf()); } } finally { diff --git a/LibTest/ffi/Long/Long_A02_t01.dart b/LibTest/ffi/Long/Long_A02_t01.dart index 783feb4269..e6c36ce630 100644 --- a/LibTest/ffi/Long/Long_A02_t01.dart +++ b/LibTest/ffi/Long/Long_A02_t01.dart @@ -22,8 +22,8 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.isTrue(p1.elementAt(1).address - p1.address == 4 || - p1.elementAt(1).address - p1.address == 8); + Expect.isTrue((p1 + 1).address - p1.address == 4 || + (p1 + 1).address - p1.address == 8); Expect.isTrue(sizeOf() == 4 || sizeOf() == 8); } finally { calloc.free(p1); diff --git a/LibTest/ffi/LongLong/LongLong_A02_t01.dart b/LibTest/ffi/LongLong/LongLong_A02_t01.dart index 8c61bcee19..d8f83dda3c 100644 --- a/LibTest/ffi/LongLong/LongLong_A02_t01.dart +++ b/LibTest/ffi/LongLong/LongLong_A02_t01.dart @@ -22,7 +22,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(8, p1.elementAt(1).address - p1.address); + Expect.equals(8, (p1 + 1).address - p1.address); Expect.equals(8, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Pointer/elementAt_A01_t01.dart b/LibTest/ffi/Pointer/elementAt_A01_t01.dart deleted file mode 100644 index 567ebc2a17..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A01_t01.dart +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method implements pointer arithmetic -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; -import '../../../Utils/expect.dart'; - -void main() { - Pointer p1 = calloc(3); - try { - Expect.equals(2, p1.elementAt(1).address - p1.address); - Expect.equals(2, p1.elementAt(2).address - p1.elementAt(1).address); - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A01_t02.dart b/LibTest/ffi/Pointer/elementAt_A01_t02.dart deleted file mode 100644 index 95f9b09ea1..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A01_t02.dart +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method implements pointer arithmetic -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; -import '../../../Utils/expect.dart'; - -void main() { - Pointer p1 = calloc(3); - try { - Expect.isTrue(p1.elementAt(1).address - p1.address == 4 || - p1.elementAt(2).address - p1.elementAt(1).address == 8); - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A01_t03.dart b/LibTest/ffi/Pointer/elementAt_A01_t03.dart deleted file mode 100644 index 4c89182f98..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A01_t03.dart +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method implements pointer arithmetic -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; -import '../../../Utils/expect.dart'; - -void main() { - Pointer> p1 = calloc>(3); - try { - Expect.isTrue(p1.elementAt(1).address - p1.address == 4 || - p1.elementAt(2).address - p1.elementAt(1).address == 8); - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A01_t04.dart b/LibTest/ffi/Pointer/elementAt_A01_t04.dart deleted file mode 100644 index e1d226c160..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A01_t04.dart +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method implements pointer arithmetic -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; -import '../../../Utils/expect.dart'; - -final class MyStruct extends Struct { - @Int8() - external int x; - @Float() - external double y; -} - -void main() { - Pointer p1 = calloc(2); - try { - Expect.isTrue(p1.elementAt(1).address - p1.elementAt(0).address > 0); - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A02_t01.dart b/LibTest/ffi/Pointer/elementAt_A02_t01.dart deleted file mode 100644 index 81eeb53b7c..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A02_t01.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method must be invoked with a compile-time -/// constant T -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; - -void main() { - Pointer p1 = calloc(3); - try { - Pointer p2 = new Pointer.fromAddress(p1.address); - p2.elementAt(1); -// ^^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A02_t02.dart b/LibTest/ffi/Pointer/elementAt_A02_t02.dart deleted file mode 100644 index bba57b652a..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A02_t02.dart +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method must be invoked with a compile-time -/// constant T -/// @author sgrekhov@unipro.ru -/// @issue 45149 - -import "dart:ffi"; -import "package:ffi/ffi.dart"; - -void main() { - Pointer p1 = calloc(3); - try { - Pointer p2 = new Pointer.fromAddress(p1.address); - p2.elementAt(1); -// ^^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A02_t03.dart b/LibTest/ffi/Pointer/elementAt_A02_t03.dart deleted file mode 100644 index db7fda85ca..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A02_t03.dart +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method must be invoked with a compile-time -/// constant T -/// @author sgrekhov@unipro.ru -/// @issue 45150 - -import "dart:ffi"; -import "package:ffi/ffi.dart"; - -void main() { - Pointer p1 = calloc(3); - try { - Pointer p2 = new Pointer.fromAddress(p1.address); - p2.elementAt(1); -// ^^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A02_t04.dart b/LibTest/ffi/Pointer/elementAt_A02_t04.dart deleted file mode 100644 index cd44a4d620..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A02_t04.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method must be invoked with a compile-time -/// constant T -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; - -void main() { - Pointer p1 = calloc(3); - try { - Pointer> p2 = new Pointer.fromAddress(p1.address); - p2.elementAt(1); -// ^^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A02_t05.dart b/LibTest/ffi/Pointer/elementAt_A02_t05.dart deleted file mode 100644 index 7e11ba3f16..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A02_t05.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method must be invoked with a compile-time -/// constant T -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; - -void main() { - Pointer p1 = calloc(3); - try { - Pointer p2 = new Pointer.fromAddress(p1.address); - p2.elementAt(1); -// ^^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A02_t06.dart b/LibTest/ffi/Pointer/elementAt_A02_t06.dart deleted file mode 100644 index de6eea0641..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A02_t06.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method must be invoked with a compile-time -/// constant T -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; - -void main() { - Pointer p1 = calloc(3); - try { - Pointer p2 = new Pointer.fromAddress(p1.address); - p2.elementAt(1); -// ^^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A03_t01.dart b/LibTest/ffi/Pointer/elementAt_A03_t01.dart deleted file mode 100644 index 0a2f6382dd..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A03_t01.dart +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that this method does not accept dynamic invocations -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; - -void main() { - Pointer p1 = calloc(3); - p1.elementAt(1); -//^^^^^^^^^^^^^^^ -// [cfe] unspecified -// [analyzer] unspecified -} diff --git a/LibTest/ffi/Pointer/elementAt_A04_t01.dart b/LibTest/ffi/Pointer/elementAt_A04_t01.dart deleted file mode 100644 index d3f9fef2e3..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A04_t01.dart +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks negative argument value -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; -import '../../../Utils/expect.dart'; - -void main() { - Pointer p1 = calloc(3); - try { - p1.elementAt(0).value = 42; - Pointer p2 = new Pointer.fromAddress(p1.elementAt(1).address); - Expect.equals(42, p2.elementAt(-1).value); - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Pointer/elementAt_A04_t02.dart b/LibTest/ffi/Pointer/elementAt_A04_t02.dart deleted file mode 100644 index 273944c834..0000000000 --- a/LibTest/ffi/Pointer/elementAt_A04_t02.dart +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2021, 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 Pointer elementAt(int index) -/// Pointer arithmetic (takes element size into account). -/// This method must be invoked with a compile-time constant T. -/// Does not accept dynamic invocations -- where the type of the receiver is -/// dynamic. -/// -/// @description Checks that it is allowed to read memory outside the border -/// @author sgrekhov@unipro.ru - -import "dart:ffi"; -import "package:ffi/ffi.dart"; - -void main() { - Pointer p1 = calloc(3); - try { - p1.elementAt(42); - } finally { - calloc.free(p1); - } -} diff --git a/LibTest/ffi/Short/Short_A02_t01.dart b/LibTest/ffi/Short/Short_A02_t01.dart index a020d76c0c..c7879259bf 100644 --- a/LibTest/ffi/Short/Short_A02_t01.dart +++ b/LibTest/ffi/Short/Short_A02_t01.dart @@ -21,7 +21,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(2, p1.elementAt(1).address - p1.address); + Expect.equals(2, (p1 + 1).address - p1.address); Expect.equals(2, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/SignedChar/SignedChar_A02_t01.dart b/LibTest/ffi/SignedChar/SignedChar_A02_t01.dart index 848a94b35c..0353522713 100644 --- a/LibTest/ffi/SignedChar/SignedChar_A02_t01.dart +++ b/LibTest/ffi/SignedChar/SignedChar_A02_t01.dart @@ -21,7 +21,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(1, p1.elementAt(1).address - p1.address); + Expect.equals(1, (p1 + 1).address - p1.address); Expect.equals(1, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Struct/Struct_A05_t01.dart b/LibTest/ffi/Struct/Struct_A05_t01.dart index 4c3b932871..884ead636b 100644 --- a/LibTest/ffi/Struct/Struct_A05_t01.dart +++ b/LibTest/ffi/Struct/Struct_A05_t01.dart @@ -37,11 +37,11 @@ void main() { Pointer s2 = new Pointer.fromAddress(s1.address); Expect.equals(0x22222222, s2.ref.x); - Expect.equals(0x11111111, s2.elementAt(1).ref.x); + Expect.equals(0x11111111, (s2 + 1).ref.x); Pointer s3 = new Pointer.fromAddress(s1.address); Expect.equals(0x22222222, s3.ref.x); - Expect.equals(0x11111111, s3.elementAt(1).ref.x); + Expect.equals(0x11111111, (s3 + 1).ref.x); s1.ref.x = 0xFFFFFFFFFFFFFFFF; Expect.equals(-1, s2.ref.x); diff --git a/LibTest/ffi/Struct/Struct_A05_t02.dart b/LibTest/ffi/Struct/Struct_A05_t02.dart index 099aa81180..c496041534 100644 --- a/LibTest/ffi/Struct/Struct_A05_t02.dart +++ b/LibTest/ffi/Struct/Struct_A05_t02.dart @@ -37,15 +37,15 @@ void main() { Pointer s2 = new Pointer.fromAddress(s1.address); Expect.equals(0x4444, s2.ref.x); - Expect.equals(0x3333, s2.elementAt(1).ref.x); - Expect.equals(0x2222, s2.elementAt(2).ref.x); - Expect.equals(0x1111, s2.elementAt(3).ref.x); + Expect.equals(0x3333, (s2 + 1).ref.x); + Expect.equals(0x2222, (s2 + 2).ref.x); + Expect.equals(0x1111, (s2 + 3).ref.x); Pointer s3 = new Pointer.fromAddress(s1.address); Expect.equals(0x4444, s3.ref.x); - Expect.equals(0x3333, s3.elementAt(1).ref.x); - Expect.equals(0x2222, s3.elementAt(2).ref.x); - Expect.equals(0x1111, s3.elementAt(3).ref.x); + Expect.equals(0x3333, (s3 + 1).ref.x); + Expect.equals(0x2222, (s3 + 2).ref.x); + Expect.equals(0x1111, (s3 + 3).ref.x); s1.ref.x = 0xFFFFFFFFFFFFFFFF; Expect.equals(-1, s2.ref.x); diff --git a/LibTest/ffi/Struct/Struct_A05_t03.dart b/LibTest/ffi/Struct/Struct_A05_t03.dart index 41fda11a96..3ece26de39 100644 --- a/LibTest/ffi/Struct/Struct_A05_t03.dart +++ b/LibTest/ffi/Struct/Struct_A05_t03.dart @@ -38,23 +38,23 @@ void main() { Pointer s2 = new Pointer.fromAddress(s1.address); Expect.equals(0x12, s2.ref.x); - Expect.equals(0x77, s2.elementAt(1).ref.x); - Expect.equals(0x66, s2.elementAt(2).ref.x); - Expect.equals(0x55, s2.elementAt(3).ref.x); - Expect.equals(0x44, s2.elementAt(4).ref.x); - Expect.equals(0x33, s2.elementAt(5).ref.x); - Expect.equals(0x22, s2.elementAt(6).ref.x); - Expect.equals(0x11, s2.elementAt(7).ref.x); + Expect.equals(0x77, (s2 + 1).ref.x); + Expect.equals(0x66, (s2 + 2).ref.x); + Expect.equals(0x55, (s2 + 3).ref.x); + Expect.equals(0x44, (s2 + 4).ref.x); + Expect.equals(0x33, (s2 + 5).ref.x); + Expect.equals(0x22, (s2 + 6).ref.x); + Expect.equals(0x11, (s2 + 7).ref.x); Pointer s3 = new Pointer.fromAddress(s1.address); Expect.equals(0x12, s3.ref.x); - Expect.equals(0x77, s3.elementAt(1).ref.x); - Expect.equals(0x66, s3.elementAt(2).ref.x); - Expect.equals(0x55, s3.elementAt(3).ref.x); - Expect.equals(0x44, s3.elementAt(4).ref.x); - Expect.equals(0x33, s3.elementAt(5).ref.x); - Expect.equals(0x22, s3.elementAt(6).ref.x); - Expect.equals(0x11, s3.elementAt(7).ref.x); + Expect.equals(0x77, (s3 + 1).ref.x); + Expect.equals(0x66, (s3 + 2).ref.x); + Expect.equals(0x55, (s3 + 3).ref.x); + Expect.equals(0x44, (s3 + 4).ref.x); + Expect.equals(0x33, (s3 + 5).ref.x); + Expect.equals(0x22, (s3 + 6).ref.x); + Expect.equals(0x11, (s3 + 7).ref.x); s1.ref.x = 0xFFFFFFFFFFFFFFFF; Expect.equals(-1, s2.ref.x); diff --git a/LibTest/ffi/Uint16/Uint16_A02_t01.dart b/LibTest/ffi/Uint16/Uint16_A02_t01.dart index 238d0cdfd2..480f9265e9 100644 --- a/LibTest/ffi/Uint16/Uint16_A02_t01.dart +++ b/LibTest/ffi/Uint16/Uint16_A02_t01.dart @@ -15,7 +15,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(2, p1.elementAt(1).address - p1.address); + Expect.equals(2, (p1 + 1).address - p1.address); Expect.equals(2, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Uint32/Uint32_A02_t01.dart b/LibTest/ffi/Uint32/Uint32_A02_t01.dart index 3225a69f30..184a25da6f 100644 --- a/LibTest/ffi/Uint32/Uint32_A02_t01.dart +++ b/LibTest/ffi/Uint32/Uint32_A02_t01.dart @@ -15,7 +15,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(4, p1.elementAt(1).address - p1.address); + Expect.equals(4, (p1 + 1).address - p1.address); Expect.equals(4, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Uint64/Uint64_A02_t01.dart b/LibTest/ffi/Uint64/Uint64_A02_t01.dart index 9594fc16c3..e1c73aad98 100644 --- a/LibTest/ffi/Uint64/Uint64_A02_t01.dart +++ b/LibTest/ffi/Uint64/Uint64_A02_t01.dart @@ -15,7 +15,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(8, p1.elementAt(1).address - p1.address); + Expect.equals(8, (p1 + 1).address - p1.address); Expect.equals(8, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/Uint8/Uint8_A02_t01.dart b/LibTest/ffi/Uint8/Uint8_A02_t01.dart index c7c7c3e2f6..e32defc5b2 100644 --- a/LibTest/ffi/Uint8/Uint8_A02_t01.dart +++ b/LibTest/ffi/Uint8/Uint8_A02_t01.dart @@ -15,7 +15,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(1, p1.elementAt(1).address - p1.address); + Expect.equals(1, (p1 + 1).address - p1.address); Expect.equals(1, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/UintPtr/UintPtr_A02_t01.dart b/LibTest/ffi/UintPtr/UintPtr_A02_t01.dart index 7162a15c4c..15111774cf 100644 --- a/LibTest/ffi/UintPtr/UintPtr_A02_t01.dart +++ b/LibTest/ffi/UintPtr/UintPtr_A02_t01.dart @@ -19,9 +19,9 @@ void main() { Pointer p1 = calloc(2); try { if (sizeOf() == 4) { - Expect.equals(4, p1.elementAt(1).address - p1.address); + Expect.equals(4, (p1 + 1).address - p1.address); } else { - Expect.equals(8, p1.elementAt(1).address - p1.address); + Expect.equals(8, (p1 + 1).address - p1.address); Expect.equals(8, sizeOf()); } } finally { diff --git a/LibTest/ffi/Union/Union_A05_t01.dart b/LibTest/ffi/Union/Union_A05_t01.dart index b350906e60..95546505e4 100644 --- a/LibTest/ffi/Union/Union_A05_t01.dart +++ b/LibTest/ffi/Union/Union_A05_t01.dart @@ -37,11 +37,11 @@ void main() { Pointer u2 = new Pointer.fromAddress(u1.address); Expect.equals(0x22222222, u2.ref.x); - Expect.equals(0x11111111, u2.elementAt(1).ref.x); + Expect.equals(0x11111111, (u2 + 1).ref.x); Pointer u3 = new Pointer.fromAddress(u1.address); Expect.equals(0x22222222, u3.ref.x); - Expect.equals(0x11111111, u3.elementAt(1).ref.x); + Expect.equals(0x11111111, (u3 + 1).ref.x); u1.ref.x = 0xFFFFFFFFFFFFFFFF; Expect.equals(-1, u2.ref.x); diff --git a/LibTest/ffi/Union/Union_A05_t02.dart b/LibTest/ffi/Union/Union_A05_t02.dart index 30b5ee8539..0793897976 100644 --- a/LibTest/ffi/Union/Union_A05_t02.dart +++ b/LibTest/ffi/Union/Union_A05_t02.dart @@ -37,15 +37,15 @@ void main() { Pointer u2 = new Pointer.fromAddress(u1.address); Expect.equals(0x4444, u2.ref.x); - Expect.equals(0x3333, u2.elementAt(1).ref.x); - Expect.equals(0x2222, u2.elementAt(2).ref.x); - Expect.equals(0x1111, u2.elementAt(3).ref.x); + Expect.equals(0x3333, (u2 + 1).ref.x); + Expect.equals(0x2222, (u2 + 2).ref.x); + Expect.equals(0x1111, (u2 + 3).ref.x); Pointer u3 = new Pointer.fromAddress(u1.address); Expect.equals(0x4444, u3.ref.x); - Expect.equals(0x3333, u3.elementAt(1).ref.x); - Expect.equals(0x2222, u3.elementAt(2).ref.x); - Expect.equals(0x1111, u3.elementAt(3).ref.x); + Expect.equals(0x3333, (u3 + 1).ref.x); + Expect.equals(0x2222, (u3 + 2).ref.x); + Expect.equals(0x1111, (u3 + 3).ref.x); u1.ref.x = 0xFFFFFFFFFFFFFFFF; Expect.equals(-1, u2.ref.x); diff --git a/LibTest/ffi/Union/Union_A05_t03.dart b/LibTest/ffi/Union/Union_A05_t03.dart index 8f88ab5972..1c46f53b52 100644 --- a/LibTest/ffi/Union/Union_A05_t03.dart +++ b/LibTest/ffi/Union/Union_A05_t03.dart @@ -37,23 +37,23 @@ void main() { Pointer u2 = new Pointer.fromAddress(u1.address); Expect.equals(0x12, u2.ref.x); - Expect.equals(0x77, u2.elementAt(1).ref.x); - Expect.equals(0x66, u2.elementAt(2).ref.x); - Expect.equals(0x55, u2.elementAt(3).ref.x); - Expect.equals(0x44, u2.elementAt(4).ref.x); - Expect.equals(0x33, u2.elementAt(5).ref.x); - Expect.equals(0x22, u2.elementAt(6).ref.x); - Expect.equals(0x11, u2.elementAt(7).ref.x); + Expect.equals(0x77, (u2 + 1).ref.x); + Expect.equals(0x66, (u2 + 2).ref.x); + Expect.equals(0x55, (u2 + 3).ref.x); + Expect.equals(0x44, (u2 + 4).ref.x); + Expect.equals(0x33, (u2 + 5).ref.x); + Expect.equals(0x22, (u2 + 6).ref.x); + Expect.equals(0x11, (u2 + 7).ref.x); Pointer u3 = new Pointer.fromAddress(u1.address); Expect.equals(0x12, u3.ref.x); - Expect.equals(0x77, u3.elementAt(1).ref.x); - Expect.equals(0x66, u3.elementAt(2).ref.x); - Expect.equals(0x55, u3.elementAt(3).ref.x); - Expect.equals(0x44, u3.elementAt(4).ref.x); - Expect.equals(0x33, u3.elementAt(5).ref.x); - Expect.equals(0x22, u3.elementAt(6).ref.x); - Expect.equals(0x11, u3.elementAt(7).ref.x); + Expect.equals(0x77, (u3 + 1).ref.x); + Expect.equals(0x66, (u3 + 2).ref.x); + Expect.equals(0x55, (u3 + 3).ref.x); + Expect.equals(0x44, (u3 + 4).ref.x); + Expect.equals(0x33, (u3 + 5).ref.x); + Expect.equals(0x22, (u3 + 6).ref.x); + Expect.equals(0x11, (u3 + 7).ref.x); u1.ref.x = 0xFFFFFFFFFFFFFFFF; Expect.equals(-1, u2.ref.x); diff --git a/LibTest/ffi/UnsignedChar/UnsignedChar_A02_t01.dart b/LibTest/ffi/UnsignedChar/UnsignedChar_A02_t01.dart index 469f645cf9..f3719ba46a 100644 --- a/LibTest/ffi/UnsignedChar/UnsignedChar_A02_t01.dart +++ b/LibTest/ffi/UnsignedChar/UnsignedChar_A02_t01.dart @@ -21,7 +21,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(1, p1.elementAt(1).address - p1.address); + Expect.equals(1, (p1 + 1).address - p1.address); Expect.equals(1, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/UnsignedInt/UnsignedInt_A02_t01.dart b/LibTest/ffi/UnsignedInt/UnsignedInt_A02_t01.dart index 2b67598bb5..9e0712b248 100644 --- a/LibTest/ffi/UnsignedInt/UnsignedInt_A02_t01.dart +++ b/LibTest/ffi/UnsignedInt/UnsignedInt_A02_t01.dart @@ -21,7 +21,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(4, p1.elementAt(1).address - p1.address); + Expect.equals(4, (p1 + 1).address - p1.address); Expect.equals(4, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/UnsignedLong/UnsignedLong_A02_t01.dart b/LibTest/ffi/UnsignedLong/UnsignedLong_A02_t01.dart index 072d1dee9e..f94c7edbdf 100644 --- a/LibTest/ffi/UnsignedLong/UnsignedLong_A02_t01.dart +++ b/LibTest/ffi/UnsignedLong/UnsignedLong_A02_t01.dart @@ -23,8 +23,8 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.isTrue(p1.elementAt(1).address - p1.address == 4 || - p1.elementAt(1).address - p1.address == 8); + Expect.isTrue((p1 + 1).address - p1.address == 4 || + (p1 + 1).address - p1.address == 8); Expect.isTrue(sizeOf() == 4 || sizeOf() == 8); } finally { calloc.free(p1); diff --git a/LibTest/ffi/UnsignedLongLong/UnsignedLongLong_A02_t01.dart b/LibTest/ffi/UnsignedLongLong/UnsignedLongLong_A02_t01.dart index 580a79de3e..e7eec91adc 100644 --- a/LibTest/ffi/UnsignedLongLong/UnsignedLongLong_A02_t01.dart +++ b/LibTest/ffi/UnsignedLongLong/UnsignedLongLong_A02_t01.dart @@ -23,7 +23,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(8, p1.elementAt(1).address - p1.address); + Expect.equals(8, (p1 + 1).address - p1.address); Expect.equals(8, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/UnsignedShort/UnsignedShort_A02_t01.dart b/LibTest/ffi/UnsignedShort/UnsignedShort_A02_t01.dart index 41565e7fd1..df21c53ec4 100644 --- a/LibTest/ffi/UnsignedShort/UnsignedShort_A02_t01.dart +++ b/LibTest/ffi/UnsignedShort/UnsignedShort_A02_t01.dart @@ -21,7 +21,7 @@ import "../../../Utils/expect.dart"; void main() { Pointer p1 = calloc(2); try { - Expect.equals(2, p1.elementAt(1).address - p1.address); + Expect.equals(2, (p1 + 1).address - p1.address); Expect.equals(2, sizeOf()); } finally { calloc.free(p1); diff --git a/LibTest/ffi/pubspec.yaml b/LibTest/ffi/pubspec.yaml index 8d41a6b818..e06ec6ec02 100644 --- a/LibTest/ffi/pubspec.yaml +++ b/LibTest/ffi/pubspec.yaml @@ -5,7 +5,7 @@ description: co19 tests for Dart FFI library publish_to: none environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=3.3.0-279.1.beta <4.0.0' dependencies: - ffi: ^1.0.0 \ No newline at end of file + ffi: ^2.1.0