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

Unified Diff: test/dart_codegen/expect/convert/byte_conversion.dart

Issue 963593002: Disable formatting and add new-lines to make tests faster. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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: test/dart_codegen/expect/convert/byte_conversion.dart
diff --git a/test/dart_codegen/expect/convert/byte_conversion.dart b/test/dart_codegen/expect/convert/byte_conversion.dart
index 34e050bfa1567f5d71cd61127b10931bec699083..d4b387019e2bddcc5e66a3d7a20385f249b689ed 100644
--- a/test/dart_codegen/expect/convert/byte_conversion.dart
+++ b/test/dart_codegen/expect/convert/byte_conversion.dart
@@ -1,57 +1,49 @@
part of dart.convert;
-
-abstract class ByteConversionSink extends ChunkedConversionSink<List<int>> {
- ByteConversionSink();
- factory ByteConversionSink.withCallback(
- void callback(List<int> accumulated)) = _ByteCallbackSink;
- factory ByteConversionSink.from(Sink<List<int>> sink) = _ByteAdapterSink;
- void addSlice(List<int> chunk, int start, int end, bool isLast);
-}
-abstract class ByteConversionSinkBase extends ByteConversionSink {
- void add(List<int> chunk);
- void close();
- void addSlice(List<int> chunk, int start, int end, bool isLast) {
- add(chunk.sublist(start, end));
- if (isLast) close();
- }
-}
-class _ByteAdapterSink extends ByteConversionSinkBase {
- final Sink<List<int>> _sink;
- _ByteAdapterSink(this._sink);
- void add(List<int> chunk) => _sink.add(chunk);
- void close() => _sink.close();
-}
-class _ByteCallbackSink extends ByteConversionSinkBase {
- static const _INITIAL_BUFFER_SIZE = 1024;
- final _ChunkedConversionCallback<List<int>> _callback;
- List<int> _buffer = new Uint8List(_INITIAL_BUFFER_SIZE);
- int _bufferIndex = 0;
- _ByteCallbackSink(void callback(List<int> accumulated))
- : this._callback = callback;
- void add(Iterable<int> chunk) {
- int freeCount = _buffer.length - _bufferIndex;
- if (chunk.length > freeCount) {
- int oldLength = _buffer.length;
- int newLength = _roundToPowerOf2(chunk.length + oldLength) * 2;
- List<int> grown = new Uint8List(newLength);
- grown.setRange(0, _buffer.length, _buffer);
- _buffer = grown;
- }
- _buffer.setRange(_bufferIndex, _bufferIndex + chunk.length, chunk);
- _bufferIndex += chunk.length;
- }
- static int _roundToPowerOf2(int v) {
- assert(v > 0);
- v--;
- v |= v >> 1;
- v |= v >> 2;
- v |= v >> 4;
- v |= v >> 8;
- v |= v >> 16;
- v++;
- return v;
- }
- void close() {
- _callback(_buffer.sublist(0, _bufferIndex));
- }
+ abstract class ByteConversionSink extends ChunkedConversionSink<List<int>> {ByteConversionSink();
+ factory ByteConversionSink.withCallback(void callback(List<int> accumulated)) = _ByteCallbackSink;
+ factory ByteConversionSink.from(Sink<List<int>> sink) = _ByteAdapterSink;
+ void addSlice(List<int> chunk, int start, int end, bool isLast);
+}
+ abstract class ByteConversionSinkBase extends ByteConversionSink {void add(List<int> chunk);
+ void close();
+ void addSlice(List<int> chunk, int start, int end, bool isLast) {
+add(chunk.sublist(start, end));
+ if (isLast) close();
+}
+}
+ class _ByteAdapterSink extends ByteConversionSinkBase {final Sink<List<int>> _sink;
+ _ByteAdapterSink(this._sink);
+ void add(List<int> chunk) => _sink.add(chunk);
+ void close() => _sink.close();
+}
+ class _ByteCallbackSink extends ByteConversionSinkBase {static const _INITIAL_BUFFER_SIZE = 1024;
+ final _ChunkedConversionCallback<List<int>> _callback;
+ List<int> _buffer = new Uint8List(_INITIAL_BUFFER_SIZE);
+ int _bufferIndex = 0;
+ _ByteCallbackSink(void callback(List<int> accumulated)) : this._callback = callback;
+ void add(Iterable<int> chunk) {
+int freeCount = _buffer.length - _bufferIndex;
+ if (chunk.length > freeCount) {
+int oldLength = _buffer.length;
+ int newLength = _roundToPowerOf2(chunk.length + oldLength) * 2;
+ List<int> grown = new Uint8List(newLength);
+ grown.setRange(0, _buffer.length, _buffer);
+ _buffer = grown;
+}
+ _buffer.setRange(_bufferIndex, _bufferIndex + chunk.length, chunk);
+ _bufferIndex += chunk.length;
+}
+ static int _roundToPowerOf2(int v) {
+assert (v > 0); v--;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ v++;
+ return v;
+}
+ void close() {
+_callback(_buffer.sublist(0, _bufferIndex));
+}
}

Powered by Google App Engine
This is Rietveld 408576698