From 2f675571788cfbddccc5ee94e976a00c484e93b8 Mon Sep 17 00:00:00 2001 From: luukkainen Date: Mon, 4 Jul 2016 13:32:53 +0000 Subject: [PATCH] Improve Proteus property comparison refs #6560 git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@32949 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../interop/test/GraphComparator.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java b/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java index e20c83e..72a975f 100644 --- a/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java +++ b/org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java @@ -205,6 +205,10 @@ public class GraphComparator { } public void test(Session session) throws DatabaseException { + test(session, r1, r2); + } + + public void test(Session session, Resource r1, Resource r2) throws DatabaseException { comparator.setComparator(this); @@ -349,8 +353,7 @@ public class GraphComparator { addComparable(leftS, rightS, false); } } - } - + } } } @@ -856,7 +859,7 @@ public class GraphComparator { break; } else { while (i2 < ss2.size()) { - if (DEBUG) System.out.println("Compare Statements diff2 " + printStatement(g,ss2.get(i2))); + if (DEBUG) System.out.println("Compare Statements addition " + printStatement(g,ss2.get(i2))); addAddition(ss2.get(i2)); i2++; @@ -865,7 +868,7 @@ public class GraphComparator { } } else if (i2 >= ss2.size()) { while (i1 < ss1.size()) { - if (DEBUG) System.out.println("Compare Statements diff1 " + printStatement(g,ss1.get(i1))); + if (DEBUG) System.out.println("Compare Statements deletion " + printStatement(g,ss1.get(i1))); addDeletion(ss1.get(i1)); i1++; } @@ -880,13 +883,13 @@ public class GraphComparator { i2+=same2; } else if (c < 0) { for (int i = 0; i < same1; i++) { - if (DEBUG) System.out.println("Compare Statements diff1 " + printStatement(g,ss1.get(i+i1))); + if (DEBUG) System.out.println("Compare Statements deletion " + printStatement(g,ss1.get(i+i1))); addDeletion(ss1.get(i+i1)); } i1 += same1; } else { for (int i = 0; i < same2; i++) { - if (DEBUG) System.out.println("Compare Statements diff2 " + printStatement(g,ss2.get(i+i2))); + if (DEBUG) System.out.println("Compare Statements addition " + printStatement(g,ss2.get(i+i2))); addAddition(ss2.get(i+i2)); } @@ -1036,13 +1039,13 @@ public class GraphComparator { } for (int i1 = off1; i1 < off1 + len1; i1++) { if (!used1[i1-off1]) { - if (DEBUG) System.out.println("Compare Object diff1 " + printStatement(g,ss1.get(i1))); + if (DEBUG) System.out.println("Compare Object deletion " + printStatement(g,ss1.get(i1))); addDeletion(ss1.get(i1)); } } for (int i2 = off2; i2 < off2 + len2; i2++) { if (!used2[i2-off2]) { - if (DEBUG) System.out.println("Compare Object diff2 " + printStatement(g,ss2.get(i2))); + if (DEBUG) System.out.println("Compare Object addition " + printStatement(g,ss2.get(i2))); addAddition(ss2.get(i2)); } } -- 2.47.1