Make inline_buffer_size public and update docs
This commit is contained in:
@@ -94,7 +94,7 @@ TEST(FormatTest, FormatErrorCode) {
|
||||
{
|
||||
fmt::memory_buffer buffer;
|
||||
std::string prefix(
|
||||
fmt::internal::INLINE_BUFFER_SIZE - msg.size() - sep.size() + 1, 'x');
|
||||
fmt::inline_buffer_size - msg.size() - sep.size() + 1, 'x');
|
||||
fmt::format_error_code(buffer, 42, prefix);
|
||||
EXPECT_EQ(msg, to_string(buffer));
|
||||
}
|
||||
@@ -104,10 +104,10 @@ TEST(FormatTest, FormatErrorCode) {
|
||||
msg = fmt::format("error {}", codes[i]);
|
||||
fmt::memory_buffer buffer;
|
||||
std::string prefix(
|
||||
fmt::internal::INLINE_BUFFER_SIZE - msg.size() - sep.size(), 'x');
|
||||
fmt::inline_buffer_size - msg.size() - sep.size(), 'x');
|
||||
fmt::format_error_code(buffer, codes[i], prefix);
|
||||
EXPECT_EQ(prefix + sep + msg, to_string(buffer));
|
||||
std::size_t size = fmt::internal::INLINE_BUFFER_SIZE;
|
||||
std::size_t size = fmt::inline_buffer_size;
|
||||
EXPECT_EQ(size, buffer.size());
|
||||
buffer.resize(0);
|
||||
// Test with a message that doesn't fit into the buffer.
|
||||
|
||||
+2
-2
@@ -192,11 +192,11 @@ TEST(WriterTest, WriteDoubleWithFilledBuffer) {
|
||||
memory_buffer buf;
|
||||
fmt::writer writer(buf);
|
||||
// Fill the buffer.
|
||||
for (int i = 0; i < fmt::internal::INLINE_BUFFER_SIZE; ++i)
|
||||
for (int i = 0; i < fmt::inline_buffer_size; ++i)
|
||||
writer.write(' ');
|
||||
writer.write(1.2);
|
||||
fmt::string_view sv(buf.data(), buf.size());
|
||||
sv.remove_prefix(fmt::internal::INLINE_BUFFER_SIZE);
|
||||
sv.remove_prefix(fmt::inline_buffer_size);
|
||||
EXPECT_EQ("1.2", sv);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -341,7 +341,7 @@ TEST(MemoryBufferTest, Allocator) {
|
||||
{
|
||||
basic_memory_buffer<char, 10, TestAllocator> buffer2((TestAllocator(&alloc)));
|
||||
EXPECT_EQ(&alloc, buffer2.get_allocator().get());
|
||||
std::size_t size = 2 * fmt::internal::INLINE_BUFFER_SIZE;
|
||||
std::size_t size = 2 * fmt::inline_buffer_size;
|
||||
EXPECT_CALL(alloc, allocate(size)).WillOnce(Return(&mem));
|
||||
buffer2.reserve(size);
|
||||
EXPECT_CALL(alloc, deallocate(&mem, size));
|
||||
@@ -352,7 +352,7 @@ TEST(MemoryBufferTest, ExceptionInDeallocate) {
|
||||
typedef AllocatorRef< MockAllocator<char> > TestAllocator;
|
||||
StrictMock< MockAllocator<char> > alloc;
|
||||
basic_memory_buffer<char, 10, TestAllocator> buffer((TestAllocator(&alloc)));
|
||||
std::size_t size = 2 * fmt::internal::INLINE_BUFFER_SIZE;
|
||||
std::size_t size = 2 * fmt::inline_buffer_size;
|
||||
std::vector<char> mem(size);
|
||||
{
|
||||
EXPECT_CALL(alloc, allocate(size)).WillOnce(Return(&mem[0]));
|
||||
|
||||
Reference in New Issue
Block a user