TestPointer.h

Go to the documentation of this file.
00001 
00002 //
00003 // This source file is a part of ParCompMark
00004 // Parallel Compositing Benchmark Framework
00005 //
00006 // for latest info see http://parcompmark.sourceforge.net
00007 
00008 //
00009 // Copyright (C) 2006 IT2 ParCompMark Dev. Team
00010 // 
00011 // This program is free software; you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public License
00013 // as published by the Free Software Foundation; either version 2
00014 // of the License, or (at your option) any later version.
00015 // 
00016 // This program is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 // GNU General Public License for more details.
00020 // 
00021 // You should have received a copy of the GNU General Public License
00022 // along with this program; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00024 
00027 
00028 #ifndef __TEST_POINTER_H__
00029 #  define __TEST_POINTER_H__
00030 
00031 //
00032 // CppUnit include
00033 //
00034 #  include <cppunit/extensions/HelperMacros.h>
00035 
00036 //
00037 // Tested class include
00038 //
00039 #  define PARCOMPMARK_TEST
00040 #  include "../../include/PCMPointer.h"
00041 #  undef PARCOMPMARK_TEST
00042 
00043 //
00044 // Opening namespace of the tested project
00045 //
00046 using namespace ParCompMark;
00047 
00048 namespace ParCompMarkTest
00049 {
00050 
00056   class TestPointer:public CppUnit::TestFixture
00057   {
00058 
00059         // First, we declare the suite, passing the class name to the macro:
00061         CPPUNIT_TEST_SUITE(TestPointer);
00062 
00063         // Then, we declare each test case of the fixture:
00065         CPPUNIT_TEST(test_constructor);
00066         CPPUNIT_TEST(test_constructor_cT_p_cbool);
00067         CPPUNIT_TEST(test_constructor_Pointer___T__Lock__);
00068         CPPUNIT_TEST(test_constructor_cPointer___T__Lock__);
00069         CPPUNIT_TEST(test_destructor);
00070         CPPUNIT_TEST(test_operator_assignment_cT_p);
00071         CPPUNIT_TEST(test_operator_assignment_Pointer___T__Lock__);
00072         CPPUNIT_TEST(test_operator_assignment_cPointer___T__Lock__);
00073         CPPUNIT_TEST(test_operator_memberSelection);
00074         CPPUNIT_TEST(test_operator_equality_cT_p);
00075         CPPUNIT_TEST(test_operator_equality_Pointer___T__Lock__);
00076         CPPUNIT_TEST(test_operator_inequality_cT_p);
00077         CPPUNIT_TEST(test_operator_inequality_Pointer___T__Lock__);
00078         CPPUNIT_TEST(test_isNull);
00079         CPPUNIT_TEST(test_isNotNull);
00080         CPPUNIT_TEST(test_assignWithLock_Pointer___T__Lock__);
00081         CPPUNIT_TEST(test_reference_cT_p);
00082         CPPUNIT_TEST(test_getPtr);
00083         CPPUNIT_TEST(test_kill_cbool);
00084         CPPUNIT_TEST(test_setNull_cbool);
00085         CPPUNIT_TEST(test_lock);
00086         CPPUNIT_TEST(test_trylock);
00087         CPPUNIT_TEST(test_unlock);
00088         CPPUNIT_TEST(test_getLocked);
00089         CPPUNIT_TEST(test__deletePointer_cbool_cbool);
00090         CPPUNIT_TEST(test__assignCPointer_cT_p_cbool);
00091         CPPUNIT_TEST(test__assignPointer_Pointer___T__Lock___cbool);
00092         CPPUNIT_TEST(test__switchPointer_Pointer___T__Lock___cbool);
00093         CPPUNIT_TEST(test__equalsCPointer_cT_p);
00094         CPPUNIT_TEST(test__equalsPointer_Pointer___T__Lock__);
00095 
00096         // Finally, we end the suite declaration:
00098         CPPUNIT_TEST_SUITE_END();
00099 
00100    public:
00101 
00103         void setUp();
00104 
00106         void tearDown();
00107 
00108    protected:
00109 
00110         //
00111         // Constructor & destructor tests
00112         //
00113 
00117         void test_constructor();
00118 
00122         void test_constructor_cT_p_cbool();
00123 
00127         void test_constructor_Pointer___T__Lock__();
00128 
00132         void test_constructor_cPointer___T__Lock__();
00133 
00137         void test_destructor();
00138 
00139         //
00140         // Operator tests
00141         //
00142 
00146         void test_operator_assignment_cT_p();
00147 
00151         void test_operator_assignment_Pointer___T__Lock__();
00152 
00156         void test_operator_assignment_cPointer___T__Lock__();
00157 
00161         void test_operator_memberSelection();
00162 
00166         void test_operator_equality_cT_p();
00167 
00171         void test_operator_equality_Pointer___T__Lock__();
00172 
00176         void test_operator_inequality_cT_p();
00177 
00181         void test_operator_inequality_Pointer___T__Lock__();
00182 
00183         //
00184         // Method tests
00185         //
00186 
00190         void test_isNull();
00191 
00195         void test_isNotNull();
00196 
00200         void test_assignWithLock_Pointer___T__Lock__();
00201 
00205         void test_reference_cT_p();
00206 
00210         void test_getPtr();
00211 
00215         void test_kill_cbool();
00216 
00220         void test_setNull_cbool();
00221 
00225         void test_lock();
00226 
00230         void test_trylock();
00231 
00235         void test_unlock();
00236 
00240         void test_getLocked();
00241 
00245         void test__deletePointer_cbool_cbool();
00246 
00250         void test__assignCPointer_cT_p_cbool();
00251 
00255         void test__assignPointer_Pointer___T__Lock___cbool();
00256 
00260         void test__switchPointer_Pointer___T__Lock___cbool();
00261 
00265         void test__equalsCPointer_cT_p();
00266 
00270         void test__equalsPointer_Pointer___T__Lock__();
00271 
00272   };
00273 
00274 }
00275 
00276 #endif