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

Function test_array_split

dlib/test/array.cpp:621–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619 }
620
621 void test_array_split()
622 {
623 array<int> temp(5);
624
625 for (unsigned int i = 0; i < temp.size(); ++i)
626 temp[i] = i;
627
628 array<int> b;
629
630 split_array(temp, b, 0.5);
631 DLIB_TEST(temp.size() == 2);
632 DLIB_TEST(b.size() == 3);
633
634 DLIB_TEST(temp[0] == 0);
635 DLIB_TEST(temp[1] == 1);
636 DLIB_TEST(b[0] == 2);
637 DLIB_TEST(b[1] == 3);
638 DLIB_TEST(b[2] == 4);
639 }
640
641 class array_tester : public tester
642 {

Callers 1

perform_testMethod · 0.85

Calls 2

split_arrayFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected