projects
/
ptas
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
feabeeb
)
Changes: tweaks to unit tests
author
Max Waterman
<david.waterman@nokia.com>
Tue, 13 Apr 2010 05:37:32 +0000
(08:37 +0300)
committer
Max Waterman
<david.waterman@nokia.com>
Tue, 13 Apr 2010 05:37:32 +0000
(08:37 +0300)
zouba/src/location_p.h
patch
|
blob
|
history
zouba/src/route_p.cpp
patch
|
blob
|
history
zouba/tests/ut_location/ut_location.cpp
patch
|
blob
|
history
zouba/tests/ut_route/ut_route.cpp
patch
|
blob
|
history
diff --git
a/zouba/src/location_p.h
b/zouba/src/location_p.h
index
c0778bc
..
e32b267
100644
(file)
--- a/
zouba/src/location_p.h
+++ b/
zouba/src/location_p.h
@@
-10,13
+10,7
@@
class LocationPrivate : public QObject
Q_OBJECT
public:
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 &x, const QString &y, const QString &label );
-
LocationPrivate( const QString &label );
virtual ~LocationPrivate();
LocationPrivate( const QString &label );
virtual ~LocationPrivate();
@@
-39,6
+33,11
@@
public:
void parseReply( const QByteArray &reply );
void parseReply( const QByteArray &reply );
+ QString m_label;
+ QString m_address;
+ QString m_x;
+ QString m_y;
+ bool m_valid;
};
#endif // LOCATION_P_H
};
#endif // LOCATION_P_H
diff --git
a/zouba/src/route_p.cpp
b/zouba/src/route_p.cpp
index
1acb276
..
8cb2c7f
100644
(file)
--- a/
zouba/src/route_p.cpp
+++ b/
zouba/src/route_p.cpp
@@
-112,7
+112,7
@@
QString RoutePrivate::parseJORECode( const QString &joreCode ) const
lineCode.setNum( lineCode.toInt() );
retVal = lineCode;
lineCode.setNum( lineCode.toInt() );
retVal = lineCode;
-
+
if ( letterVariant != " " ) {
retVal += letterVariant;
}
if ( letterVariant != " " ) {
retVal += letterVariant;
}
diff --git
a/zouba/tests/ut_location/ut_location.cpp
b/zouba/tests/ut_location/ut_location.cpp
index
88295c8
..
e7e4ca6
100644
(file)
--- a/
zouba/tests/ut_location/ut_location.cpp
+++ b/
zouba/tests/ut_location/ut_location.cpp
@@
-53,11
+53,14
@@
void Ut_Location::testSet()
LocationPrivate m_subject(label);
label = "work";
LocationPrivate m_subject(label);
label = "work";
+ QString address( "Taivaanvuohentie 7 B 27, Helsinki" );
QString x( "2549182" );
QString y( "6672569" );
QString x( "2549182" );
QString y( "6672569" );
+ m_subject.setAddress( address );
m_subject.setLabel( label );
m_subject.setX( x );
m_subject.setY( y );
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 );
QCOMPARE( m_subject.label(), label );
QCOMPARE( m_subject.x(), x );
QCOMPARE( m_subject.y(), y );
diff --git
a/zouba/tests/ut_route/ut_route.cpp
b/zouba/tests/ut_route/ut_route.cpp
index
138b8c0
..
bb34092
100644
(file)
--- a/
zouba/tests/ut_route/ut_route.cpp
+++ b/
zouba/tests/ut_route/ut_route.cpp
@@
-336,7
+336,6
@@
QByteArray sampleInput(
</ROUTE>\
</MTRXML>\
"
</ROUTE>\
</MTRXML>\
"
-
);
void Ut_Route::init()
);
void Ut_Route::init()
@@
-374,17
+373,21
@@
void Ut_Route::testParseReply()
void Ut_Route::testSetFromLocation()
{
Location work( "2551042", "6672829" );
void Ut_Route::testSetFromLocation()
{
Location work( "2551042", "6672829" );
+ QCOMPARE( m_subject->fromValid(), false );
m_subject->setFromLocation( &work );
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" );
}
void Ut_Route::testSetToLocation()
{
Location work( "2551042", "6672829" );
+ QCOMPARE( m_subject->toValid(), false );
m_subject->setToLocation( &work );
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)
}
QTEST_APPLESS_MAIN(Ut_Route)