File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ TEST_CASE("multi-threaded")
91
91
{
92
92
cppcoro::static_thread_pool tp{ 3 };
93
93
94
+ unsigned max_depth = 0 ;
95
+
94
96
auto run = [&]() -> cppcoro::task<>
95
97
{
96
98
cppcoro::async_auto_reset_event event;
@@ -102,7 +104,13 @@ TEST_CASE("multi-threaded")
102
104
co_await tp.schedule ();
103
105
co_await event;
104
106
++value;
107
+
108
+ thread_local unsigned depth = 0 ;
109
+ if (depth > max_depth) max_depth = depth;
110
+
111
+ depth += 1 ;
105
112
event.set ();
113
+ depth -= 1 ;
106
114
};
107
115
108
116
auto startSignaller = [&]() -> cppcoro::task<>
@@ -135,6 +143,8 @@ TEST_CASE("multi-threaded")
135
143
}
136
144
137
145
cppcoro::sync_wait (cppcoro::when_all (std::move (tasks)));
146
+
147
+ CHECK_MESSAGE (max_depth < 500 , " Maximum depth of nested continuations exceeded" );
138
148
}
139
149
140
150
TEST_SUITE_END ();
You can’t perform that action at this time.
0 commit comments