mirror of
https://github.com/google/googletest.git
synced 2026-07-30 16:26:24 +08:00
Automated Code Change
PiperOrigin-RevId: 955017590 Change-Id: I5125f56376603462fb63796fec1fbc50fd4d935f
This commit is contained in:
parent
ecb18f0b03
commit
af4c3cfcb3
@ -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.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user