return board;
}
-bool Board::test()
-{
- kdDebug() << "Board::test()" << endl;
- Board board = Board::fromXml( "<board>\n<url>http://pc.2ch.net/linux/</url>\n<name>Linux</name>\n</board>\n" );
- if( board.url().url() != "http://pc.2ch.net/linux/" ) {
- kdError() << "inValid: line=" << __LINE__ << endl;
- }
- if( board.name() != "Linux" ) {
- kdError() << "inValid: line=" << __LINE__ << endl;
- }
-
- board = Board::fromXml( " <board>\n <url>http://pc.2ch.net/linux/</url>\n <name>Linux</name>\n </board>\n" );
- if( board.url().url() != "http://pc.2ch.net/linux/" ) {
- kdError() << "inValid: line=" << __LINE__ << endl;
- }
- if( board.name() != "Linux" ) {
- kdError() << "inValid: line=" << __LINE__ << endl;
- }
-
- return true;
-}
-
Board* Board::getByURL( const QString& boardURL )
{
// FIXME: null¥ª¥Ö¥¸¥§¥¯¥È¤òÍ×µá¤Î¤¿¤Ó¤Ëºî¤Ã¤Æ¤¤¤ë¡£
m_share3 = Board::getByURL( "http://pc.2ch.net/unix/" );
m_null = Board::getByURL( QString::null );
+
+ m_fromxml = Board::fromXml( "<board>\n<url>http://pc.2ch.net/linux/</url>\n<name>Linux</name>\n</board>\n" );
+ m_fromxml2 = Board::fromXml( " <board>\n"
+ " <url>http://pc.2ch.net/linux/</url>\n"
+ " <name>Linux</name>\n"
+ " </board>\n" );
}
void BoardTest::tearDown()
CPPUNIT_ASSERT_EQUAL( QString( "unix" ), m_share2->id() );
CPPUNIT_ASSERT_EQUAL( QString( "unix" ), m_share3->id() );
CPPUNIT_ASSERT_EQUAL( QString::null, m_null->id() );
+ CPPUNIT_ASSERT_EQUAL( QString( "linux" ), m_fromxml.id() );
+ CPPUNIT_ASSERT_EQUAL( QString( "linux" ), m_fromxml2.id() );
}
void BoardTest::testName()
CPPUNIT_ASSERT_EQUAL( QString( "U**x" ), m_share2->name() );
CPPUNIT_ASSERT_EQUAL( QString( "Unix" ), m_share3->name() );
CPPUNIT_ASSERT_EQUAL( QString::null, m_null->name() );
+ CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), m_fromxml.name() );
+ CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), m_fromxml2.name() );
}
void BoardTest::testSubjectTxtURL()
CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/unix/subject.txt" ),
m_share3->subjectTxtURL().url() );
CPPUNIT_ASSERT_EQUAL( QString::null, m_null->subjectTxtURL().url() );
+ CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/linux/subject.txt" ),
+ m_fromxml.subjectTxtURL().url() );
+ CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/linux/subject.txt" ),
+ m_fromxml2.subjectTxtURL().url() );
}
void BoardTest::testURL()
CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/unix/"),
m_share3->url().url() );
CPPUNIT_ASSERT_EQUAL( QString::null, m_null->url().url() );
+ CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/linux/"),
+ m_fromxml.url().url() );
+ CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/linux/"),
+ m_fromxml2.url().url() );
}
void ThreadTest::testBoardName()
{
CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), m_normal->boardName() );
- CPPUNIT_ASSERT_EQUAL( QString::null, m_noboard->boardName() );
+ // ¢m_normal¤Î¥³¥ó¥¹¥È¥é¥¯¥¿¤ÇÀßÄꤷ¤Æ¤ë¤Î¤¿¤á
+ CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), m_noboard->boardName() );
CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), m_fromxml.boardName() );
CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), m_fromxml2.boardName() );
CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), m_fromxml3.boardName() );