#include "kdganttglobal.h"
#include "unittest/test.h"
Go to the source code of this file.
Defines | |
#define | QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) |
Functions | |
KDAB_SCOPED_UNITTEST_SIMPLE (KDGantt, DateTimeSpan,"test") | |
KDAB_SCOPED_UNITTEST_SIMPLE (KDGantt, Span,"test") | |
std::ostream & | operator<< (std::ostream &os, const DateTimeSpan &span) |
std::ostream & | operator<< (std::ostream &os, const Span &span) |
QDebug | operator<< (QDebug dbg, const KDGantt::DateTimeSpan &s) |
QDebug | operator<< (QDebug dbg, const KDGantt::Span &s) |
QDebug | operator<< (QDebug dbg, KDGantt::ItemType t) |
QDebug | operator<< (QDebug dbg, KDGantt::ItemDataRole r) |
#define QT_VERSION_CHECK | ( | major, | |||
minor, | |||||
patch | ) | ((major<<16)|(minor<<8)|(patch)) |
Definition at line 31 of file kdganttglobal.cpp.
KDAB_SCOPED_UNITTEST_SIMPLE | ( | KDGantt | , | |
DateTimeSpan | , | |||
"test" | ||||
) |
Definition at line 195 of file kdganttglobal.cpp.
References assertEqual, assertFalse, assertNotEqual, assertTrue, KDGantt::DateTimeSpan::isValid(), KDGantt::DateTimeSpan::setEnd(), and KDGantt::DateTimeSpan::setStart().
00195 { 00196 DateTimeSpan s1; 00197 assertFalse( s1.isValid() ); 00198 QDateTime dt = QDateTime::currentDateTime(); 00199 s1.setStart( dt ); 00200 assertTrue( dt.isValid() ); 00201 s1.setEnd( dt.addDays( 1 ) ); 00202 00203 DateTimeSpan s2( dt, dt.addDays( 1 ) ); 00204 00205 assertEqual( s1, s2 ); 00206 00207 DateTimeSpan s3; 00208 00209 assertNotEqual( s1, s3 ); 00210 }
KDAB_SCOPED_UNITTEST_SIMPLE | ( | KDGantt | , | |
Span | , | |||
"test" | ||||
) |
Definition at line 185 of file kdganttglobal.cpp.
References assertEqual, assertFalse, KDGantt::Span::isValid(), KDGantt::Span::length(), KDGantt::Span::setLength(), KDGantt::Span::setStart(), and KDGantt::Span::start().
00185 { 00186 Span s1; 00187 assertFalse( s1.isValid() ); 00188 s1.setStart( 10. ); 00189 s1.setLength( 2. ); 00190 00191 Span s2( s1.start(), s1.length() ); 00192 assertEqual( s1, s2 ); 00193 }
std::ostream& @17::operator<< | ( | std::ostream & | os, | |
const DateTimeSpan & | span | |||
) | [static] |
Definition at line 172 of file kdganttglobal.cpp.
References KDGantt::DateTimeSpan::end(), and KDGantt::DateTimeSpan::start().
00173 { 00174 #ifdef QT_NO_STL 00175 os << "DateTimeSpan[ start="<<span.start().toString().toLatin1().constData() 00176 << ", end="<<span.end().toString().toLatin1().constData() << "]"; 00177 #else 00178 os << "DateTimeSpan[ start="<<span.start().toString().toStdString() 00179 << ", end="<<span.end().toString().toStdString() << "]"; 00180 #endif 00181 return os; 00182 }
std::ostream& @17::operator<< | ( | std::ostream & | os, | |
const Span & | span | |||
) | [static] |
Definition at line 167 of file kdganttglobal.cpp.
References KDGantt::Span::length(), and KDGantt::Span::start().
00168 { 00169 os << "Span[ start="<<span.start()<<", length="<<span.length()<<"]"; 00170 return os; 00171 }
QDebug operator<< | ( | QDebug | dbg, | |
const KDGantt::DateTimeSpan & | s | |||
) |
Definition at line 155 of file kdganttglobal.cpp.
References KDGantt::DateTimeSpan::end(), and KDGantt::DateTimeSpan::start().
00156 { 00157 dbg << "KDGantt::DateTimeSpan[ start="<<s.start()<<" end="<<s.end()<<"]"; 00158 return dbg; 00159 }
QDebug operator<< | ( | QDebug | dbg, | |
const KDGantt::Span & | s | |||
) |
Definition at line 150 of file kdganttglobal.cpp.
References KDGantt::Span::length(), and KDGantt::Span::start().
00151 { 00152 dbg << "KDGantt::Span[ start="<<s.start()<<" length="<<s.length()<<"]"; 00153 return dbg; 00154 }
QDebug operator<< | ( | QDebug | dbg, | |
KDGantt::ItemType | t | |||
) |
Definition at line 136 of file kdganttglobal.cpp.
References KDGantt::TypeEvent, KDGantt::TypeMulti, KDGantt::TypeNone, KDGantt::TypeSummary, KDGantt::TypeTask, and KDGantt::TypeUser.
00137 { 00138 switch( t ) { 00139 case KDGantt::TypeNone: dbg << "KDGantt::TypeNone"; break; 00140 case KDGantt::TypeEvent: dbg << "KDGantt::TypeEvent"; break; 00141 case KDGantt::TypeTask: dbg << "KDGantt::TypeTask"; break; 00142 case KDGantt::TypeSummary: dbg << "KDGantt::TypeSummary"; break; 00143 case KDGantt::TypeMulti: dbg << "KDGantt::TypeMulti"; break; 00144 case KDGantt::TypeUser: dbg << "KDGantt::TypeUser"; break; 00145 default: dbg << static_cast<int>(t); 00146 } 00147 return dbg; 00148 }
QDebug operator<< | ( | QDebug | dbg, | |
KDGantt::ItemDataRole | r | |||
) |
Definition at line 123 of file kdganttglobal.cpp.
References KDGantt::EndTimeRole, KDGantt::ItemTypeRole, KDGantt::LegendRole, KDGantt::StartTimeRole, and KDGantt::TaskCompletionRole.
00124 { 00125 switch(r){ 00126 case KDGantt::StartTimeRole: dbg << "KDGantt::StartTimeRole"; break; 00127 case KDGantt::EndTimeRole: dbg << "KDGantt::EndTimeRole"; break; 00128 case KDGantt::TaskCompletionRole: dbg << "KDGantt::TaskCompletionRole"; break; 00129 case KDGantt::ItemTypeRole: dbg << "KDGantt::ItemTypeRole"; break; 00130 case KDGantt::LegendRole: dbg << "KDGantt::LegendRole"; break; 00131 default: dbg << static_cast<Qt::ItemDataRole>(r); 00132 } 00133 return dbg; 00134 }