TestOpenGLRenderingEngine.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_OPENGLRENDERINGENGINE_H__
00029 #  define __TEST_OPENGLRENDERINGENGINE_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/PCMOpenGLRenderingEngine.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 TestOpenGLRenderingEngine:public CppUnit::TestFixture
00057   {
00058 
00059         // First, we declare the suite, passing the class name to the macro:
00061         CPPUNIT_TEST_SUITE(TestOpenGLRenderingEngine);
00062 
00063         // Then, we declare each test case of the fixture:
00065         CPPUNIT_TEST(test_constructor);
00066         CPPUNIT_TEST(test_constructor_Process_p);
00067         CPPUNIT_TEST(test_destructor);
00068         CPPUNIT_TEST(test_create_cchar_p);
00069         CPPUNIT_TEST(test_createCustomRenderer_cchar_p);
00070         CPPUNIT_TEST(test__registerRenderer_Renderer_p);
00071         CPPUNIT_TEST(test_resizeRenderers_cu32_cu32);
00072         CPPUNIT_TEST(test_getSortOrderFromRenderers);
00073         CPPUNIT_TEST(test_setAutoRenderOrder_cRenderer_p_cs32);
00074         CPPUNIT_TEST(test_doAutoRendering);
00075         CPPUNIT_TEST(test_perspective_cdouble_cdouble_cdouble);
00076         CPPUNIT_TEST(test_ortho2D_cdouble_cdouble_cdouble_cdouble);
00077         CPPUNIT_TEST(test_viewport_cdouble_cdouble_cdouble_cdouble);
00078         CPPUNIT_TEST(test_pushModelView);
00079         CPPUNIT_TEST(test_popModelView);
00080         CPPUNIT_TEST(test_translate_cdouble_cdouble_cdouble);
00081         CPPUNIT_TEST(test_rotate_cdouble_cdouble_cdouble_cdouble);
00082         CPPUNIT_TEST(test_scale_cdouble_cdouble_cdouble);
00083         CPPUNIT_TEST(test_setCameraPosition_cdouble_cdouble_cdouble);
00084         CPPUNIT_TEST(test_setCameraTarget_cdouble_cdouble_cdouble);
00085         CPPUNIT_TEST(test_setCameraUpVector_cdouble_cdouble_cdouble);
00086         CPPUNIT_TEST(test_setColor_cdouble_cdouble_cdouble_cdouble);
00087         CPPUNIT_TEST(test_setAmbientMaterial_cdouble_cdouble_cdouble_cdouble);
00088         CPPUNIT_TEST(test_setDiffuseMaterial_cdouble_cdouble_cdouble_cdouble);
00089         CPPUNIT_TEST(test_setSpecularMaterial_cdouble_cdouble_cdouble_cdouble_cint);
00090         CPPUNIT_TEST(test_setDrawStyle_cunsigned);
00091         CPPUNIT_TEST(test_setBackCulling_cbool);
00092         CPPUNIT_TEST(test_setBlending_cbool);
00093         CPPUNIT_TEST(test_drawTriangle);
00094         CPPUNIT_TEST(test_generateRandomTriangles_cint_cint);
00095         CPPUNIT_TEST(test__registerObject_ObjectData);
00096         CPPUNIT_TEST(test_renderObject_cu32_cbool);
00097         CPPUNIT_TEST(test_renderObjectTriangles_cu32_cbool_cu32);
00098         CPPUNIT_TEST(test__renderObject_cu32_cbool_cu32);
00099         CPPUNIT_TEST(test_setAmbientLight_cdouble_cdouble_cdouble_cdouble);
00100         CPPUNIT_TEST(test_removeLightSources);
00101         CPPUNIT_TEST(test_addLightSource);
00102         CPPUNIT_TEST(test_setLightSourcePosition_cint_cdouble_cdouble_cdouble);
00103         CPPUNIT_TEST(test_setLightSourceDiffuse_cint_cdouble_cdouble_cdouble_cdouble);
00104         CPPUNIT_TEST(test_setLightSourceSpecular_cint_cdouble_cdouble_cdouble_cdouble);
00105         CPPUNIT_TEST(test_createDisplayList);
00106         CPPUNIT_TEST(test_finishDisplayList);
00107         CPPUNIT_TEST(test_executeDisplayList_cu32);
00108         CPPUNIT_TEST(test_drawSphere_cdouble_cint_cint);
00109         CPPUNIT_TEST(test_drawCylinder_cdouble_cdouble_cdouble_cint_cint);
00110         CPPUNIT_TEST(test_drawDisk_cdouble_cdouble_cint_cint);
00111         CPPUNIT_TEST(test_drawTeapot_cdouble);
00112         CPPUNIT_TEST(test_drawCube_cdouble);
00113         CPPUNIT_TEST(test_drawTorus_cdouble_cdouble_cint_cint);
00114         CPPUNIT_TEST(test_drawDodecahedron_cdouble);
00115         CPPUNIT_TEST(test_drawOctahedron_cdouble);
00116         CPPUNIT_TEST(test_drawTetrahedron_cdouble);
00117         CPPUNIT_TEST(test_drawIcosahedron_cdouble);
00118         CPPUNIT_TEST(test__refreshCamera);
00119         CPPUNIT_TEST(test__setGLUDrawStyle_cvoid_p);
00120         CPPUNIT_TEST(test__reportTriangles_cu32);
00121 
00122         // Finally, we end the suite declaration:
00124         CPPUNIT_TEST_SUITE_END();
00125 
00126    public:
00127 
00129         void setUp();
00130 
00132         void tearDown();
00133 
00134    protected:
00135 
00136         //
00137         // Constructor & destructor tests
00138         //
00139 
00143         void test_constructor();
00144 
00148         void test_constructor_Process_p();
00149 
00153         void test_destructor();
00154 
00155         //
00156         // Class method tests
00157         //
00158 
00162         void test_create_cchar_p();
00163 
00164         //
00165         // Method tests
00166         //
00167 
00171         void test_createCustomRenderer_cchar_p();
00172 
00176         void test_resizeRenderers_cu32_cu32();
00177 
00181         void test_getSortOrderFromRenderers();
00182 
00186         void test_setAutoRenderOrder_cRenderer_p_cs32();
00187 
00191         void test_doAutoRendering();
00192 
00196         void test_perspective_cdouble_cdouble_cdouble();
00197 
00201         void test_ortho2D_cdouble_cdouble_cdouble_cdouble();
00202 
00206         void test_viewport_cdouble_cdouble_cdouble_cdouble();
00207 
00211         void test_pushModelView();
00212 
00216         void test_popModelView();
00217 
00221         void test_translate_cdouble_cdouble_cdouble();
00222 
00226         void test_rotate_cdouble_cdouble_cdouble_cdouble();
00227 
00231         void test_scale_cdouble_cdouble_cdouble();
00232 
00236         void test_setCameraPosition_cdouble_cdouble_cdouble();
00237 
00241         void test_setCameraTarget_cdouble_cdouble_cdouble();
00242 
00246         void test_setCameraUpVector_cdouble_cdouble_cdouble();
00247 
00251         void test_setColor_cdouble_cdouble_cdouble_cdouble();
00252 
00256         void test_setAmbientMaterial_cdouble_cdouble_cdouble_cdouble();
00257 
00261         void test_setDiffuseMaterial_cdouble_cdouble_cdouble_cdouble();
00262 
00266         void test_setSpecularMaterial_cdouble_cdouble_cdouble_cdouble_cint();
00267 
00271         void test_setDrawStyle_cunsigned();
00272 
00276         void test_setBackCulling_cbool();
00277 
00281         void test_setBlending_cbool();
00282 
00286         void test_drawTriangle();
00287 
00291         void test_generateRandomTriangles_cint_cint();
00292 
00296         void test_renderObject_cu32_cbool();
00297 
00301         void test_renderObjectTriangles_cu32_cbool_cu32();
00302 
00306         void test_setAmbientLight_cdouble_cdouble_cdouble_cdouble();
00307 
00311         void test_removeLightSources();
00312 
00316         void test_addLightSource();
00317 
00321         void test_setLightSourcePosition_cint_cdouble_cdouble_cdouble();
00322 
00326         void test_setLightSourceDiffuse_cint_cdouble_cdouble_cdouble_cdouble();
00327 
00331         void test_setLightSourceSpecular_cint_cdouble_cdouble_cdouble_cdouble();
00332 
00336         void test_createDisplayList();
00337 
00341         void test_finishDisplayList();
00342 
00346         void test_executeDisplayList_cu32();
00347 
00351         void test_drawSphere_cdouble_cint_cint();
00352 
00356         void test_drawCylinder_cdouble_cdouble_cdouble_cint_cint();
00357 
00361         void test_drawDisk_cdouble_cdouble_cint_cint();
00362 
00366         void test_drawTeapot_cdouble();
00367 
00371         void test_drawCube_cdouble();
00372 
00376         void test_drawTorus_cdouble_cdouble_cint_cint();
00377 
00381         void test_drawDodecahedron_cdouble();
00382 
00386         void test_drawOctahedron_cdouble();
00387 
00391         void test_drawTetrahedron_cdouble();
00392 
00396         void test_drawIcosahedron_cdouble();
00397 
00401         void test__registerRenderer_Renderer_p();
00402 
00406         void test__registerObject_ObjectData();
00407 
00411         void test__renderObject_cu32_cbool_cu32();
00412 
00416         void test__refreshCamera();
00417 
00421         void test__setGLUDrawStyle_cvoid_p();
00422 
00426         void test__reportTriangles_cu32();
00427 
00428   };
00429 
00430 }
00431 
00432 #endif