Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Remove duplicated implementation of MeasureAvgPortion

Dmitry Kazakove6d71d40a2b8
diff --git a/sdk/tests/testutil.h b/sdk/tests/testutil.h
index 1702df1aef..705b41ae7f 100644
--- a/sdk/tests/testutil.h
+++ b/sdk/tests/testutil.h
@@ -421,52 +421,6 @@ struct MaskParent
namespace TestUtil {
-class MeasureAvgPortion
-{
-public:
- MeasureAvgPortion(int period)
- : m_period(period),
- m_val(0),
- m_total(0),
- m_cycles(0)
- {
- }
-
- ~MeasureAvgPortion() {
- printValues(true);
- }
-
- void addVal(int x) {
- m_val += x;
- }
-
- void addTotal(int x) {
- m_total += x;
- m_cycles++;
- printValues();
- }
-
-private:
- void printValues(bool force = false) {
- if (m_cycles > m_period || force) {
- qDebug() << "Val / Total:" << qreal(m_val) / qreal(m_total);
- qDebug() << "Avg. Val: " << qreal(m_val) / m_cycles;
- qDebug() << "Avg. Total: " << qreal(m_total) / m_cycles;
- qDebug() << ppVar(m_val) << ppVar(m_total) << ppVar(m_cycles);
-
- m_val = 0;
- m_total = 0;
- m_cycles = 0;
- }
- }
-
-private:
- int m_period;
- qint64 m_val;
- qint64 m_total;
- qint64 m_cycles;
-};
-
struct MeasureDistributionStats {
MeasureDistributionStats(int numBins, const QString &name = QString())
: m_numBins(numBins),