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

Unified Diff: crypto/random_unittest.cc

Issue 6873156: Move crypto_helpers from sync to base (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Correct headers. Created 9 years, 8 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
« crypto/random.cc ('K') | « crypto/random.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/random_unittest.cc
diff --git a/crypto/random_unittest.cc b/crypto/random_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e173e0921620e5a7f25d48fbcaf9bee8545f44a1
--- /dev/null
+++ b/crypto/random_unittest.cc
@@ -0,0 +1,16 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "crypto/random.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(CryptoHelpers, GetRandomBytes) {
+ for (int i = 1; i < 25; ++i) {
+ std::string random_bytes(i+1, ' ');
wtc 2011/04/28 19:42:22 Nit: Google Style Guide recommends adding spaces a
+ do {
+ GetRandomBytes(&random_bytes[0], i);
+ ASSERT_EQ(random_bytes[i], ' ');
+ } while (random_bytes[i - 1] == ' ');
+ }
+}
« crypto/random.cc ('K') | « crypto/random.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698