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

Unified Diff: crypto/p224_unittest.cc

Issue 2677583002: Fix non-noise cpplint errors in //crypto. (Closed)
Patch Set: fix p224_unittest.cc Created 3 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/p224_spake.cc ('k') | crypto/random.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/p224_unittest.cc
diff --git a/crypto/p224_unittest.cc b/crypto/p224_unittest.cc
index faa08ebd360df974aba8a060db52c6e14f58cbde..8cfe6e7dc0d065a8e14fba7e556712bfe44dbde3 100644
--- a/crypto/p224_unittest.cc
+++ b/crypto/p224_unittest.cc
@@ -778,8 +778,8 @@ TEST(P224, ExternalToInternalAndBack) {
const std::string external = point.ToString();
ASSERT_EQ(external.size(), 56u);
- EXPECT_TRUE(memcmp(external.data(), kBasePointExternal,
- sizeof(kBasePointExternal)) == 0);
+ EXPECT_EQ(0, memcmp(external.data(), kBasePointExternal,
+ sizeof(kBasePointExternal)));
}
TEST(P224, ScalarBaseMult) {
@@ -789,8 +789,8 @@ TEST(P224, ScalarBaseMult) {
p224::ScalarBaseMult(kNISTTestVectors[i].scalar, &point);
const std::string external = point.ToString();
ASSERT_EQ(external.size(), 56u);
- EXPECT_TRUE(memcmp(external.data(), kNISTTestVectors[i].affine,
- external.size()) == 0);
+ EXPECT_EQ(0, memcmp(external.data(), kNISTTestVectors[i].affine,
+ external.size()));
}
}
@@ -804,9 +804,9 @@ TEST(P224, Addition) {
p224::Negate(b, &minus_b);
p224::Add(a, b, &sum);
- EXPECT_TRUE(memcmp(&sum, &a, sizeof(sum)) != 0);
+ EXPECT_NE(0, memcmp(&sum, &a, sizeof(sum)));
p224::Add(minus_b, sum, &a_again);
- EXPECT_TRUE(a_again.ToString() == a.ToString());
+ EXPECT_EQ(a_again.ToString(), a.ToString());
}
TEST(P224, Infinity) {
@@ -816,7 +816,7 @@ TEST(P224, Infinity) {
// Test that x^0 = ∞.
Point a;
p224::ScalarBaseMult(reinterpret_cast<const uint8_t*>(zeros), &a);
- EXPECT_TRUE(memcmp(zeros, a.ToString().data(), sizeof(zeros)) == 0);
+ EXPECT_EQ(0, memcmp(zeros, a.ToString().data(), sizeof(zeros)));
// We shouldn't allow ∞ to be imported.
EXPECT_FALSE(a.SetFromString(std::string(zeros, sizeof(zeros))));
« no previous file with comments | « crypto/p224_spake.cc ('k') | crypto/random.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698