Skip to content

Commit

Permalink
Bug 1351270 - [Coverity 1403257] Don't let ssl_gtests throw exception…
Browse files Browse the repository at this point in the history
…s in destructors r=mt

Differential Revision: https://nss-review.dev.mozaws.net/D281

--HG--
extra : amend_source : cee9be3ba5c556285cfd353cb36edebc36307810
  • Loading branch information
Tim Taubert committed Mar 28, 2017
1 parent 103c44c commit 2de885c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions gtests/ssl_gtest/tls_agent.cc
Expand Up @@ -89,10 +89,15 @@ TlsAgent::~TlsAgent() {
Poller::Instance()->Cancel(READABLE_EVENT, adapter_);
}

EXPECT_EQ(expected_received_alert_, kTlsAlertCloseNotify);
EXPECT_EQ(expected_received_alert_level_, kTlsAlertWarning);
EXPECT_EQ(expected_sent_alert_, kTlsAlertCloseNotify);
EXPECT_EQ(expected_sent_alert_level_, kTlsAlertWarning);
// Add failures manually, if any, so we don't throw in a destructor.
if (expected_received_alert_ != kTlsAlertCloseNotify ||
expected_received_alert_level_ != kTlsAlertWarning) {
ADD_FAILURE() << "Wrong expected_received_alert status";
}
if (expected_sent_alert_ != kTlsAlertCloseNotify ||
expected_sent_alert_level_ != kTlsAlertWarning) {
ADD_FAILURE() << "Wrong expected_sent_alert status";
}
}

void TlsAgent::SetState(State state) {
Expand Down

0 comments on commit 2de885c

Please sign in to comment.