aboutsummaryrefslogtreecommitdiff
path: root/crypto/bio
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2024-02-21 23:21:16 -0500
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-02-23 18:08:53 +0000
commitec2a08dda8e7b156253abcf21f2c7ea80de39f82 (patch)
tree44b1ae747b5632d80c3860f88abc85f0267c2348 /crypto/bio
parent85c5d9668fe3aef03dc3b5099adc549039a79ff9 (diff)
downloadboringssl-ec2a08dda8e7b156253abcf21f2c7ea80de39f82.zip
boringssl-ec2a08dda8e7b156253abcf21f2c7ea80de39f82.tar.gz
boringssl-ec2a08dda8e7b156253abcf21f2c7ea80de39f82.tar.bz2
Introduce a test helper for asserting on the error
This produces slightly nicer output, is less code, and helps us remember to check both the library and reason code. Change-Id: Ic49508accb0bc8a25cbb5b94cc7e4aeb1bd8cbd0 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66507 Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bio_test.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/bio/bio_test.cc b/crypto/bio/bio_test.cc
index 65324d0..d44c9dd 100644
--- a/crypto/bio/bio_test.cc
+++ b/crypto/bio/bio_test.cc
@@ -813,10 +813,7 @@ TEST_P(BIOPairTest, TestPair) {
// A closed write end may not be written to.
EXPECT_EQ(0u, BIO_ctrl_get_write_guarantee(bio1));
EXPECT_EQ(-1, BIO_write(bio1, "_____", 5));
-
- uint32_t err = ERR_get_error();
- EXPECT_EQ(ERR_LIB_BIO, ERR_GET_LIB(err));
- EXPECT_EQ(BIO_R_BROKEN_PIPE, ERR_GET_REASON(err));
+ EXPECT_TRUE(ErrorEquals(ERR_get_error(), ERR_LIB_BIO, BIO_R_BROKEN_PIPE));
// The other end is still functional.
EXPECT_EQ(5, BIO_write(bio2, "12345", 5));