r23048 - gnucash/trunk/src/engine - Revert r23043 "Minor code cleanup: Don't print "warning" output in comparison function."

Christian Stimming cstim at code.gnucash.org
Thu Jun 13 03:58:50 EDT 2013


Author: cstim
Date: 2013-06-13 03:58:49 -0400 (Thu, 13 Jun 2013)
New Revision: 23048
Trac: http://svn.gnucash.org/trac/changeset/23048

Modified:
   gnucash/trunk/src/engine/Transaction.c
Log:
Revert r23043 "Minor code cleanup: Don't print "warning" output in comparison function."

Sigh. It turns out the utest-Split.c relies on the "warning" log level
in order to check for specific code paths. This sucks. The log level
"warning" should please be reserved for things that are actual warnings,
not for code path checks that are used in the unittests.

Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2013-06-13 07:32:23 UTC (rev 23047)
+++ gnucash/trunk/src/engine/Transaction.c	2013-06-13 07:58:49 UTC (rev 23048)
@@ -780,7 +780,7 @@
 
     if (!ta || !tb)
     {
-        PINFO ("one is NULL");
+        PWARN ("one is NULL");
         return FALSE;
     }
 
@@ -792,14 +792,14 @@
     {
         if (qof_instance_guid_compare(ta, tb) != 0)
         {
-            PINFO ("GUIDs differ");
+            PWARN ("GUIDs differ");
             return FALSE;
         }
     }
 
     if (!gnc_commodity_equal(ta->common_currency, tb->common_currency))
     {
-        PINFO ("commodities differ %s vs %s",
+        PWARN ("commodities differ %s vs %s",
                gnc_commodity_get_unique_name (ta->common_currency),
                gnc_commodity_get_unique_name (tb->common_currency));
         return FALSE;
@@ -812,7 +812,7 @@
 
         (void)gnc_timespec_to_iso8601_buff(ta->date_entered, buf1);
         (void)gnc_timespec_to_iso8601_buff(tb->date_entered, buf2);
-        PINFO ("date entered differs: '%s' vs '%s'", buf1, buf2);
+        PWARN ("date entered differs: '%s' vs '%s'", buf1, buf2);
         return FALSE;
     }
 
@@ -823,7 +823,7 @@
 
         (void)gnc_timespec_to_iso8601_buff(ta->date_posted, buf1);
         (void)gnc_timespec_to_iso8601_buff(tb->date_posted, buf2);
-        PINFO ("date posted differs: '%s' vs '%s'", buf1, buf2);
+        PWARN ("date posted differs: '%s' vs '%s'", buf1, buf2);
         return FALSE;
     }
 
@@ -832,14 +832,14 @@
      */
     if ((same_book && ta->num != tb->num) || (!same_book && g_strcmp0(ta->num, tb->num) != 0))
     {
-        PINFO ("num differs: %s vs %s", ta->num, tb->num);
+        PWARN ("num differs: %s vs %s", ta->num, tb->num);
         return FALSE;
     }
 
     if ((same_book && ta->description != tb->description)
             || (!same_book && g_strcmp0(ta->description, tb->description)))
     {
-        PINFO ("descriptions differ: %s vs %s", ta->description, tb->description);
+        PWARN ("descriptions differ: %s vs %s", ta->description, tb->description);
         return FALSE;
     }
 
@@ -851,7 +851,7 @@
         frame_a = kvp_frame_to_string (ta->inst.kvp_data);
         frame_b = kvp_frame_to_string (tb->inst.kvp_data);
 
-        PINFO ("kvp frames differ:\n%s\n\nvs\n\n%s", frame_a, frame_b);
+        PWARN ("kvp frames differ:\n%s\n\nvs\n\n%s", frame_a, frame_b);
 
         g_free (frame_a);
         g_free (frame_b);
@@ -863,7 +863,7 @@
     {
         if ((!ta->splits && tb->splits) || (!tb->splits && ta->splits))
         {
-            PINFO ("only one has splits");
+            PWARN ("only one has splits");
             return FALSE;
         }
 
@@ -885,7 +885,7 @@
 
                 if (!node_b)
                 {
-                    PINFO ("first has split %s and second does not",
+                    PWARN ("first has split %s and second does not",
                            guid_to_string (xaccSplitGetGUID (split_a)));
                     return FALSE;
                 }
@@ -901,14 +901,14 @@
                     guid_to_string_buff (xaccSplitGetGUID (split_a), str_a);
                     guid_to_string_buff (xaccSplitGetGUID (split_b), str_b);
 
-                    PINFO ("splits %s and %s differ", str_a, str_b);
+                    PWARN ("splits %s and %s differ", str_a, str_b);
                     return FALSE;
                 }
             }
 
             if (g_list_length (ta->splits) != g_list_length (tb->splits))
             {
-                PINFO ("different number of splits");
+                PWARN ("different number of splits");
                 return FALSE;
             }
         }



More information about the gnucash-changes mailing list