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

Unified Diff: test/very_long_input.dart

Issue 1348823004: test large inputs for sha1 and sha256, also remove unused import (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: tweaks from review Created 5 years, 3 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
« no previous file with comments | « test/sha256_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/very_long_input.dart
diff --git a/test/very_long_input.dart b/test/very_long_input.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b3e72b3e00f1761b2ce686bfde60f466bcb47c4d
--- /dev/null
+++ b/test/very_long_input.dart
@@ -0,0 +1,14 @@
+library very_long_input_test;
+
+import 'package:crypto/crypto.dart';
+import 'package:test/test.dart';
+
+veryLongInput(digester, int byteLength, String verify) {
+ var nullCharacter = '\u0000'.codeUnitAt(0);
+ var input = [nullCharacter];
+ for (var i = 0; i < byteLength; i++) {
+ digester.add(input);
+ }
+ var d = digester.close();
+ expect(CryptoUtils.bytesToHex(d), verify);
+}
« no previous file with comments | « test/sha256_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698