From 2e0f8abcfe02bd9e81d48221578291b10d0a6a2c Mon Sep 17 00:00:00 2001 From: ikemo Date: Wed, 24 Mar 2004 14:34:08 +0000 Subject: [PATCH] reformat git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@944 56b19765-1e22-0410-a548-a0f45d66c51a --- kita/src/libkita/tests/commenttest.cpp | 146 ++++++++++++++++----------------- kita/src/libkita/tests/commenttest.h | 54 ++++++------ 2 files changed, 100 insertions(+), 100 deletions(-) diff --git a/kita/src/libkita/tests/commenttest.cpp b/kita/src/libkita/tests/commenttest.cpp index 2a3668b..d3c573b 100644 --- a/kita/src/libkita/tests/commenttest.cpp +++ b/kita/src/libkita/tests/commenttest.cpp @@ -1,113 +1,113 @@ /*************************************************************************** - * Copyright (C) 2003 by Hideki Ikemoto * - * ikemo@wakaba.jp * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - ***************************************************************************/ +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo@wakaba.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ #include "commenttest.h" using namespace Kita; void CommentTest::setUp() { - m_normal = new Comment( "name<>mail<>03/11/03 00:39 ID:abcdefgh<>comment<>" ); - m_normal1 = new Comment( "name<>mail<>03/11/03 00:40 ID:12345678<>comment<>subject" ); - m_http = new Comment( "name<>mail<>03/11/03 00:41 ID:abcdefgh<>foo http://kita.sourceforge.jp/ bar<>" ); - m_ttp = new Comment( "name<>mail<>03/11/03 00:41 ID:abcdefgh<>foo ttp://kita.sourceforge.jp/ bar<>" ); - m_port = new Comment( "name<>mail<>03/11/03 00:42 ID:abcdefgh<>foo http://kita.sourceforge.jp:80/index.html bar<>" ); + m_normal = new Comment( "name<>mail<>03/11/03 00:39 ID:abcdefgh<>comment<>" ); + m_normal1 = new Comment( "name<>mail<>03/11/03 00:40 ID:12345678<>comment<>subject" ); + m_http = new Comment( "name<>mail<>03/11/03 00:41 ID:abcdefgh<>foo http://kita.sourceforge.jp/ bar<>" ); + m_ttp = new Comment( "name<>mail<>03/11/03 00:41 ID:abcdefgh<>foo ttp://kita.sourceforge.jp/ bar<>" ); + m_port = new Comment( "name<>mail<>03/11/03 00:42 ID:abcdefgh<>foo http://kita.sourceforge.jp:80/index.html bar<>" ); } void CommentTest::tearDown() { - delete m_normal; - delete m_normal1; - delete m_http; - delete m_ttp; - delete m_port; + delete m_normal; + delete m_normal1; + delete m_http; + delete m_ttp; + delete m_port; } void CommentTest::testName() { - CPPUNIT_ASSERT_EQUAL( QString("name"), m_normal->getName() ); - CPPUNIT_ASSERT_EQUAL( QString("name"), m_normal1->getName() ); - CPPUNIT_ASSERT_EQUAL( QString("name"), m_http->getName() ); - CPPUNIT_ASSERT_EQUAL( QString("name"), m_ttp->getName() ); - CPPUNIT_ASSERT_EQUAL( QString("name"), m_port->getName() ); + CPPUNIT_ASSERT_EQUAL( QString( "name" ), m_normal->getName() ); + CPPUNIT_ASSERT_EQUAL( QString( "name" ), m_normal1->getName() ); + CPPUNIT_ASSERT_EQUAL( QString( "name" ), m_http->getName() ); + CPPUNIT_ASSERT_EQUAL( QString( "name" ), m_ttp->getName() ); + CPPUNIT_ASSERT_EQUAL( QString( "name" ), m_port->getName() ); } void CommentTest::testAddress() { - CPPUNIT_ASSERT_EQUAL( QString("mail"), m_normal->getAddress() ); - CPPUNIT_ASSERT_EQUAL( QString("mail"), m_normal1->getAddress() ); - CPPUNIT_ASSERT_EQUAL( QString("mail"), m_http->getAddress() ); - CPPUNIT_ASSERT_EQUAL( QString("mail"), m_ttp->getAddress() ); - CPPUNIT_ASSERT_EQUAL( QString("mail"), m_port->getAddress() ); + CPPUNIT_ASSERT_EQUAL( QString( "mail" ), m_normal->getAddress() ); + CPPUNIT_ASSERT_EQUAL( QString( "mail" ), m_normal1->getAddress() ); + CPPUNIT_ASSERT_EQUAL( QString( "mail" ), m_http->getAddress() ); + CPPUNIT_ASSERT_EQUAL( QString( "mail" ), m_ttp->getAddress() ); + CPPUNIT_ASSERT_EQUAL( QString( "mail" ), m_port->getAddress() ); } void CommentTest::testDateId() { - CPPUNIT_ASSERT_EQUAL( QString("2003/11/03 00:39 ID:abcdefgh"), m_normal->getDateId() ); - CPPUNIT_ASSERT_EQUAL( QString("2003/11/03 00:40 ID:12345678"), m_normal1->getDateId() ); - CPPUNIT_ASSERT_EQUAL( QString("2003/11/03 00:41 ID:abcdefgh"), m_http->getDateId() ); - CPPUNIT_ASSERT_EQUAL( QString("2003/11/03 00:41 ID:abcdefgh"), m_ttp->getDateId() ); - CPPUNIT_ASSERT_EQUAL( QString("2003/11/03 00:42 ID:abcdefgh"), m_port->getDateId() ); + CPPUNIT_ASSERT_EQUAL( QString( "2003/11/03 00:39 ID:abcdefgh" ), m_normal->getDateId() ); + CPPUNIT_ASSERT_EQUAL( QString( "2003/11/03 00:40 ID:12345678" ), m_normal1->getDateId() ); + CPPUNIT_ASSERT_EQUAL( QString( "2003/11/03 00:41 ID:abcdefgh" ), m_http->getDateId() ); + CPPUNIT_ASSERT_EQUAL( QString( "2003/11/03 00:41 ID:abcdefgh" ), m_ttp->getDateId() ); + CPPUNIT_ASSERT_EQUAL( QString( "2003/11/03 00:42 ID:abcdefgh" ), m_port->getDateId() ); } void CommentTest::testBody() { - CPPUNIT_ASSERT_EQUAL( QString("comment"), m_normal->getBody() ); - CPPUNIT_ASSERT_EQUAL( QString("comment"), m_normal1->getBody() ); - CPPUNIT_ASSERT_EQUAL( QString("foo http://kita.sourceforge.jp/ bar"), m_http->getBody() ); - CPPUNIT_ASSERT_EQUAL( QString("foo ttp://kita.sourceforge.jp/ bar"), m_ttp->getBody() ); - CPPUNIT_ASSERT_EQUAL( QString("foo http://kita.sourceforge.jp:80/index.html bar"), m_port->getBody() ); + CPPUNIT_ASSERT_EQUAL( QString( "comment" ), m_normal->getBody() ); + CPPUNIT_ASSERT_EQUAL( QString( "comment" ), m_normal1->getBody() ); + CPPUNIT_ASSERT_EQUAL( QString( "foo http://kita.sourceforge.jp/ bar" ), m_http->getBody() ); + CPPUNIT_ASSERT_EQUAL( QString( "foo ttp://kita.sourceforge.jp/ bar" ), m_ttp->getBody() ); + CPPUNIT_ASSERT_EQUAL( QString( "foo http://kita.sourceforge.jp:80/index.html bar" ), m_port->getBody() ); } void CommentTest::testSubject() { - CPPUNIT_ASSERT_EQUAL( QString::null, m_normal->getSubject() ); - CPPUNIT_ASSERT_EQUAL( QString("subject"), m_normal1->getSubject() ); - CPPUNIT_ASSERT_EQUAL( QString::null, m_http->getSubject() ); - CPPUNIT_ASSERT_EQUAL( QString::null, m_ttp->getSubject() ); - CPPUNIT_ASSERT_EQUAL( QString::null, m_port->getSubject() ); + CPPUNIT_ASSERT_EQUAL( QString::null, m_normal->getSubject() ); + CPPUNIT_ASSERT_EQUAL( QString( "subject" ), m_normal1->getSubject() ); + CPPUNIT_ASSERT_EQUAL( QString::null, m_http->getSubject() ); + CPPUNIT_ASSERT_EQUAL( QString::null, m_ttp->getSubject() ); + CPPUNIT_ASSERT_EQUAL( QString::null, m_port->getSubject() ); } void CommentTest::testIsValid() { - CPPUNIT_ASSERT( m_normal->isValid() ); - CPPUNIT_ASSERT( m_normal1->isValid() ); - CPPUNIT_ASSERT( m_http->isValid() ); - CPPUNIT_ASSERT( m_ttp->isValid() ); - CPPUNIT_ASSERT( m_port->isValid() ); + CPPUNIT_ASSERT( m_normal->isValid() ); + CPPUNIT_ASSERT( m_normal1->isValid() ); + CPPUNIT_ASSERT( m_http->isValid() ); + CPPUNIT_ASSERT( m_ttp->isValid() ); + CPPUNIT_ASSERT( m_port->isValid() ); } void CommentTest::testToHtml() { - CPPUNIT_ASSERT_EQUAL( QString("
1 " - "name " - "2003/11/03 00:39 ID:abcdefgh
" - "
comment

"), - m_normal->toHtml( 1, false ) ); - CPPUNIT_ASSERT_EQUAL( QString("
1 " - "name " - "2003/11/03 00:40 ID:12345678
" - "
comment

"), - m_normal1->toHtml( 1, false ) ); - CPPUNIT_ASSERT_EQUAL( QString("
1 " - "name " - "2003/11/03 00:41 ID:abcdefgh
" - "
foo http://kita.sourceforge.jp/ bar

"), - m_http->toHtml( 1, false ) ); - CPPUNIT_ASSERT_EQUAL( QString("
1 " - "name " - "2003/11/03 00:41 ID:abcdefgh
" - "
foo ttp://kita.sourceforge.jp/ bar

"), - m_ttp->toHtml( 1, false ) ); - CPPUNIT_ASSERT_EQUAL( QString("
1 " - "name " - "2003/11/03 00:42 ID:abcdefgh
" - "
foo http://kita.sourceforge.jp:80/index.html bar

"), - m_port->toHtml( 1, false ) ); + CPPUNIT_ASSERT_EQUAL( QString( "
1 " + "name " + "2003/11/03 00:39 ID:abcdefgh
" + "
comment

" ), + m_normal->toHtml( 1, false ) ); + CPPUNIT_ASSERT_EQUAL( QString( "
1 " + "name " + "2003/11/03 00:40 ID:12345678
" + "
comment

" ), + m_normal1->toHtml( 1, false ) ); + CPPUNIT_ASSERT_EQUAL( QString( "
1 " + "name " + "2003/11/03 00:41 ID:abcdefgh
" + "
foo http://kita.sourceforge.jp/ bar

" ), + m_http->toHtml( 1, false ) ); + CPPUNIT_ASSERT_EQUAL( QString( "
1 " + "name " + "2003/11/03 00:41 ID:abcdefgh
" + "
foo ttp://kita.sourceforge.jp/ bar

" ), + m_ttp->toHtml( 1, false ) ); + CPPUNIT_ASSERT_EQUAL( QString( "
1 " + "name " + "2003/11/03 00:42 ID:abcdefgh
" + "
foo http://kita.sourceforge.jp:80/index.html bar

" ), + m_port->toHtml( 1, false ) ); } diff --git a/kita/src/libkita/tests/commenttest.h b/kita/src/libkita/tests/commenttest.h index 6e71bcc..b601f44 100644 --- a/kita/src/libkita/tests/commenttest.h +++ b/kita/src/libkita/tests/commenttest.h @@ -1,12 +1,12 @@ /*************************************************************************** - * Copyright (C) 2003 by Hideki Ikemoto * - * ikemo@wakaba.jp * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - ***************************************************************************/ +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo@wakaba.jp * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ #ifndef COMMENTTEST_H #define COMMENTTEST_H @@ -18,29 +18,29 @@ */ class CommentTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE( CommentTest ); - CPPUNIT_TEST( testName ); - CPPUNIT_TEST( testAddress ); - CPPUNIT_TEST( testDateId ); - CPPUNIT_TEST( testBody ); - CPPUNIT_TEST( testSubject ); - CPPUNIT_TEST( testIsValid ); - CPPUNIT_TEST( testToHtml ); - CPPUNIT_TEST_SUITE_END(); + CPPUNIT_TEST_SUITE( CommentTest ); + CPPUNIT_TEST( testName ); + CPPUNIT_TEST( testAddress ); + CPPUNIT_TEST( testDateId ); + CPPUNIT_TEST( testBody ); + CPPUNIT_TEST( testSubject ); + CPPUNIT_TEST( testIsValid ); + CPPUNIT_TEST( testToHtml ); + CPPUNIT_TEST_SUITE_END(); - Kita::Comment *m_normal, *m_normal1, *m_http, *m_ttp, *m_port; + Kita::Comment *m_normal, *m_normal1, *m_http, *m_ttp, *m_port; public: - void setUp(); - void tearDown(); + void setUp(); + void tearDown(); - void testName(); - void testAddress(); - void testDateId(); - void testBody(); - void testSubject(); - void testIsValid(); - void testToHtml(); + void testName(); + void testAddress(); + void testDateId(); + void testBody(); + void testSubject(); + void testIsValid(); + void testToHtml(); }; #endif -- 2.11.0