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
4511030a
Commit
4511030a
authored
Dec 23, 2021
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code style tweaks for consistency
parent
7812813a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
test/args-test.cc
test/args-test.cc
+8
-15
No files found.
test/args-test.cc
View file @
4511030a
...
@@ -175,19 +175,12 @@ TEST(args_test, throw_on_copy) {
...
@@ -175,19 +175,12 @@ TEST(args_test, throw_on_copy) {
}
}
TEST
(
args_test
,
move_constructor
)
{
TEST
(
args_test
,
move_constructor
)
{
const
int
test_integer
=
42
;
using
store_type
=
fmt
::
dynamic_format_arg_store
<
fmt
::
format_context
>
;
const
char
*
const
test_c_string
=
"foo"
;
auto
store
=
std
::
unique_ptr
<
store_type
>
(
new
store_type
());
store
->
push_back
(
42
);
std
::
unique_ptr
<
fmt
::
dynamic_format_arg_store
<
fmt
::
format_context
>>
store
->
push_back
(
std
::
string
(
"foo"
));
store_uptr
(
new
fmt
::
dynamic_format_arg_store
<
fmt
::
format_context
>
());
store
->
push_back
(
fmt
::
arg
(
"a1"
,
"foo"
));
store_uptr
->
push_back
(
test_integer
);
auto
moved_store
=
std
::
move
(
*
store
);
store_uptr
->
push_back
(
std
::
string
(
test_c_string
));
store
.
reset
();
store_uptr
->
push_back
(
fmt
::
arg
(
"a1"
,
test_c_string
));
EXPECT_EQ
(
fmt
::
vformat
(
"{} {} {a1}"
,
moved_store
),
"42 foo foo"
);
fmt
::
dynamic_format_arg_store
<
fmt
::
format_context
>
moved_store
(
std
::
move
(
*
store_uptr
));
store_uptr
.
reset
();
EXPECT_EQ
(
fmt
::
vformat
(
"{} {} {a1}"
,
moved_store
),
std
::
to_string
(
test_integer
)
+
" "
+
test_c_string
+
" "
+
test_c_string
);
}
}
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