OLD | NEW |
1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'dart:fletch.ffi'; | 5 import 'dart:dartino.ffi'; |
6 import 'dart:typed_data'; | 6 import 'dart:typed_data'; |
7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 import 'package:ffi/ffi.dart'; | 8 import 'package:ffi/ffi.dart'; |
9 | 9 |
10 main() { | 10 main() { |
11 testStringFunctions(); | 11 testStringFunctions(); |
12 testCircularBuffer(); | 12 testCircularBuffer(); |
13 } | 13 } |
14 | 14 |
15 testList(int size) { | 15 testList(int size) { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 memory.free(); | 136 memory.free(); |
137 | 137 |
138 var libPath = ForeignLibrary.bundleLibraryName('ffi_test_library'); | 138 var libPath = ForeignLibrary.bundleLibraryName('ffi_test_library'); |
139 ForeignLibrary fl = new ForeignLibrary.fromName(libPath); | 139 ForeignLibrary fl = new ForeignLibrary.fromName(libPath); |
140 var memstring = fl.lookup('memstring'); | 140 var memstring = fl.lookup('memstring'); |
141 var foreignPointer = memstring.pcall$0(); | 141 var foreignPointer = memstring.pcall$0(); |
142 Expect.equals('dart', cStringToString(foreignPointer)); | 142 Expect.equals('dart', cStringToString(foreignPointer)); |
143 memory = new ForeignMemory.fromAddress(foreignPointer.address, 5); | 143 memory = new ForeignMemory.fromAddress(foreignPointer.address, 5); |
144 memory.free(); | 144 memory.free(); |
145 } | 145 } |
OLD | NEW |