Test that StringRef size computation

This commit is contained in:
Victor Zverovich 2014-10-30 06:27:44 -07:00
parent d5a6316d5c
commit 10d83aaa52

View File

@ -698,6 +698,12 @@ void test_count_digits() {
}
}
TEST(UtilTest, StringRef) {
char space[PATH_MAX];
snprintf(space, sizeof(space), "some string");
EXPECT_EQ(sizeof("some string") - 1, StringRef(space).size());
}
TEST(UtilTest, CountDigits) {
test_count_digits<uint32_t>();
test_count_digits<uint64_t>();