mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-26 12:35:32 +00:00
Fix StringRef test
This commit is contained in:
parent
89fed501d4
commit
642b72cd91
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user