Q_OBJECT
public:
- QString m_label;
- QString m_address;
- QString m_x;
- QString m_y;
- bool m_valid;
LocationPrivate( const QString &x, const QString &y, const QString &label );
-
LocationPrivate( const QString &label );
virtual ~LocationPrivate();
void parseReply( const QByteArray &reply );
+ QString m_label;
+ QString m_address;
+ QString m_x;
+ QString m_y;
+ bool m_valid;
};
#endif // LOCATION_P_H
LocationPrivate m_subject(label);
label = "work";
+ QString address( "Taivaanvuohentie 7 B 27, Helsinki" );
QString x( "2549182" );
QString y( "6672569" );
+ m_subject.setAddress( address );
m_subject.setLabel( label );
m_subject.setX( x );
m_subject.setY( y );
+ QCOMPARE( m_subject.address(), address );
QCOMPARE( m_subject.label(), label );
QCOMPARE( m_subject.x(), x );
QCOMPARE( m_subject.y(), y );
</ROUTE>\
</MTRXML>\
"
-
);
void Ut_Route::init()
void Ut_Route::testSetFromLocation()
{
Location work( "2551042", "6672829" );
+ QCOMPARE( m_subject->fromValid(), false );
m_subject->setFromLocation( &work );
- QCOMPARE( work.x(), m_subject->fromLocation()->x() );
- QCOMPARE( work.y(), m_subject->fromLocation()->y() );
+ QCOMPARE( m_subject->fromLocation()->x(), work.x() );
+ QCOMPARE( m_subject->fromLocation()->y(), work.y() );
+ QCOMPARE( m_subject->fromValid(), true );
}
void Ut_Route::testSetToLocation()
{
Location work( "2551042", "6672829" );
+ QCOMPARE( m_subject->toValid(), false );
m_subject->setToLocation( &work );
- QCOMPARE( work.x(), m_subject->toLocation()->x() );
- QCOMPARE( work.y(), m_subject->toLocation()->y() );
+ QCOMPARE( m_subject->toLocation()->x(), work.x() );
+ QCOMPARE( m_subject->toLocation()->y(), work.y() );
+ QCOMPARE( m_subject->toValid(), true );
}
QTEST_APPLESS_MAIN(Ut_Route)