Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
4ce31695
Commit
4ce31695
authored
Apr 08, 2020
by
Artöm Bakri Al-Sarmini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed formatting, trying to fix msvc build error in appveyor
parent
a74a031b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
26 deletions
+15
-26
unit-allocator.cpp
test/src/unit-allocator.cpp
+15
-26
No files found.
test/src/unit-allocator.cpp
View file @
4ce31695
...
@@ -238,28 +238,17 @@ TEST_CASE("controlled bad_alloc")
...
@@ -238,28 +238,17 @@ TEST_CASE("controlled bad_alloc")
namespace
namespace
{
{
template
<
class
T
>
template
<
class
T
>
struct
allocator_no_forward
struct
allocator_no_forward
:
std
::
allocator
<
T
>
{
{
typedef
T
value_type
;
template
<
typename
U
>
template
<
typename
U
>
struct
rebind
struct
rebind
{
{
typedef
allocator_no_forward
<
U
>
other
;
typedef
allocator_no_forward
<
U
>
other
;
};
};
T
*
allocate
(
size_t
sz
)
template
<
class
...
Args
>
{
void
construct
(
T
*
p
,
const
Args
&
...
args
)
return
static_cast
<
T
*>
(
malloc
(
sz
*
sizeof
(
T
)));
}
void
deallocate
(
T
*
p
,
size_t
)
{
free
(
p
);
}
void
construct
(
T
*
p
,
const
T
&
arg
)
{
{
::
new
(
static_cast
<
void
*>
(
p
))
T
(
arg
);
::
new
(
static_cast
<
void
*>
(
p
))
T
(
arg
s
...
);
}
}
};
};
}
}
...
@@ -269,16 +258,16 @@ TEST_CASE("bad my_allocator::construct")
...
@@ -269,16 +258,16 @@ TEST_CASE("bad my_allocator::construct")
SECTION
(
"my_allocator::construct doesn't forward"
)
SECTION
(
"my_allocator::construct doesn't forward"
)
{
{
using
bad_alloc_json
=
nlohmann
::
basic_json
<
std
::
map
,
using
bad_alloc_json
=
nlohmann
::
basic_json
<
std
::
map
,
std
::
vector
,
std
::
vector
,
std
::
string
,
std
::
string
,
bool
,
bool
,
std
::
int64_t
,
std
::
int64_t
,
std
::
uint64_t
,
std
::
uint64_t
,
double
,
double
,
allocator_no_forward
>
;
allocator_no_forward
>
;
bad_alloc_json
json
;
bad_alloc_json
json
;
json
[
"test"
]
=
bad_alloc_json
::
array_t
();
json
[
"test"
]
=
bad_alloc_json
::
array_t
();
json
[
"test"
].
push_back
(
"should not leak"
);
json
[
"test"
].
push_back
(
"should not leak"
);
}
}
}
}
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