Skip to content

Commit 2ef943f

Browse files
committed
Update to snitch
1 parent 48b8d55 commit 2ef943f

23 files changed

+118
-137
lines changed

oup.sublime-project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
"shell_cmd": "make -j12 oup_speed_benchmark",
7171
},
7272
{
73-
"name": "snatch",
74-
"shell_cmd": "make -j12 snatch",
73+
"name": "snitch",
74+
"shell_cmd": "make -j12 snitch",
7575
},
7676
],
7777
"working_dir": "$folder/build",

tests/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ endfunction()
3131

3232
include(FetchContent)
3333

34-
FetchContent_Declare(snatch
35-
GIT_REPOSITORY https://github.com/cschreib/snatch.git
36-
GIT_TAG 13c39e2cff643a8ce6672f02531a1f2f89ffafd2)
37-
FetchContent_MakeAvailable(snatch)
34+
FetchContent_Declare(snitch
35+
GIT_REPOSITORY https://github.com/cschreib/snitch.git
36+
GIT_TAG 08ac40f24b4ddaf6e9b205374af8d79313fa7eeb)
37+
FetchContent_MakeAvailable(snitch)
3838

3939
set(RUNTIME_TEST_FILES
4040
${PROJECT_SOURCE_DIR}/tests/tests_common.cpp
@@ -61,7 +61,7 @@ set(RUNTIME_TEST_FILES
6161

6262
add_executable(oup_runtime_tests ${RUNTIME_TEST_FILES})
6363
target_link_libraries(oup_runtime_tests PRIVATE oup::oup)
64-
target_link_libraries(oup_runtime_tests PRIVATE snatch::snatch)
64+
target_link_libraries(oup_runtime_tests PRIVATE snitch::snitch)
6565
add_platform_definitions(oup_runtime_tests)
6666

6767
add_custom_target(oup_runtime_tests_run

tests/runtime_tests_lifetime.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "memory_tracker.hpp"
22
#include "testing.hpp"
3-
#include "tests_common.hpp"
43

54
#include <algorithm>
65
#include <vector>

tests/runtime_tests_make_observable.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "memory_tracker.hpp"
22
#include "testing.hpp"
3-
#include "tests_common.hpp"
43

54
TEMPLATE_LIST_TEST_CASE("make observable", "[make_observable][owner]", owner_types) {
65
if constexpr (can_use_make_observable<TestType>) {

tests/runtime_tests_observer_assignment_copy.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "memory_tracker.hpp"
22
#include "testing.hpp"
3-
#include "tests_common.hpp"
43

54
TEMPLATE_LIST_TEST_CASE(
65
"observer copy assignment operator valid to empty", "[assignment][observer]", owner_types) {
@@ -217,10 +216,10 @@ TEMPLATE_LIST_TEST_CASE(
217216
{
218217
TestType ptr = make_pointer_deleter_1<TestType>();
219218
observer_ptr<TestType> optr{ptr};
220-
SNATCH_WARNING_PUSH;
221-
SNATCH_WARNING_DISABLE_SELF_ASSIGN;
219+
SNITCH_WARNING_PUSH;
220+
SNITCH_WARNING_DISABLE_SELF_ASSIGN;
222221
optr = optr;
223-
SNATCH_WARNING_POP;
222+
SNITCH_WARNING_POP;
224223

225224
CHECK(optr.get() == ptr.get());
226225
CHECK(optr.expired() == false);
@@ -236,10 +235,10 @@ TEMPLATE_LIST_TEST_CASE(
236235

237236
{
238237
observer_ptr<TestType> optr;
239-
SNATCH_WARNING_PUSH;
240-
SNATCH_WARNING_DISABLE_SELF_ASSIGN;
238+
SNITCH_WARNING_PUSH;
239+
SNITCH_WARNING_DISABLE_SELF_ASSIGN;
241240
optr = optr;
242-
SNATCH_WARNING_POP;
241+
SNITCH_WARNING_POP;
243242

244243
CHECK(optr.get() == nullptr);
245244
CHECK(optr.expired() == true);

tests/runtime_tests_observer_assignment_from_owner.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "memory_tracker.hpp"
22
#include "testing.hpp"
3-
#include "tests_common.hpp"
43

54
TEMPLATE_LIST_TEST_CASE(
65
"observer from owner assignment operator valid to empty",

tests/runtime_tests_observer_assignment_move.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "memory_tracker.hpp"
22
#include "testing.hpp"
3-
#include "tests_common.hpp"
43

54
TEMPLATE_LIST_TEST_CASE(
65
"observer move assignment operator valid to empty", "[assignment][observer]", owner_types) {

tests/runtime_tests_observer_cast_copy.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "memory_tracker.hpp"
22
#include "testing.hpp"
3-
#include "tests_common.hpp"
43

54
TEMPLATE_LIST_TEST_CASE("observer static_cast copy from valid", "[cast][observer]", owner_types) {
65
volatile memory_tracker mem_track;
@@ -16,7 +15,7 @@ TEMPLATE_LIST_TEST_CASE("observer static_cast copy from valid", "[cast][observer
1615

1716
CHECK(optr1.get() == raw_ptr);
1817
CHECK(optr2.get() == raw_ptr);
19-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
18+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
2019
CHECK_INSTANCES(1, 1);
2120
};
2221

@@ -43,7 +42,7 @@ TEMPLATE_LIST_TEST_CASE("observer static_cast copy from empty", "[cast][observer
4342

4443
CHECK(optr1.get() == nullptr);
4544
CHECK(optr2.get() == nullptr);
46-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
45+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
4746
CHECK_INSTANCES(0, 1);
4847
};
4948

@@ -71,7 +70,7 @@ TEMPLATE_LIST_TEST_CASE("observer const_cast copy from valid", "[cast][observer]
7170

7271
CHECK(optr1.get() == raw_ptr);
7372
CHECK(optr2.get() == raw_ptr);
74-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
73+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
7574
CHECK_INSTANCES(1, 1);
7675
};
7776

@@ -96,7 +95,7 @@ TEMPLATE_LIST_TEST_CASE("observer const_cast copy from empty", "[cast][observer]
9695

9796
CHECK(optr1.get() == nullptr);
9897
CHECK(optr2.get() == nullptr);
99-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
98+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
10099
CHECK_INSTANCES(0, 1);
101100
};
102101

@@ -123,7 +122,7 @@ TEMPLATE_LIST_TEST_CASE("observer dynamic_cast copy from valid", "[cast][observe
123122

124123
CHECK(optr1.get() == raw_ptr);
125124
CHECK(optr2.get() == raw_ptr);
126-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
125+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
127126
CHECK_INSTANCES(1, 1);
128127
};
129128

@@ -155,7 +154,7 @@ TEMPLATE_LIST_TEST_CASE("observer dynamic_cast copy from empty", "[cast][observe
155154

156155
CHECK(optr1.get() == nullptr);
157156
CHECK(optr2.get() == nullptr);
158-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
157+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
159158
CHECK_INSTANCES(0, 1);
160159
};
161160

@@ -190,7 +189,7 @@ TEMPLATE_LIST_TEST_CASE(
190189

191190
CHECK(optr1.get() == raw_ptr);
192191
CHECK(optr2.get() == nullptr);
193-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
192+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
194193
CHECK_INSTANCES(1, 1);
195194
}
196195

tests/runtime_tests_observer_cast_move.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "memory_tracker.hpp"
22
#include "testing.hpp"
3-
#include "tests_common.hpp"
43

54
TEMPLATE_LIST_TEST_CASE("observer static_cast move from valid", "[cast][observer]", owner_types) {
65
volatile memory_tracker mem_track;
@@ -16,7 +15,7 @@ TEMPLATE_LIST_TEST_CASE("observer static_cast move from valid", "[cast][observer
1615

1716
CHECK(optr1.get() == nullptr);
1817
CHECK(optr2.get() == raw_ptr);
19-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
18+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
2019
CHECK_INSTANCES(1, 1);
2120
};
2221

@@ -43,7 +42,7 @@ TEMPLATE_LIST_TEST_CASE("observer static_cast move from empty", "[cast][observer
4342

4443
CHECK(optr1.get() == nullptr);
4544
CHECK(optr2.get() == nullptr);
46-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
45+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
4746
CHECK_INSTANCES(0, 1);
4847
};
4948

@@ -71,7 +70,7 @@ TEMPLATE_LIST_TEST_CASE("observer const_cast move from valid", "[cast][observer]
7170

7271
CHECK(optr1.get() == nullptr);
7372
CHECK(optr2.get() == raw_ptr);
74-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
73+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
7574
CHECK_INSTANCES(1, 1);
7675
};
7776

@@ -96,7 +95,7 @@ TEMPLATE_LIST_TEST_CASE("observer const_cast move from empty", "[cast][observer]
9695

9796
CHECK(optr1.get() == nullptr);
9897
CHECK(optr2.get() == nullptr);
99-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
98+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
10099
CHECK_INSTANCES(0, 1);
101100
};
102101

@@ -123,7 +122,7 @@ TEMPLATE_LIST_TEST_CASE("observer dynamic_cast move from valid", "[cast][observe
123122

124123
CHECK(optr1.get() == nullptr);
125124
CHECK(optr2.get() == raw_ptr);
126-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
125+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
127126
CHECK_INSTANCES(1, 1);
128127
};
129128

@@ -155,7 +154,7 @@ TEMPLATE_LIST_TEST_CASE("observer dynamic_cast move from empty", "[cast][observe
155154

156155
CHECK(optr1.get() == nullptr);
157156
CHECK(optr2.get() == nullptr);
158-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
157+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
159158
CHECK_INSTANCES(0, 1);
160159
};
161160

@@ -189,7 +188,7 @@ TEMPLATE_LIST_TEST_CASE(
189188

190189
CHECK(optr1.get() == nullptr);
191190
CHECK(optr2.get() == nullptr);
192-
CHECK(snatch::type_name<return_type> == snatch::type_name<expected_return_type>);
191+
CHECK(snitch::type_name<return_type> == snitch::type_name<expected_return_type>);
193192
CHECK_INSTANCES(1, 1);
194193
}
195194

tests/runtime_tests_observer_comparison.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "memory_tracker.hpp"
22
#include "testing.hpp"
3-
#include "tests_common.hpp"
43

54
TEMPLATE_LIST_TEST_CASE(
65
"observer comparison valid vs nullptr", "[comparison][observer]", owner_types) {

0 commit comments

Comments
 (0)