Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: pkg/analyzer/test/src/summary/flat_buffers_test.dart

Issue 1747663002: Support for boolean lists in FlatBuffer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/summary/flat_buffers_test.dart
diff --git a/pkg/analyzer/test/src/summary/flat_buffers_test.dart b/pkg/analyzer/test/src/summary/flat_buffers_test.dart
index 46339a20c8826be6b17a3450ce7d2d40482cbbe8..7539e6b6a20a8bdb0297a7aeeb770b8dfe2f9816 100644
--- a/pkg/analyzer/test/src/summary/flat_buffers_test.dart
+++ b/pkg/analyzer/test/src/summary/flat_buffers_test.dart
@@ -192,6 +192,28 @@ class BuilderTest {
expect(items, orderedEquals(values));
}
+ void test_writeList_ofBool() {
Paul Berry 2016/02/29 21:12:32 This test only exercises a List<bool> of length 10
+ List<int> trueBits = <int>[0, 3, 30, 60, 90, 99];
+ // write
+ List<int> byteList;
+ {
+ Builder builder = new Builder(initialSize: 0);
+ List<bool> values = new List<bool>.filled(100, false);
+ for (int bit in trueBits) {
+ values[bit] = true;
+ }
+ Offset offset = builder.writeListBool(values);
+ byteList = builder.finish(offset);
+ }
+ // read and verify
+ BufferPointer root = new BufferPointer.fromBytes(byteList);
+ List<bool> items = const BoolListReader().read(root);
+ expect(items, hasLength(100));
+ for (int i = 0; i < items.length; i++) {
+ expect(items[i], trueBits.contains(i), reason: 'bit $i');
+ }
+ }
+
void test_writeList_ofFloat64() {
List<double> values = <double>[-1.234567, 3.4E+9, -5.6E-13, 7.8, 12.13];
// write

Powered by Google App Engine
This is Rietveld 408576698