style: clang-tidy: modernize-use-auto
diff --git a/tests/test_numpy_array.cpp b/tests/test_numpy_array.cpp
index caa0525..33f1d78 100644
--- a/tests/test_numpy_array.cpp
+++ b/tests/test_numpy_array.cpp
@@ -212,7 +212,7 @@
.def(py::init<>())
.def("numpy_view", [](py::object &obj) {
py::print("ArrayClass::numpy_view()");
- ArrayClass &a = obj.cast<ArrayClass&>();
+ auto &a = obj.cast<ArrayClass&>();
return py::array_t<int>({2}, {4}, a.data, obj);
}
);
@@ -362,7 +362,7 @@
// test_array_resize
// reshape array to 2D without changing size
sm.def("array_reshape2", [](py::array_t<double> a) {
- const ssize_t dim_sz = (ssize_t)std::sqrt(a.size());
+ const auto dim_sz = (ssize_t)std::sqrt(a.size());
if (dim_sz * dim_sz != a.size())
throw std::domain_error("array_reshape2: input array total size is not a squared integer");
a.resize({dim_sz, dim_sz});
diff --git a/tests/test_opaque_types.cpp b/tests/test_opaque_types.cpp
index 0d20d9a..594c45a 100644
--- a/tests/test_opaque_types.cpp
+++ b/tests/test_opaque_types.cpp
@@ -60,7 +60,7 @@
m.def("get_null_str_value", [](char *ptr) { return reinterpret_cast<std::intptr_t>(ptr); });
m.def("return_unique_ptr", []() -> std::unique_ptr<StringList> {
- StringList *result = new StringList();
+ auto *result = new StringList();
result->push_back("some value");
return std::unique_ptr<StringList>(result);
});
diff --git a/tests/test_sequences_and_iterators.cpp b/tests/test_sequences_and_iterators.cpp
index 1ce0451..545dc45 100644
--- a/tests/test_sequences_and_iterators.cpp
+++ b/tests/test_sequences_and_iterators.cpp
@@ -200,7 +200,7 @@
size_t start, stop, step, slicelength;
if (!slice.compute(s.size(), &start, &stop, &step, &slicelength))
throw py::error_already_set();
- Sequence *seq = new Sequence(slicelength);
+ auto *seq = new Sequence(slicelength);
for (size_t i = 0; i < slicelength; ++i) {
(*seq)[i] = s[start]; start += step;
}