mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Add a test case for writing a double to a filled buffer.
This commit is contained in:
parent
87545b0af4
commit
5f9574c3c1
@ -328,6 +328,14 @@ TEST(WriterTest, WriteDoubleAtBufferBoundary) {
|
||||
writer << 1.23456789;
|
||||
}
|
||||
|
||||
TEST(WriterTest, WriteDoubleWithFilledBuffer) {
|
||||
fmt::Writer writer;
|
||||
// Fill the buffer.
|
||||
for (int i = 0; i < fmt::internal::INLINE_BUFFER_SIZE; ++i)
|
||||
writer << ' ';
|
||||
writer << 1.2;
|
||||
}
|
||||
|
||||
TEST(WriterTest, WriteChar) {
|
||||
CHECK_WRITE('a');
|
||||
}
|
||||
|
5
format.h
5
format.h
@ -92,6 +92,8 @@ FMT_GCC_EXTENSION typedef long long LongLong;
|
||||
FMT_GCC_EXTENSION typedef unsigned long long ULongLong;
|
||||
|
||||
namespace internal {
|
||||
|
||||
enum { INLINE_BUFFER_SIZE = 500 };
|
||||
|
||||
#if _SECURE_SCL
|
||||
template <typename T>
|
||||
@ -648,8 +650,7 @@ class BasicFormatter;
|
||||
template <typename Char>
|
||||
class BasicWriter {
|
||||
private:
|
||||
enum { INLINE_BUFFER_SIZE = 500 };
|
||||
mutable internal::Array<Char, INLINE_BUFFER_SIZE> buffer_; // Output buffer.
|
||||
mutable internal::Array<Char, internal::INLINE_BUFFER_SIZE> buffer_; // Output buffer.
|
||||
|
||||
friend class BasicFormatter<Char>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user