#include "kdganttconstraint.h"
#include "kdganttconstraint_p.h"
#include <QDateTime>
#include <QStandardItemModel>
#include "unittest/test.h"
Go to the source code of this file.
Functions | |
KDAB_SCOPED_UNITTEST_SIMPLE (KDGantt, Constraint,"test") | |
QDebug | operator<< (QDebug dbg, const Constraint &c) |
KDAB_SCOPED_UNITTEST_SIMPLE | ( | KDGantt | , | |
Constraint | , | |||
"test" | ||||
) |
Definition at line 185 of file kdganttconstraint.cpp.
References assertEqual, assertFalse, assertNotEqual, assertTrue, KDGantt::Constraint::Constraint(), KDGantt::qHash(), KDGantt::Constraint::type(), and KDGantt::Constraint::TypeSoft.
00186 { 00187 QStandardItemModel dummyModel( 100, 100 ); 00188 QModelIndex idx1 = dummyModel.index( 7, 17, QModelIndex() ); 00189 QModelIndex idx2 = dummyModel.index( 42, 17, QModelIndex() ); 00190 00191 Constraint c1 = Constraint( QModelIndex(), QModelIndex(), Constraint::TypeSoft ); 00192 Constraint c2 = Constraint( QModelIndex(), QModelIndex(), Constraint::TypeSoft ); 00193 Constraint c3 = c2; 00194 Constraint c4( idx1, idx2 ); 00195 Constraint c5( idx2, idx1 ); 00196 00197 assertTrue( c1==c2 ); 00198 assertEqual( qHash( c1 ), qHash( c2 ) ); 00199 assertTrue( c1==c3 ); 00200 assertEqual( qHash( c1 ), qHash( c3 ) ); 00201 assertTrue( c2==c3 ); 00202 assertEqual( qHash( c2 ), qHash( c3 ) ); 00203 00204 assertFalse( c2==c4 ); 00205 assertNotEqual( qHash( c2 ), qHash( c4 ) ); 00206 00207 assertFalse( c4==c5 ); 00208 00209 assertEqual( c3.type(), Constraint::TypeSoft ); 00210 00211 dummyModel.removeRow( 8 ); 00212 assertFalse( c4==c5 ); 00213 }
QDebug operator<< | ( | QDebug | dbg, | |
const Constraint & | c | |||
) |
Definition at line 166 of file kdganttconstraint.cpp.
References KDGantt::Constraint::debug().
Referenced by operator<<().
00167 { 00168 return c.debug( dbg ); 00169 }