Commit 9ab5e52f authored by Pinaev Danil's avatar Pinaev Danil Committed by Alexander Alekhin

Merge pull request #15632 from aDanPin:dp/any_ref_tests

* Add a few more tests on `any`

Added tests:
- get_ref_to_val_from_any
- update_val_via_ref

* Style fix
parent 626bfbf3
......@@ -118,4 +118,25 @@ TEST(Any, copy_assign)
ASSERT_EQ(8 , any_cast<int>(a));
}
TEST(Any, get_ref_to_val_from_any)
{
using namespace util;
int x = 8;
any a(x);
int& casted_ref = any_cast<int>(a);
ASSERT_EQ(casted_ref, 8);
}
TEST(Any, update_val_via_ref)
{
using namespace util;
int x = 8;
any a(x);
int& casted_ref = any_cast<int>(a);
ASSERT_EQ(casted_ref, 8);
casted_ref = 7;
ASSERT_EQ(any_cast<int>(a), 7);
}
} // namespace opencv_test
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