Skip to content

Add test_class_sh_property_non_owning to CMakeLists.txt - #4590

Merged
rwgk merged 6 commits into
pybind:smart_holderfrom
rwgk:missing_cmake_add_pr4586
Mar 24, 2023
Merged

Add test_class_sh_property_non_owning to CMakeLists.txt#4590
rwgk merged 6 commits into
pybind:smart_holderfrom
rwgk:missing_cmake_add_pr4586

Conversation

@rwgk

@rwgkrwgk commented Mar 24, 2023

Copy link
Copy Markdown
Collaborator

Description

Fixes oversight in PR #4586.

Suggested changelog entry:

@rwgkrwgk changed the title Missing cmake add pr4586Add test_class_sh_property_non_owning to CMakeLists.txtMar 24, 2023
@rwgk

rwgk commented Mar 24, 2023

Copy link
Copy Markdown
CollaboratorAuthor

@wangxf123456 I'll go ahead merge this trivial PR, to make it a little easier to run global testing for smart_holder, and keep pywrapcc and smart_holder in sync.

@rwgk
rwgk marked this pull request as ready for review March 24, 2023 07:07
@rwgk
rwgk requested a review from henryiii as a code ownerMarch 24, 2023 07:07
@rwgk
rwgk merged commit 4f3a1a8 into pybind:smart_holderMar 24, 2023
@rwgk
rwgk deleted the missing_cmake_add_pr4586 branch March 24, 2023 07:07
@github-actionsgithub-actionsBot added the needs changelog Possibly needs a changelog entry label Mar 24, 2023
@rwgkrwgk removed the needs changelog Possibly needs a changelog entry label Mar 24, 2023
@rwgk

rwgk commented Mar 24, 2023

Copy link
Copy Markdown
CollaboratorAuthor

For reasons I don't understand, the https://github.com/pybind/pybind11/pull/4590/files view here is misleading. The actual diff (git show 4f3a1a82318979147bfbdbf464774c316e555a17) is just this:

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 3a1ce894..12b25808 100644
--- a/tests/CMakeLists.txt+++ b/tests/CMakeLists.txt@@ -130,6 +130,7 @@ set(PYBIND11_TEST_FILES
test_class_sh_mi_thunks
test_class_sh_module_local.py
test_class_sh_property
+ test_class_sh_property_non_owning
test_class_sh_shared_ptr_copy_move
test_class_sh_trampoline_basic
test_class_sh_trampoline_self_life_support
diff --git a/tests/test_class_sh_property_non_owning.cpp b/tests/test_class_sh_property_non_owning.cpp
index 5be72007..d15bf23a 100644
--- a/tests/test_class_sh_property_non_owning.cpp+++ b/tests/test_class_sh_property_non_owning.cpp@@ -27,10 +27,10 @@ private:
std::vector<DataField> vec;
public:
- DataFieldsHolder(std::size_t vec_size) {+ explicit DataFieldsHolder(std::size_t vec_size) {
for (std::size_t i = 0; i < vec_size; i++) {
int i11 = static_cast<int>(i) * 11;
- vec.push_back(DataField(13 + i11, 14 + i11, 15 + i11));+ vec.emplace_back(13 + i11, 14 + i11, 15 + i11);
}
}

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rwgk@k-bespalov