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
d8ef8a9e
Commit
d8ef8a9e
authored
Feb 11, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
82222218
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
99 deletions
+3
-99
include/fmt/core.h
include/fmt/core.h
+2
-4
test/container-test.cc
test/container-test.cc
+0
-94
test/format-test.cc
test/format-test.cc
+1
-1
No files found.
include/fmt/core.h
View file @
d8ef8a9e
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
# define FMT_HAS_FEATURE(x) 0
# define FMT_HAS_FEATURE(x) 0
#endif
#endif
#if
defined(__has_include)
#if
def __has_include
# define FMT_HAS_INCLUDE(x) __has_include(x)
# define FMT_HAS_INCLUDE(x) __has_include(x)
#else
#else
# define FMT_HAS_INCLUDE(x) 0
# define FMT_HAS_INCLUDE(x) 0
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
# define FMT_GCC_VERSION 0
# define FMT_GCC_VERSION 0
#endif
#endif
#if __cplusplus >= 201103L || defined
__GXX_EXPERIMENTAL_CXX0X__
#if __cplusplus >= 201103L || defined
(__GXX_EXPERIMENTAL_CXX0X__)
# define FMT_HAS_GXX_CXX11 FMT_GCC_VERSION
# define FMT_HAS_GXX_CXX11 FMT_GCC_VERSION
#else
#else
# define FMT_HAS_GXX_CXX11 0
# define FMT_HAS_GXX_CXX11 0
...
@@ -82,8 +82,6 @@
...
@@ -82,8 +82,6 @@
# endif
# endif
#endif
#endif
#define FMT_USE_STRONG_ENUMS FMT_HAS_FEATURE(cxx_strong_enums)
// Check if exceptions are disabled.
// Check if exceptions are disabled.
#if defined(__GNUC__) && !defined(__EXCEPTIONS)
#if defined(__GNUC__) && !defined(__EXCEPTIONS)
# define FMT_EXCEPTIONS 0
# define FMT_EXCEPTIONS 0
...
...
test/container-test.cc
deleted
100644 → 0
View file @
82222218
/*
Tests of container utilities
Copyright (c) 2012 - 2016, Victor Zverovich
All rights reserved.
For the license information refer to format.h.
*/
#include "fmt/container.h"
#include "gtest/gtest.h"
using
fmt
::
internal
::
ContainerBuffer
;
TEST
(
ContainerBufferTest
,
Empty
)
{
std
::
string
data
;
ContainerBuffer
<
std
::
string
>
buffer
(
data
);
EXPECT_EQ
(
0u
,
buffer
.
size
());
EXPECT_EQ
(
0u
,
buffer
.
capacity
());
}
TEST
(
ContainerBufferTest
,
Reserve
)
{
std
::
string
data
;
ContainerBuffer
<
std
::
string
>
buffer
(
data
);
std
::
size_t
capacity
=
std
::
string
().
capacity
()
+
10
;
buffer
.
reserve
(
capacity
);
EXPECT_EQ
(
0u
,
buffer
.
size
());
EXPECT_EQ
(
capacity
,
buffer
.
capacity
());
}
TEST
(
ContainerBufferTest
,
Resize
)
{
std
::
string
data
;
ContainerBuffer
<
std
::
string
>
buffer
(
data
);
std
::
size_t
size
=
std
::
string
().
capacity
()
+
10
;
buffer
.
resize
(
size
);
EXPECT_EQ
(
size
,
buffer
.
size
());
EXPECT_EQ
(
size
,
buffer
.
capacity
());
}
TEST
(
ContainerBufferTest
,
Append
)
{
std
::
string
data
(
"Why so"
);
const
std
::
string
serious
(
" serious"
);
ContainerBuffer
<
std
::
string
>
buffer
(
data
);
buffer
.
append
(
serious
.
c_str
(),
serious
.
c_str
()
+
serious
.
length
());
EXPECT_EQ
(
"Why so serious"
,
data
);
EXPECT_EQ
(
data
.
length
(),
buffer
.
size
());
}
TEST
(
BasicContainerWriterTest
,
String
)
{
std
::
string
data
;
fmt
::
BasicContainerWriter
<
std
::
string
>
out
(
data
);
out
<<
"The answer is "
<<
42
<<
"
\n
"
;
EXPECT_EQ
(
"The answer is 42
\n
"
,
data
);
EXPECT_EQ
(
17u
,
out
.
size
());
}
TEST
(
BasicContainerWriterTest
,
WString
)
{
std
::
wstring
data
;
fmt
::
BasicContainerWriter
<
std
::
wstring
>
out
(
data
);
out
<<
"The answer is "
<<
42
<<
"
\n
"
;
EXPECT_EQ
(
L"The answer is 42
\n
"
,
data
);
EXPECT_EQ
(
17u
,
out
.
size
());
}
TEST
(
BasicContainerWriterTest
,
Vector
)
{
std
::
vector
<
char
>
data
;
fmt
::
BasicContainerWriter
<
std
::
vector
<
char
>
>
out
(
data
);
out
<<
"The answer is "
<<
42
<<
"
\n
"
;
EXPECT_EQ
(
17u
,
data
.
size
());
EXPECT_EQ
(
out
.
size
(),
data
.
size
());
}
TEST
(
BasicContainerWriterTest
,
StringAppend
)
{
std
::
string
data
(
"The"
);
fmt
::
BasicContainerWriter
<
std
::
string
>
out
(
data
);
EXPECT_EQ
(
3u
,
data
.
size
());
EXPECT_EQ
(
3u
,
out
.
size
());
out
<<
" answer is "
<<
42
<<
"
\n
"
;
EXPECT_EQ
(
"The answer is 42
\n
"
,
data
);
EXPECT_EQ
(
17u
,
out
.
size
());
}
TEST
(
BasicContainerWriterTest
,
VectorAppend
)
{
std
::
vector
<
char
>
data
;
data
.
push_back
(
'T'
);
data
.
push_back
(
'h'
);
data
.
push_back
(
'e'
);
fmt
::
BasicContainerWriter
<
std
::
vector
<
char
>
>
out
(
data
);
EXPECT_EQ
(
3u
,
data
.
size
());
EXPECT_EQ
(
3u
,
out
.
size
());
out
<<
" answer is "
<<
42
<<
"
\n
"
;
EXPECT_EQ
(
17u
,
data
.
size
());
EXPECT_EQ
(
17u
,
out
.
size
());
}
test/format-test.cc
View file @
d8ef8a9e
...
@@ -1508,7 +1508,7 @@ TEST(FormatTest, Enum) {
...
@@ -1508,7 +1508,7 @@ TEST(FormatTest, Enum) {
EXPECT_EQ
(
"0"
,
fmt
::
format
(
"{}"
,
A
));
EXPECT_EQ
(
"0"
,
fmt
::
format
(
"{}"
,
A
));
}
}
#if FMT_
USE_STRONG_ENUMS
#if FMT_
HAS_FEATURE(cxx_strong_enums)
enum
TestFixedEnum
:
short
{
B
};
enum
TestFixedEnum
:
short
{
B
};
TEST
(
FormatTest
,
FixedEnum
)
{
TEST
(
FormatTest
,
FixedEnum
)
{
...
...
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