10 #include <QtCore/QList>
20 class QhullLinkedList_test :
public RoadTest
57 QCOMPARE(
q.facetCount(), 12);
59 QCOMPARE(vs.
count(), 8);
60 QCOMPARE(vs.
size(), 8u);
63 QCOMPARE(vs2.
count(), 8);
64 QCOMPARE(vs2.
size(),8u);
76 RboxPoints rcube(
"c");
78 Qhull
q(rcube,
"Qt QR0");
79 QCOMPARE(
q.facetCount(), 12);
81 QCOMPARE(vs.
size(), 8u);
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());
108 RboxPoints rcube(
"c");
109 Qhull
q(rcube,
"QR0");
111 QhullVertex
v= vs.first();
113 QCOMPARE(vs.front(), vs.first());
116 QCOMPARE(vs.back(), v2);
117 QCOMPARE(vs.back(), vs.last());
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());
201 RboxPoints rcube(
"c");
203 Qhull
q(rcube,
"QR0");
217 QCOMPARE(v3.
id(),
v.id());
218 QCOMPARE(v8.
id(), vs.last().id());
223 QCOMPARE((*i3).id(), v2.
id());
235 QCOMPARE(i2, vs.constBegin());
237 QCOMPARE(i2 += 8, vs.constEnd());
238 QCOMPARE(i2 -= 8, vs.constBegin());
239 QCOMPARE(i2+0, vs.constBegin());
240 QCOMPARE(i2+8, vs.constEnd());
245 QCOMPARE(i, vs.constBegin());
254 RboxPoints rcube(
"c");
255 Qhull
q(rcube,
"QR0");
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);
269 QVERIFY(i2.hasNext());
270 QVERIFY(!i2.hasPrevious());
271 QVERIFY(i.hasNext());
272 QVERIFY(!i.hasPrevious());
275 QVERIFY(!i2.hasNext());
276 QVERIFY(i2.hasPrevious());
277 QVERIFY(i.hasNext());
278 QVERIFY(!i.hasPrevious());
291 QCOMPARE(i2.peekPrevious(), v8);
296 QCOMPARE(i2.previous(), v7);
297 QCOMPARE(i2.previous(), v6);
298 QCOMPARE(i2.previous(), v5);
299 QCOMPARE(i2.previous(), v4);
300 QVERIFY(!i2.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"