MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / testSeq

Function testSeq

tests/unit-tests/FACE/Sequence.cpp:52–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51template <typename Seq>
52void testSeq(Seq& seq, const typename Seq::value_type& t)
53{
54 std::cerr << "Testing Seq: " << typeid(Seq).name() << '\n';
55 EXPECT_TRUE(seq.length() == 0);
56 Seq cpy(seq);
57 EXPECT_TRUE(cpy.length() == 0);
58 EXPECT_TRUE(cpy.release());
59 seq = cpy;
60 seq.length(1);
61 EXPECT_TRUE(seq.length() == 1);
62 assignTo0(seq, t);
63 const Seq& cseq = seq;
64 EXPECT_TRUE(equal(cseq[0], t));
65 EXPECT_TRUE(equal(cseq.get_buffer()[0], t));
66 EXPECT_TRUE(cseq.length() == 1);
67 EXPECT_TRUE(cseq.size() == 1);
68 EXPECT_TRUE(!cseq.empty());
69 EXPECT_TRUE(cseq.max_size());
70 EXPECT_TRUE(cseq.release());
71 EXPECT_TRUE(cseq.maximum());
72 EXPECT_TRUE(cseq.begin() + 1 == cseq.end());
73 EXPECT_TRUE(seq.begin() + 1 == seq.end());
74 EXPECT_TRUE(cseq == seq);
75 EXPECT_TRUE(!(cseq != seq));
76
77 typename Seq::value_type* const buf = seq.get_buffer(true /*orphan*/);
78 EXPECT_TRUE(equal(buf[0], t));
79 Seq::freebuf(buf);
80}
81
82struct MyStru { int i1_, i2_; }; // IDL "fixed-length" struct
83bool operator==(const MyStru& lhs, const MyStru& rhs)

Callers 1

TESTFunction · 0.85

Calls 12

assignTo0Function · 0.85
equalFunction · 0.70
nameMethod · 0.45
lengthMethod · 0.45
releaseMethod · 0.45
get_bufferMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
max_sizeMethod · 0.45
maximumMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected