Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
1f80387f
Commit
1f80387f
authored
Jan 06, 2021
by
Ralf W. Grosse-Kunstleve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved labeling of TEST_CASEs.
parent
bb82add4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
tests/core/smart_holder_poc_test.cpp
+10
-10
No files found.
tests/core/smart_holder_poc_test.cpp
View file @
1f80387f
...
...
@@ -14,7 +14,7 @@ struct functor_builtin_delete {
}
// namespace helpers
TEST_CASE
(
"from_raw_ptr_take_ownership
=const_value_ref
"
)
{
TEST_CASE
(
"from_raw_ptr_take_ownership
+const_value_ref"
,
"[feasible]
"
)
{
smart_holder
hld
;
REQUIRE
(
!
hld
.
has_pointee
());
hld
.
from_raw_ptr_take_ownership
(
new
int
(
19
));
...
...
@@ -22,14 +22,14 @@ TEST_CASE("from_raw_ptr_take_ownership=const_value_ref") {
REQUIRE
(
hld
.
const_value_ref
<
int
>
()
==
19
);
}
TEST_CASE
(
"from_raw_ptr_unowned
=const_value_ref
"
)
{
TEST_CASE
(
"from_raw_ptr_unowned
+const_value_ref"
,
"[feasible]
"
)
{
static
int
value
=
19
;
smart_holder
hld
;
hld
.
from_raw_ptr_unowned
(
&
value
);
REQUIRE
(
hld
.
const_value_ref
<
int
>
()
==
19
);
}
TEST_CASE
(
"
as_raw_ptr_release_ownership
"
)
{
TEST_CASE
(
"
from_raw_ptr_take_ownership+as_raw_ptr_release_ownership"
,
"[feasible]
"
)
{
smart_holder
hld
;
hld
.
from_raw_ptr_take_ownership
(
new
int
(
19
));
auto
new_owner
=
...
...
@@ -37,7 +37,7 @@ TEST_CASE("as_raw_ptr_release_ownership") {
REQUIRE
(
!
hld
.
has_pointee
());
}
TEST_CASE
(
"
as_raw_ptr_unowned
"
)
{
TEST_CASE
(
"
from_raw_ptr_take_ownership+as_raw_ptr_unowned"
,
"[feasible]
"
)
{
smart_holder
hld
;
hld
.
from_raw_ptr_take_ownership
(
new
int
(
19
));
int
*
raw_ptr
=
hld
.
as_raw_ptr_unowned
<
int
>
();
...
...
@@ -45,7 +45,7 @@ TEST_CASE("as_raw_ptr_unowned") {
REQUIRE
(
*
raw_ptr
==
19
);
}
TEST_CASE
(
"from_unique_ptr
=const_value_ref
"
)
{
TEST_CASE
(
"from_unique_ptr
+const_value_ref+const_value_ref"
,
"[feasible]
"
)
{
std
::
unique_ptr
<
int
>
orig_owner
(
new
int
(
19
));
smart_holder
hld
;
hld
.
from_unique_ptr
(
std
::
move
(
orig_owner
));
...
...
@@ -53,7 +53,7 @@ TEST_CASE("from_unique_ptr=const_value_ref") {
REQUIRE
(
hld
.
const_value_ref
<
int
>
()
==
19
);
}
TEST_CASE
(
"
as_unique_ptr
"
)
{
TEST_CASE
(
"
from_raw_ptr_take_ownership+as_unique_ptr"
,
"[feasible]
"
)
{
smart_holder
hld
;
hld
.
from_raw_ptr_take_ownership
(
new
int
(
19
));
auto
new_owner
=
hld
.
as_unique_ptr
<
int
>
();
...
...
@@ -61,7 +61,7 @@ TEST_CASE("as_unique_ptr") {
REQUIRE
(
*
new_owner
==
19
);
}
TEST_CASE
(
"from_unique_ptr_with_deleter
=const_value_ref
"
)
{
TEST_CASE
(
"from_unique_ptr_with_deleter
+const_value_ref"
,
"[feasible]
"
)
{
std
::
unique_ptr
<
int
,
helpers
::
functor_builtin_delete
<
int
>>
orig_owner
(
new
int
(
19
));
smart_holder
hld
;
...
...
@@ -70,7 +70,7 @@ TEST_CASE("from_unique_ptr_with_deleter=const_value_ref") {
REQUIRE
(
hld
.
const_value_ref
<
int
>
()
==
19
);
}
TEST_CASE
(
"
as_unique_ptr_with_deleter
"
)
{
TEST_CASE
(
"
from_unique_ptr_with_deleter+as_unique_ptr_with_deleter"
,
"[feasible]
"
)
{
std
::
unique_ptr
<
int
,
helpers
::
functor_builtin_delete
<
int
>>
orig_owner
(
new
int
(
19
));
smart_holder
hld
;
...
...
@@ -82,7 +82,7 @@ TEST_CASE("as_unique_ptr_with_deleter") {
REQUIRE
(
*
new_owner
==
19
);
}
TEST_CASE
(
"from_shared_ptr
=const_value_ref
"
)
{
TEST_CASE
(
"from_shared_ptr
+const_value_ref"
,
"[feasible]
"
)
{
std
::
shared_ptr
<
int
>
orig_owner
(
new
int
(
19
));
smart_holder
hld
;
hld
.
from_shared_ptr
(
orig_owner
);
...
...
@@ -90,7 +90,7 @@ TEST_CASE("from_shared_ptr=const_value_ref") {
REQUIRE
(
hld
.
const_value_ref
<
int
>
()
==
19
);
}
TEST_CASE
(
"
as_shared_ptr
"
)
{
TEST_CASE
(
"
from_raw_ptr_take_ownership+as_shared_ptr"
,
"[feasible]
"
)
{
smart_holder
hld
;
hld
.
from_raw_ptr_take_ownership
(
new
int
(
19
));
auto
new_owner
=
hld
.
as_shared_ptr
<
int
>
();
...
...
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