diff options
Diffstat (limited to 'absl/strings/escaping_test.cc')
-rw-r--r-- | absl/strings/escaping_test.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/strings/escaping_test.cc b/absl/strings/escaping_test.cc index ae3466a7..25cb685b 100644 --- a/absl/strings/escaping_test.cc +++ b/absl/strings/escaping_test.cc @@ -706,6 +706,13 @@ TEST(Escaping, HexStringToBytesBackToHex) { hex = absl::BytesToHexString(kTestBytes); EXPECT_EQ(hex, kTestHexLower); + // Same buffer. + // We do not care if this works since we do not promise it in the contract. + // The purpose of this test is to to see if the program will crash or if + // sanitizers will catch anything. + bytes = std::string(kTestHexUpper); + (void)absl::HexStringToBytes(bytes, &bytes); + // Length not a multiple of two. EXPECT_FALSE(absl::HexStringToBytes("1c2f003", &bytes)); |