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

Function test_std_array

dlib/test/serialize.cpp:680–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678 }
679
680 void test_std_array (
681 )
682 {
683 std::array<int,5> a, b;
684
685 a = {1, 2, 3, 4, 5};
686
687 ostringstream sout;
688 dlib::serialize(a, sout);
689 istringstream sin(sout.str());
690
691 dlib::deserialize(b, sin);
692
693
694 DLIB_TEST(a.size() == b.size());
695 DLIB_TEST(a.size() == 5);
696 for (unsigned long i = 0; i < a.size(); ++i)
697 {
698 DLIB_TEST(a[i] == b[i]);
699 }
700
701 std::array<int,0> aa, bb;
702 sout.str("");
703 dlib::serialize(aa, sout);
704 sin.str(sout.str());
705 dlib::deserialize(bb, sin);
706 DLIB_TEST(bb.size() == 0);
707 }
708
709 void test_vector_bool (
710 )

Callers 1

perform_testMethod · 0.85

Calls 4

serializeFunction · 0.70
deserializeFunction · 0.70
strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected