[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita] sdk/tests: Don't use dbgKrita in places that are used for debugging only
From:       Dmitry Kazakov <null () kde ! org>
Date:       2017-05-01 7:17:40
Message-ID: E1d55aW-00030e-Az () code ! kde ! org
[Download RAW message or body]

Git commit e29b1a5e936d28492014f3685b78a07c99249df0 by Dmitry Kazakov.
Committed on 01/05/2017 at 07:16.
Pushed by dkazakov into branch 'master'.

Don't use dbgKrita in places that are used for debugging only

comparePaintDevicesClever() and MeasureAvgPortion are used either in
tests or while debugging. They are not used in any production code,
so having to enable entire-Krita debugging to see their result is
just wastes the time.

M  +11   -11   sdk/tests/testutil.h

https://commits.kde.org/krita/e29b1a5e936d28492014f3685b78a07c99249df0

diff --git a/sdk/tests/testutil.h b/sdk/tests/testutil.h
index f5bf2194011..19bbae609f1 100644
--- a/sdk/tests/testutil.h
+++ b/sdk/tests/testutil.h
@@ -69,7 +69,7 @@ inline KisNodeSP findNode(KisNodeSP root, const QString &name) {
 
 inline void dumpNodeStack(KisNodeSP node, QString prefix = QString("\t"))
 {
-    dbgKrita << node->name();
+    qDebug() << node->name();
     KisNodeSP child = node->firstChild();
 
     while (child) {
@@ -77,7 +77,7 @@ inline void dumpNodeStack(KisNodeSP node, QString prefix = QString("\t"))
         if (child->childCount() > 0) {
             dumpNodeStack(child, prefix + "\t");
         } else {
-            dbgKrita << prefix << child->name();
+            qDebug() << prefix << child->name();
         }
         child = child->nextSibling();
     }
@@ -143,7 +143,7 @@ inline bool comparePaintDevices(QPoint & pt, const KisPaintDeviceSP dev1, const
         iter1->nextRow();
         iter2->nextRow();
     }
-    //     dbgKrita << "comparePaintDevices time elapsed:" << t.elapsed();
+    //     qDebug() << "comparePaintDevices time elapsed:" << t.elapsed();
     return true;
 }
 
@@ -154,7 +154,7 @@ inline bool comparePaintDevicesClever(const KisPaintDeviceSP dev1, const KisPain
     QRect rc2 = dev2->exactBounds();
 
     if (rc1 != rc2) {
-        dbgKrita << "Devices have different size" << ppVar(rc1) << ppVar(rc2);
+        qDebug() << "Devices have different size" << ppVar(rc1) << ppVar(rc2);
         return false;
     }
 
@@ -172,9 +172,9 @@ inline bool comparePaintDevicesClever(const KisPaintDeviceSP dev1, const KisPain
 
                 if (p1[3] < alphaThreshold && p2[3] < alphaThreshold) continue;
 
-                dbgKrita << "Failed compare paint devices:" << iter1->x() << iter1->y();
-                dbgKrita << "src:" << p1[0] << p1[1] << p1[2] << p1[3];
-                dbgKrita << "dst:" << p2[0] << p2[1] << p2[2] << p2[3];
+                qDebug() << "Failed compare paint devices:" << iter1->x() << iter1->y();
+                qDebug() << "src:" << p1[0] << p1[1] << p1[2] << p1[3];
+                qDebug() << "dst:" << p2[0] << p2[1] << p2[2] << p2[3];
                 return false;
             }
         } while (iter1->nextPixel() && iter2->nextPixel());
@@ -393,10 +393,10 @@ public:
 private:
     void printValues(bool force = false) {
         if (m_cycles > m_period || force) {
-            dbgKrita << "Val / Total:" << qreal(m_val) / qreal(m_total);
-            dbgKrita << "Avg. Val:   " << qreal(m_val) / m_cycles;
-            dbgKrita << "Avg. Total: " << qreal(m_total) / m_cycles;
-            dbgKrita << ppVar(m_val) << ppVar(m_total) << ppVar(m_cycles);
+            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;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic