Add test for get_symbol using lambda with capture
This commit is contained in:
parent
247de52b1e
commit
1eff1fb146
1 changed files with 19 additions and 0 deletions
|
@ -57,6 +57,25 @@ TEST(TestUtils, valid_symbol_lambda) {
|
||||||
"invalid symbol";
|
"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.
|
Testing symbol resolution for std::function object created from std::bind.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue