Commit 1eff1fb1 authored by Christophe Bedard's avatar Christophe Bedard

Add test for get_symbol using lambda with capture

parent 247de52b
Pipeline #88342866 passed with stage
in 7 minutes and 44 seconds
......@@ -57,6 +57,25 @@ TEST(TestUtils, valid_symbol_lambda) {
"invalid symbol";
}
/*
Testing symbol resolution lambdas with capture.
*/
TEST(TestUtils, valid_symbol_lambda_capture) {
int num = 1;
auto l = [ = ]() {return num + 1;};
EXPECT_STREQ(
get_symbol(l),
"TestUtils_valid_symbol_lambda_capture_Test::TestBody()::{lambda()#1}") <<
"invalid symbol";
auto m = [&](int other_num) {return num + other_num;};
EXPECT_STREQ(
get_symbol(m),
"TestUtils_valid_symbol_lambda_capture_Test::TestBody()::{lambda(int)#2}") <<
"invalid symbol";
}
/*
Testing symbol resolution for std::function object created from std::bind.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment