Skip to content

Commit

Permalink
Fixes SDK issue #45381. Use 32-bit int boundaries for 32-bit systems
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Mar 22, 2021
1 parent 2a09bd3 commit 11238c2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions LibTest/ffi/IntPtr/IntPtr_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@ void main() {
Expect.equals(256, p1.value);
p1.value = 32767;
Expect.equals(32767, p1.value);
p1.value = 32768;
Expect.equals(32768, p1.value);
p1.value = -32769;
Expect.equals(-32769, p1.value);
if (sizeOf<IntPtr>() == 4) {
p1.value = 32768;
Expect.equals(-32768, p1.value);
p1.value = -32768;
Expect.equals(-32768, p1.value);
p1.value = -32769;
Expect.equals(32767, p1.value);
} else {
p1.value = 32768;
Expect.equals(32768, p1.value);
p1.value = -32769;
Expect.equals(-32769, p1.value);
p1.value = 2147483647;
Expect.equals(2147483647, p1.value);
p1.value = 2147483648;
Expect.equals(-2147483648, p1.value);
p1.value = -2147483649;
Expect.equals(2147483647, p1.value);
}
} finally {
calloc.free(p1);
Expand Down

0 comments on commit 11238c2

Please sign in to comment.