Added address resolution, and moved everything up one directory.
[ptas] / zouba / tests / ut_location / ut_location.cpp
1 #include <QObject>
2 #include <QtDebug>
3 #include <QByteArray>
4 #include "ut_location.h"
5
6 QByteArray sampleInput(
7 "\
8 <?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?><MTRXML version=\"1.0\">\
9 <GEOCODE key=\"taivaanvuohentie 7,helsinki\">\
10 <LOC name1=\"Taivaanvuohentie\" number=\"7\" city=\"Helsinki\" code=\"\" address=\"\" type=\"900\" category=\"street\" x=\"2549183\" y=\"6672570\" lon=\"24.88256\" lat=\"60.16183\" />\
11 </GEOCODE>\
12 </MTRXML>\
13 "
14
15 );
16
17 void Ut_Location::init()
18 {
19     m_subject = new LocationPrivate();
20 }
21
22 void Ut_Location::cleanup()
23 {
24     delete m_subject;
25     m_subject = 0;
26 }
27
28 void Ut_Location::initTestCase()
29 {
30 }
31
32 void Ut_Location::cleanupTestCase()
33 {
34 }
35
36 void Ut_Location::testParseReply()
37 {
38   m_subject->parseReply( sampleInput );
39
40   QCOMPARE( m_subject->x(), QString( "2549183" ) );
41   QCOMPARE( m_subject->y(), QString( "6672570" ) );
42 }
43
44 void Ut_Location::testSet()
45 {
46   QString x( "2549183" );
47   QString y( "6672570" );
48   m_subject->setX( x );
49   m_subject->setY( y );
50   QCOMPARE( x, m_subject->x() );
51   QCOMPARE( y, m_subject->y() );
52 }
53
54 QTEST_MAIN(Ut_Location)