Fix StringRef test

This commit is contained in:
Victor Zverovich 2015-02-24 09:52:16 -08:00
parent 89fed501d4
commit 642b72cd91

View File

@ -700,10 +700,9 @@ void test_count_digits() {
TEST(UtilTest, StringRef) { TEST(UtilTest, StringRef) {
// Test that StringRef::size() returns string length, not buffer size. // Test that StringRef::size() returns string length, not buffer size.
enum {BUFFER_SIZE = 100}; char str[100] = "some string";
char str[BUFFER_SIZE] = "some string";
EXPECT_EQ(std::strlen(str), StringRef(str).size()); EXPECT_EQ(std::strlen(str), StringRef(str).size());
EXPECT_LT(std::strlen(str), BUFFER_SIZE); EXPECT_LT(std::strlen(str), sizeof(str));
} }
TEST(UtilTest, CountDigits) { TEST(UtilTest, CountDigits) {