10 #include <QtCore/QList> 59 QCOMPARE(vs.count(), 8);
60 QCOMPARE(vs.size(), 8u);
61 QVERIFY(!vs.isEmpty());
63 QCOMPARE(vs2.count(), 8);
64 QCOMPARE(vs2.size(),8u);
65 QVERIFY(!vs2.isEmpty());
81 QCOMPARE(vs.size(), 8u);
82 QVERIFY(!vs.isEmpty());
84 QCOMPARE(vs2.size(), vs.size());
86 for(
int k= 0; k<(int)vs2.size(); k++){
87 QCOMPARE(vs2[k], *i++);
89 QList<QhullVertex> vs3= vs.toQList();
90 QCOMPARE(vs3.count(), vs.count());
92 for(
int k= 0; k<vs3.count(); k++){
93 QCOMPARE(vs3[k], *i++);
96 QVERIFY(vs4.isEmpty());
116 QCOMPARE(vs.
back(), v2);
128 QCOMPARE(vs.
count(v), 0);
132 QCOMPARE(vs.
count(v2), 1);
134 QCOMPARE(vs.
count(v3), 1);
157 QCOMPARE(v3.
id(), v.
id());
158 QCOMPARE(v8.
id(), vs.
last().id());
163 QCOMPARE((*i3).id(), v2.
id());
180 QCOMPARE(i2, vs.
begin());
182 QCOMPARE(i2 += 8, vs.
end());
183 QCOMPARE(i2 -= 8, vs.
begin());
184 QCOMPARE(i2+0, vs.
begin());
185 QCOMPARE(i2+8, vs.
end());
190 QCOMPARE(i, vs.
begin());
217 QCOMPARE(v3.
id(), v.
id());
218 QCOMPARE(v8.
id(), vs.
last().id());
223 QCOMPARE((*i3).id(), v2.
id());
258 QCOMPARE(vs.count(), 0);
259 QVERIFY(!i.hasNext());
260 QVERIFY(!i.hasPrevious());
262 QVERIFY(!i.hasNext());
263 QVERIFY(!i.hasPrevious());
267 QCOMPARE(vs2.count(), 8);
271 QVERIFY(i.hasNext());
272 QVERIFY(!i.hasPrevious());
277 QVERIFY(i.hasNext());
278 QVERIFY(!i.hasPrevious());
301 QCOMPARE(i.peekNext(), v4);
303 QCOMPARE(i.next(), v4);
304 QCOMPARE(i.peekNext(), v5);
305 QCOMPARE(i.next(), v5);
306 QCOMPARE(i.next(), v6);
307 QCOMPARE(i.next(), v7);
311 QCOMPARE(i.next(), v8);
312 QVERIFY(!i.hasNext());
314 QCOMPARE(i.next(), v4);
323 std::cout <<
"INFO: empty QhullVertextList" << vs << std::endl;
325 std::cout <<
"INFO: " << vs2 << std::endl;
330 #include "moc/QhullLinkedList_test.moc"
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
QhullVertexList vertexList() const
Return vertices of the convex hull.
std::vector< T > toStdVector() const
QhullVertex beginVertex() const
Interface to Qhull from C++.
const_iterator constBegin() const
bool contains(const T &t) const
QhullVertex endVertex() const
QhullVertex previous() const
void add_QhullLinkedList_test()
void cleanup()
Executed after each test.
void t_QhullLinkedList_iterator()
QhullLinkedList< QhullVertex > QhullVertexList
countT facetCount() const
const_iterator constEnd() const
const T back() const
For back() and last(), return T instead of T& (T is computed)