MCPcopy Create free account
hub / github.com/davisking/dlib / test_member_functions_and_data

Function test_member_functions_and_data

dlib/test/invoke.cpp:239–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237 static_assert(is_callable<example_struct>::value, "bad");
238
239 void test_member_functions_and_data()
240 {
241 example_struct obj1(10);
242 std::unique_ptr<example_struct> obj2(new example_struct(11));
243 std::shared_ptr<example_struct> obj3(new example_struct(12));
244
245 DLIB_TEST(dlib::invoke(&example_struct::get_i, obj1) == 10);
246 DLIB_TEST(dlib::invoke(&example_struct::i, obj1) == 10);
247 DLIB_TEST(dlib::invoke(&example_struct::get_i, &obj1) == 10);
248 DLIB_TEST(dlib::invoke(&example_struct::i, &obj1) == 10);
249 DLIB_TEST(dlib::invoke(&example_struct::get_i, obj2) == 11);
250 DLIB_TEST(dlib::invoke(&example_struct::i, obj2) == 11);
251 DLIB_TEST(dlib::invoke(&example_struct::get_i, obj3) == 12);
252 DLIB_TEST(dlib::invoke(&example_struct::i, obj3) == 12);
253 }
254
255 // ----------------------------------------------------------------------------------------
256 int return_int()

Callers 1

perform_testMethod · 0.85

Calls 1

invokeFunction · 0.85

Tested by

no test coverage detected