Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
5f9574c3
Commit
5f9574c3
authored
Apr 09, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test case for writing a double to a filled buffer.
parent
87545b0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
format-test.cc
format-test.cc
+8
-0
format.h
format.h
+3
-2
No files found.
format-test.cc
View file @
5f9574c3
...
...
@@ -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'
);
}
...
...
format.h
View file @
5f9574c3
...
...
@@ -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
>
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment