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

Function test_rect_to_drect

dlib/test/geometry.cpp:822–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820// ----------------------------------------------------------------------------------------
821
822 void test_rect_to_drect()
823 {
824 print_spinner();
825 dlib::rand rnd;
826 for (int i = 0; i < 5000; ++i)
827 {
828 rectangle rect = centered_rect(rnd.get_random_32bit_number()%100,
829 rnd.get_random_32bit_number()%100,
830 rnd.get_random_32bit_number()%100,
831 rnd.get_random_32bit_number()%100);
832
833 drectangle drect = rect;
834 rectangle rect2 = drect;
835 DLIB_TEST(rect2 == rect);
836 DLIB_TEST(rect.width() == drect.width());
837 DLIB_TEST(rect.height() == drect.height());
838 DLIB_TEST(dcenter(rect) == dcenter(drect));
839 DLIB_TEST(rect.is_empty() == drect.is_empty());
840 }
841 }
842
843// ----------------------------------------------------------------------------------------
844

Callers 1

perform_testMethod · 0.85

Calls 7

print_spinnerFunction · 0.85
centered_rectFunction · 0.85
dcenterFunction · 0.50
widthMethod · 0.45
heightMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected