00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * テストデコレータヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef TEST_DECORATOR_H_ 00026 #define TEST_DECORATOR_H_ 00027 00028 #include <LampUnit/Test.h> 00029 00030 namespace LampUnit{ 00031 00032 //------------------------------------------------------------------------------ 00033 /** 00034 * テストデコレータ 00035 */ 00036 class TestDecorator : public Test{ 00037 public: 00038 /** 00039 * コンストラクタ 00040 * @param test デコレーションするテスト 00041 */ 00042 TestDecorator(Test* test) : test_(test){ 00043 } 00044 00045 /** 00046 * デストラクタ 00047 */ 00048 virtual ~TestDecorator(){} 00049 00050 /** 00051 * テストを実行する 00052 * @param result [out] テスト結果 00053 */ 00054 virtual void run(TestResult* result){ 00055 test_->run(result); 00056 } 00057 00058 /** 00059 * テストケースの個数を取得 00060 * @return テストケースの個数 00061 */ 00062 virtual int getCountTestCases() const{ 00063 return test_->getCountTestCases(); 00064 } 00065 00066 /** 00067 * テストの名前を取得 00068 * @return テストの名前 00069 */ 00070 virtual const Lamp::String& getName() const{ 00071 return test_->getName(); 00072 } 00073 00074 /** 00075 * テストを文字列に変換 00076 * @return テストの文字列表記 00077 */ 00078 virtual const Lamp::String& toString() const{ 00079 return test_->toString(); 00080 } 00081 00082 private: 00083 // コピーコンストラクタの隠蔽 00084 TestDecorator(const TestDecorator& copy); 00085 00086 // 代入コピーの隠蔽 00087 void operator =(const TestDecorator& copy); 00088 00089 // デコレーション対象テスト 00090 Test* test_; 00091 }; 00092 00093 //------------------------------------------------------------------------------ 00094 } // End of namespace LampUnit 00095 #endif // End of TEST_DECORATOR_H_ 00096 //------------------------------------------------------------------------------