We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d44340b commit f3ecc3cCopy full SHA for f3ecc3c
2 files changed
test/CMakeLists.txt
@@ -72,6 +72,7 @@ add_cpr_test(threadpool)
72
add_cpr_test(testUtils)
73
add_cpr_test(connection_pool)
74
add_cpr_test(sse)
75
+add_cpr_test(curlholder)
76
77
if (ENABLE_SSL_TESTS)
78
add_cpr_test(ssl)
test/curlholder_tests.cpp
@@ -0,0 +1,20 @@
1
+#include <gtest/gtest.h>
2
+
3
+#include <utility>
4
5
+#include "cpr/curlholder.h"
6
7
+// Check if there is a double free in curl holder after move.
8
+// To reproduce this, run with address sanitizers enabled.
9
+// https://github.com/libcpr/cpr/issues/1286
10
+TEST(CurlholderTests, MoveOperator) {
11
+ cpr::CurlHolder a;
12
+ cpr::CurlHolder b;
13
14
+ a = std::move(b);
15
+}
16
17
+int main(int argc, char** argv) {
18
+ ::testing::InitGoogleTest(&argc, argv);
19
+ return RUN_ALL_TESTS();
20
0 commit comments