Skip to content

Commit

Permalink
Update snatch
Browse files Browse the repository at this point in the history
  • Loading branch information
cschreib committed Oct 16, 2022
1 parent dbd9434 commit f82e691
Show file tree
Hide file tree
Showing 19 changed files with 161 additions and 177 deletions.
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include(FetchContent)

FetchContent_Declare(snatch
GIT_REPOSITORY https://github.com/cschreib/snatch.git
GIT_TAG 3fe53311beb01595e7502d3990dc5a1569b006b8)
GIT_TAG v0.1.0)
FetchContent_MakeAvailable(snatch)

set(RUNTIME_TEST_FILES
Expand Down
27 changes: 12 additions & 15 deletions tests/runtime_tests_lifetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <vector>

TEMPLATE_LIST_TEST_CASE("observer expiring scope", "[lifetime],[owner],[observer]", owner_types) {
TEMPLATE_LIST_TEST_CASE("observer expiring scope", "[lifetime][owner][observer]", owner_types) {
memory_tracker mem_track;

{
Expand All @@ -27,7 +27,7 @@ TEMPLATE_LIST_TEST_CASE("observer expiring scope", "[lifetime],[owner],[observer
};

TEMPLATE_LIST_TEST_CASE(
"observer not expiring when owner moved", "[lifetime],[owner],[observer]", owner_types) {
"observer not expiring when owner moved", "[lifetime][owner][observer]", owner_types) {
memory_tracker mem_track;

{
Expand Down Expand Up @@ -60,7 +60,7 @@ TEMPLATE_LIST_TEST_CASE(
CHECK_NO_LEAKS;
};

TEMPLATE_LIST_TEST_CASE("observer expiring reset", "[lifetime],[owner],[observer]", owner_types) {
TEMPLATE_LIST_TEST_CASE("observer expiring reset", "[lifetime][owner][observer]", owner_types) {
memory_tracker mem_track;

{
Expand All @@ -84,7 +84,7 @@ TEMPLATE_LIST_TEST_CASE("observer expiring reset", "[lifetime],[owner],[observer
};

TEMPLATE_LIST_TEST_CASE(
"release valid owner with observer", "[lifetime],[release],[owner],[observer]", owner_types) {
"release valid owner with observer", "[lifetime][release][owner][observer]", owner_types) {
if constexpr (!is_sealed<TestType>) {
memory_tracker mem_track;

Expand Down Expand Up @@ -129,7 +129,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"release valid owner with observer subobject",
"[lifetime],[release],[owner],[observer]",
"[lifetime][release][owner][observer]",
owner_types) {
if constexpr (!is_sealed<TestType>) {
memory_tracker mem_track;
Expand Down Expand Up @@ -172,7 +172,7 @@ TEMPLATE_LIST_TEST_CASE(
};

TEMPLATE_LIST_TEST_CASE(
"observer get and raw get", "[lifetime],[get],[raw_get],[owner],[observer]", owner_types) {
"observer get and raw get", "[lifetime][get][raw_get][owner][observer]", owner_types) {
memory_tracker mem_track;

{
Expand All @@ -199,7 +199,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"object owning observer pointer to itself",
"[lifetime],[cycles],[owner],[observer]",
"[lifetime][cycles][owner][observer]",
owner_types) {
if constexpr (is_cyclic<TestType>) {
memory_tracker mem_track;
Expand All @@ -216,9 +216,7 @@ TEMPLATE_LIST_TEST_CASE(
};

TEMPLATE_LIST_TEST_CASE(
"object owning observer pointer to other",
"[lifetime],[cycles],[owner],[observer]",
owner_types) {
"object owning observer pointer to other", "[lifetime][cycles][owner][observer]", owner_types) {
if constexpr (is_cyclic<TestType>) {
memory_tracker mem_track;

Expand All @@ -237,7 +235,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"object owning observer pointer open chain",
"[lifetime],[cycles],[owner],[observer]",
"[lifetime][cycles][owner][observer]",
owner_types) {
if constexpr (is_cyclic<TestType>) {
memory_tracker mem_track;
Expand All @@ -258,7 +256,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"object owning observer pointer open chain reversed",
"[lifetime],[cycles],[owner],[observer]",
"[lifetime][cycles][owner][observer]",
owner_types) {
if constexpr (is_cyclic<TestType>) {
memory_tracker mem_track;
Expand All @@ -279,7 +277,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"object owning observer pointer closed chain interleaved",
"[lifetime],[cycles],[owner],[observer]",
"[lifetime][cycles][owner][observer]",
owner_types) {
if constexpr (is_cyclic<TestType>) {
memory_tracker mem_track;
Expand All @@ -301,8 +299,7 @@ TEMPLATE_LIST_TEST_CASE(
}
};

TEMPLATE_LIST_TEST_CASE(
"pointers in vector", "[lifetime],[array],[owner],[observer]", owner_types) {
TEMPLATE_LIST_TEST_CASE("pointers in vector", "[lifetime][array][owner][observer]", owner_types) {
memory_tracker mem_track;

{
Expand Down
13 changes: 6 additions & 7 deletions tests/runtime_tests_make_observable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "testing.hpp"
#include "tests_common.hpp"

TEMPLATE_LIST_TEST_CASE("make observable", "[make_observable],[owner]", owner_types) {
TEMPLATE_LIST_TEST_CASE("make observable", "[make_observable][owner]", owner_types) {
if constexpr (can_use_make_observable<TestType>) {
memory_tracker mem_track;

Expand All @@ -26,8 +26,7 @@ TEMPLATE_LIST_TEST_CASE("make observable", "[make_observable],[owner]", owner_ty
}
};

TEMPLATE_LIST_TEST_CASE(
"make observable with arguments", "[make_observable],[owner]", owner_types) {
TEMPLATE_LIST_TEST_CASE("make observable with arguments", "[make_observable][owner]", owner_types) {
if constexpr (can_use_make_observable<TestType>) {
memory_tracker mem_track;

Expand All @@ -53,7 +52,7 @@ TEMPLATE_LIST_TEST_CASE(
};

TEMPLATE_LIST_TEST_CASE(
"make observable throw in constructor", "[make_observable],[owner]", owner_types) {
"make observable throw in constructor", "[make_observable][owner]", owner_types) {
if constexpr (can_use_make_observable<TestType>) {
memory_tracker mem_track;

Expand All @@ -66,7 +65,7 @@ TEMPLATE_LIST_TEST_CASE(
}
};

TEMPLATE_LIST_TEST_CASE("make observable bad alloc", "[make_observable],[owner]", owner_types) {
TEMPLATE_LIST_TEST_CASE("make observable bad alloc", "[make_observable][owner]", owner_types) {
if constexpr (can_use_make_observable<TestType>) {
memory_tracker mem_track;

Expand All @@ -78,7 +77,7 @@ TEMPLATE_LIST_TEST_CASE("make observable bad alloc", "[make_observable],[owner]"
}
};

TEST_CASE("make observable unique", "[make_observable],[owner]") {
TEST_CASE("make observable unique", "[make_observable][owner]") {
using TestType = oup::observable_unique_ptr<test_object>;
memory_tracker mem_track;

Expand All @@ -94,7 +93,7 @@ TEST_CASE("make observable unique", "[make_observable],[owner]") {
CHECK_NO_LEAKS;
};

TEST_CASE("make observable sealed", "[make_observable],[owner]") {
TEST_CASE("make observable sealed", "[make_observable][owner]") {
using TestType = oup::observable_sealed_ptr<test_object>;
memory_tracker mem_track;

Expand Down
24 changes: 10 additions & 14 deletions tests/runtime_tests_observer_assignment_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "tests_common.hpp"

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment operator valid to empty", "[assignment],[observer]", owner_types) {
"observer copy assignment operator valid to empty", "[assignment][observer]", owner_types) {
memory_tracker mem_track;

{
Expand All @@ -27,7 +27,7 @@ TEMPLATE_LIST_TEST_CASE(
};

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment operator empty to valid", "[assignment],[observer]", owner_types) {
"observer copy assignment operator empty to valid", "[assignment][observer]", owner_types) {
memory_tracker mem_track;

{
Expand All @@ -51,7 +51,7 @@ TEMPLATE_LIST_TEST_CASE(
};

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment operator empty to empty", "[assignment],[observer]", owner_types) {
"observer copy assignment operator empty to empty", "[assignment][observer]", owner_types) {
memory_tracker mem_track;

{
Expand All @@ -74,7 +74,7 @@ TEMPLATE_LIST_TEST_CASE(
};

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment operator valid to valid", "[assignment],[observer]", owner_types) {
"observer copy assignment operator valid to valid", "[assignment][observer]", owner_types) {
memory_tracker mem_track;

{
Expand All @@ -100,7 +100,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment converting operator valid to empty",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand Down Expand Up @@ -128,7 +128,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment converting operator empty to valid",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand Down Expand Up @@ -156,7 +156,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment converting operator empty to empty",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand All @@ -183,7 +183,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment converting operator valid to valid",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand Down Expand Up @@ -211,9 +211,7 @@ TEMPLATE_LIST_TEST_CASE(
};

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment operator self to self valid",
"[assignment],[observer]",
owner_types) {
"observer copy assignment operator self to self valid", "[assignment][observer]", owner_types) {
memory_tracker mem_track;

{
Expand All @@ -233,9 +231,7 @@ TEMPLATE_LIST_TEST_CASE(
};

TEMPLATE_LIST_TEST_CASE(
"observer copy assignment operator self to self empty",
"[assignment],[observer]",
owner_types) {
"observer copy assignment operator self to self empty", "[assignment][observer]", owner_types) {
memory_tracker mem_track;

{
Expand Down
16 changes: 8 additions & 8 deletions tests/runtime_tests_observer_assignment_from_owner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

TEMPLATE_LIST_TEST_CASE(
"observer from owner assignment operator valid to empty",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand All @@ -27,7 +27,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer from owner assignment operator empty to valid",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand All @@ -52,7 +52,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer from owner assignment operator empty to empty",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand All @@ -76,7 +76,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer from owner assignment operator valid to valid",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand Down Expand Up @@ -104,7 +104,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer from owner assignment converting operator valid to empty",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand All @@ -129,7 +129,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer from owner assignment converting operator empty to valid",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand All @@ -156,7 +156,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer from owner assignment converting operator empty to empty",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand All @@ -182,7 +182,7 @@ TEMPLATE_LIST_TEST_CASE(

TEMPLATE_LIST_TEST_CASE(
"observer from owner assignment converting operator valid to valid",
"[assignment],[observer]",
"[assignment][observer]",
owner_types) {
memory_tracker mem_track;

Expand Down
Loading

0 comments on commit f82e691

Please sign in to comment.