Commit 2efb9d56 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Benchmark creation of datamanagers

svn path=/trunk/koffice/; revision=1079686
parent 1705053c
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${KOMAIN_INCLUDES} ${CMAKE_SOURCE_DIR}/krita/image/metadata ${CMAKE_SOURCE_DIR}/krita/sdk/tests )
include_directories( ${KOMAIN_INCLUDES} ${CMAKE_SOURCE_DIR}/krita/image/tiles3 )
########### next target ###############
#set(kis_cs_conversion_test_SRCS kis_cs_conversion_test.cpp )
#kde4_add_unit_test(KisCsConversionTest TESTNAME krita-image-KisCsConversionTest ${kis_cs_conversion_test_SRCS})
#target_link_libraries(KisCsConversionTest ${KDE4_KDEUI_LIBS} kritaimage ${QT_QTTEST_LIBRARY})
set(kis_datamanager_benchmark_SRCS kis_datamanager_benchmark.cpp )
kde4_add_unit_test(KisDatamanagerBenchmark TESTNAME krita-benchmarks-KisDataManager ${kis_datamanager_benchmark_SRCS})
target_link_libraries(KisDatamanagerBenchmark ${KDE4_KDEUI_LIBS} kritaimage ${QT_QTTEST_LIBRARY})
/*
* Copyright (c) 2007 Boudewijn Rempt boud@valdyas.org
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_datamanager_benchmark.h"
#include <qtest_kde.h>
#include <kis_datamanager.h>
void KisDatamanagerBenchmark::initTestCase()
{
// To make sure all the first-time startup costs are done
quint8 * p = new quint8[3];
memset(p, 0, 3);
KisDataManager dm(3, p);
}
void KisDatamanagerBenchmark::benchmarkCreation()
{
// tests the cost of creating a new datamanager
QBENCHMARK {
quint8 * p = new quint8[3];
memset(p, 0, 3);
KisDataManager dm(3, p);
}
}
QTEST_KDEMAIN(KisDatamanagerBenchmark, GUI)
#include "kis_datamanager_benchmark.moc"
/*
* Copyright (c) 2007 Boudewijn Rempt boud@valdyas.org
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_DATAMANAGER_BENCHMARK_H
#define KIS_DATAMANAGER_BENCHMARK_H
#include <QtTest/QtTest>
class KisDatamanagerBenchmark : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void benchmarkCreation();
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment