Skip to content

Commit

Permalink
Bug 1521578, fix ASSERT_* usage in gtests for older compilers, a=bustage
Browse files Browse the repository at this point in the history
  • Loading branch information
ueno committed Mar 29, 2019
1 parent ef9fde8 commit f7c881f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gtests/ssl_gtest/ssl_extension_unittest.cc
Expand Up @@ -502,19 +502,19 @@ TEST_P(TlsExtensionTest12, SupportedCurvesDisableX25519) {
const DataBuffer& ext1 = capture1->extension();

uint32_t count;
ASSERT_EQ(true, ext1.Read(0, 2, &count));
ASSERT_TRUE(ext1.Read(0, 2, &count));

// Whether or not we've seen x25519 offered in this handshake.
bool seen1_x25519 = false;
for (size_t offset = 2; offset <= count; offset++) {
uint32_t val;
ASSERT_EQ(true, ext1.Read(offset, 2, &val));
ASSERT_TRUE(ext1.Read(offset, 2, &val));
if (val == ssl_grp_ec_curve25519) {
seen1_x25519 = true;
break;
}
}
ASSERT_EQ(true, seen1_x25519);
ASSERT_TRUE(seen1_x25519);

// Ensure that we can disable its use in the key exchange.
rv = NSS_SetAlgorithmPolicy(SEC_OID_CURVE25519, 0, NSS_USE_ALG_IN_SSL_KX);
Expand All @@ -532,21 +532,21 @@ TEST_P(TlsExtensionTest12, SupportedCurvesDisableX25519) {
EXPECT_TRUE(capture2->captured());
const DataBuffer& ext2 = capture2->extension();

ASSERT_EQ(true, ext2.Read(0, 2, &count));
ASSERT_TRUE(ext2.Read(0, 2, &count));

// Whether or not we've seen x25519 offered in this handshake.
bool seen2_x25519 = false;
for (size_t offset = 2; offset <= count; offset++) {
uint32_t val;
ASSERT_EQ(true, ext2.Read(offset, 2, &val));
ASSERT_TRUE(ext2.Read(offset, 2, &val));

if (val == ssl_grp_ec_curve25519) {
seen2_x25519 = true;
break;
}
}

ASSERT_EQ(false, seen2_x25519);
ASSERT_FALSE(seen2_x25519);
}

TEST_P(TlsExtensionTestPre13, SupportedPointsEmpty) {
Expand Down

0 comments on commit f7c881f

Please sign in to comment.