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

Unified Diff: crypto/encryptor_unittest.cc

Issue 8511050: Unify the error checking of crypto::Encryptor and add WARN_UNUSED_RESULT to prevent misuse. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 8 years, 11 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 | « crypto/encryptor_openssl.cc ('k') | crypto/encryptor_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/encryptor_unittest.cc
diff --git a/crypto/encryptor_unittest.cc b/crypto/encryptor_unittest.cc
index 7f2caf9f7e2374720fb67e5d8478a9ed8a0f9282..4f470d4a56b97e85d00dd29558885031cd8e63ae 100644
--- a/crypto/encryptor_unittest.cc
+++ b/crypto/encryptor_unittest.cc
@@ -78,7 +78,7 @@ TEST(EncryptorTest, CTRCounter) {
// Increment 10 times.
crypto::Encryptor::Counter counter1(std::string(kTest1, kCounterSize));
for (int i = 0; i < 10; ++i)
- counter1.Increment();
+ EXPECT_TRUE(counter1.Increment());
counter1.Write(buf);
EXPECT_EQ(0, memcmp(buf, kTest1, 15));
EXPECT_TRUE(buf[15] == 10);
@@ -88,7 +88,7 @@ TEST(EncryptorTest, CTRCounter) {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const char kExpect2[] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0};
crypto::Encryptor::Counter counter2(std::string(kTest2, kCounterSize));
- counter2.Increment();
+ EXPECT_TRUE(counter2.Increment());
counter2.Write(buf);
EXPECT_EQ(0, memcmp(buf, kExpect2, kCounterSize));
@@ -96,7 +96,7 @@ TEST(EncryptorTest, CTRCounter) {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const char kExpect3[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
crypto::Encryptor::Counter counter3(std::string(kTest3, kCounterSize));
- counter3.Increment();
+ EXPECT_TRUE(counter3.Increment());
counter3.Write(buf);
EXPECT_EQ(0, memcmp(buf, kExpect3, kCounterSize));
}
« no previous file with comments | « crypto/encryptor_openssl.cc ('k') | crypto/encryptor_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698