00001 /*************************************************************************** 00002 * Copyright (C) 2007 by Tim Sutton * 00003 * tim@linfiniti.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program 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 * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #include <QtTest/QtTest> 00021 #include <omggradientfactory.h> 00022 #include <QImage> 00023 #include <QPainter> 00024 00025 class OmgGradientFactoryTest: public QObject 00026 { 00027 Q_OBJECT; 00028 private slots: 00029 void testRedGradient(); 00030 void initTestCase();// will be called before the first testfunction is executed. 00031 void cleanupTestCase();// will be called after the last testfunction was executed. 00032 void init(){};// will be called before each testfunction is executed. 00033 void cleanup();// will be called after every testfunction. 00034 private: 00035 OmgGradientFactory mFactory; 00036 QImage mImage; 00037 QPainter * mpPainter; 00038 QString mTestFile; 00039 QLinearGradient mGradient; 00040 }; 00041 00042 void OmgGradientFactoryTest::initTestCase() 00043 { 00044 mImage = QImage( 800,800,QImage::Format_ARGB32 ); 00045 mImage.fill(Qt::white); 00046 mpPainter = new QPainter ( &mImage ); 00047 } 00048 void OmgGradientFactoryTest::cleanup() 00049 { 00050 //paint out to the qimage here then save to disk 00051 } 00052 void OmgGradientFactoryTest::cleanupTestCase() 00053 { 00054 delete mpPainter; 00055 } 00056 void OmgGradientFactoryTest::testRedGradient() 00057 { 00058 mTestFile="/tmp/redGradient.png"; 00059 //mGradient = mFactory.getRedGradient(); 00060 } 00061 00062 QTEST_MAIN(OmgGradientFactoryTest) 00063 #include "moc_omggradientfactorytest.cxx" 00064