flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - fix bugs in xmldiffer
Date Thu, 06 Jun 2013 23:22:09 GMT
Updated Branches:
  refs/heads/develop 75b252bf2 -> f09029812


fix bugs in xmldiffer


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/f0902981
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/f0902981
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/f0902981

Branch: refs/heads/develop
Commit: f09029812bca0d7f1934742d814a03db238b3967
Parents: 75b252b
Author: Alex Harui <aharui@apache.org>
Authored: Thu Jun 6 16:21:23 2013 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Jun 6 16:21:23 2013 -0700

----------------------------------------------------------------------
 mustella/as3/src/mustella/CompareBitmap.as |   30 +++++++++++++++++-----
 1 files changed, 23 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f0902981/mustella/as3/src/mustella/CompareBitmap.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/CompareBitmap.as b/mustella/as3/src/mustella/CompareBitmap.as
index 27849b5..e609661 100644
--- a/mustella/as3/src/mustella/CompareBitmap.as
+++ b/mustella/as3/src/mustella/CompareBitmap.as
@@ -1396,6 +1396,7 @@ public class CompareBitmap extends Assert
         var retval:Boolean = false;
         var q:String;
         var i:int;
+        var j:int;
         var n:int;
         var m:int;
         var st:String;
@@ -1403,6 +1404,9 @@ public class CompareBitmap extends Assert
         var sv:String;
         var tv:String;
         
+        if (s.toXMLString() == t.toXMLString())
+            return false;
+        
         // compare tag names
         var sn:String = s.name().toString();
         var tn:String = t.name().toString();
@@ -1453,7 +1457,7 @@ public class CompareBitmap extends Assert
                 else 
                 {
                     sv = s['@' + st].toString();
-                    tv = s['@' + tt].toString();
+                    tv = t['@' + tt].toString();
                     if (sv != tv)
                     {
                         if (xywidthheight[st] == 1)
@@ -1473,11 +1477,11 @@ public class CompareBitmap extends Assert
                             tv = tv.substring(1, tv.length - 2);
                             sparts = sv.split(",");
                             tparts = tv.split(",");
-                            n = sparts.length;
-                            for (i = 0; i < n; i++)
+                            m = sparts.length;
+                            for (j = 0; j < m; j++)
                             {
-                                sv = sparts[i];
-                                tv = tparts[i];
+                                sv = sparts[j];
+                                tv = tparts[j];
                                 sv = sv.split("=")[1];
                                 tv = tv.split("=")[1];
                                 sf = Number(sv);
@@ -1512,8 +1516,20 @@ public class CompareBitmap extends Assert
         {
             for (i = 0; i < n; i++)
             {
-                if (compareNodes(sl[i], tl[i]))
-                    retval = true;
+                var nk:String = sl[i].nodeKind();
+                if (nk == "text")
+                {
+                    if (sl[i].text() != tl[i].text())
+                    {
+                        trace(sn, "different number of text nodes: cur=", sl[i].text(), "xml=",
tl[i].text());
+                        retval = true;
+                    }
+                }
+                else if (nk == "element")
+                {
+                    if (compareNodes(sl[i], tl[i]))
+                        retval = true;
+                }
             }
         }
         return retval;


Mime
View raw message