Automated Code Change

PiperOrigin-RevId: 955017590
Change-Id: I5125f56376603462fb63796fec1fbc50fd4d935f
This commit is contained in:
Abseil Team 2026-07-27 21:56:57 -07:00 committed by Copybara-Service
parent ecb18f0b03
commit af4c3cfcb3

View File

@ -39,6 +39,8 @@
#include "sample2.h" #include "sample2.h"
#include <iterator>
#include "gtest/gtest.h" #include "gtest/gtest.h"
namespace { namespace {
// In this example, we test the MyString class (a simple string). // In this example, we test the MyString class (a simple string).
@ -78,7 +80,7 @@ const char kHelloString[] = "Hello, world!";
TEST(MyString, ConstructorFromCString) { TEST(MyString, ConstructorFromCString) {
const MyString s(kHelloString); const MyString s(kHelloString);
EXPECT_EQ(0, strcmp(s.c_string(), kHelloString)); EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));
EXPECT_EQ(sizeof(kHelloString) / sizeof(kHelloString[0]) - 1, s.Length()); EXPECT_EQ(std::size(kHelloString) - 1, s.Length());
} }
// Tests the copy c'tor. // Tests the copy c'tor.