Commits

sk  committed 70bf9d3

Adjusted tests to use debug structures.

  • Participants
  • Parent commits b8c254b

Comments (0)

Files changed (2)

File src/org/lispdev/swank/SwankDebugInfo.java

     else if( !thread.equals(other.thread) ) return false;
     return true;
   }
-
-
 }

File src/org/lispdev/swank/SwankInterfaceTest.java

         "    ))", 1000);
     assertEquals("G", res);
 
+    final SwankDebugInfo[] infos = new SwankDebugInfo[2];
+
     final SwankRunnable debugInfo = new SwankRunnable(){
       @Override
       public void run()
-      {}
+      {
+        infos[0] = si.getLispImplementation().getDebugInfo(result);
+      }
     };
     final SwankRunnable debugInfo1 = new SwankRunnable(){
       @Override
       public void run()
-      {}
+      {
+        infos[1] = si.getLispImplementation().getDebugInfo(result);
+      }
     };
     final SwankRunnable debugStart = new SwankRunnable(){
       @Override
       public void run()
       {
-        String thread = debugInfo.result.get(1).value;
         si.swank.removeListener(debugInfo);
         si.swank.addListener(SwankEvent.DEBUG, debugInfo1);
-        si.sendStepDebug(null, thread);
+        si.sendStepDebug(null, infos[0].thread);
       }
     };
     si.swank.addListener(SwankEvent.DEBUG, debugInfo);
     si.swank.removeListener(debugInfo1);
     si.swank.removeListener(debugStart);
 
-    assertEquals(true,debugInfo.result.toString().contains(
-        "[Condition of type SIMPLE-CONDITION]"));
-    assertEquals(true,debugInfo1.result.toString().contains(
-        "(`Evaluating call:\n" +
-        "  (FORMAT T \"2 ~a~%\" (ELT X 2))\n" +
-        "With arguments:\n" +
-        "  T\n" +
-        "  \"2 ~a~%\"\n" +
-        "  3"));
+    assertEquals("`break`\n" +
+    		"`   [Condition of type SIMPLE-CONDITION]`",infos[0].condition);
+    assertEquals("`Evaluating call:\n" +
+    		"  (FORMAT T \"2 ~a~%\" (ELT X 2))\n" +
+    		"With arguments:\n" +
+    		"  T\n" +
+    		"  \"2 ~a~%\"\n" +
+    		"  3\n" +
+    		"\n" +
+    		"`\n" +
+    		"`   [Condition of type STEP-FORM-CONDITION]`",
+        infos[1].condition);
   }
 
   /*
     catch(Exception e)
     {}
     si.swank.removeListener(debugInfo);
+    SwankDebugInfo info =
+      si.getLispImplementation().getDebugInfo(debugInfo.result);
 
-    assertEquals("Interrupt from Emacs", debugInfo.result.get(3).get(0).value);
+    assertEquals("`Interrupt from Emacs`\n" +
+    		"`   [Condition of type SIMPLE-ERROR]`", info.condition);
   }
 
   /*
           if( !started.get() )
           {
             started.set(true);
-            LispNode info = debugInfo.result;
-            String thread = info.get(1).value;
-            si.sendInspectFrameLocal(thread, "1", "0", callBack);
+            SwankDebugInfo info =
+              si.getLispImplementation().getDebugInfo(debugInfo.result);
+            si.sendInspectFrameLocal(info.thread, "1", "0", callBack);
           }
         }
       }
           if( !started.get() )
           {
             started.set(true);
-            LispNode info = debugInfo.result;
-            String thread = info.get(1).value;
-            si.sendGetFrameSourceLocation(frame, thread, callBack);
+            SwankDebugInfo info =
+              si.getLispImplementation().getDebugInfo(debugInfo.result);
+            si.sendGetFrameSourceLocation(frame, info.thread, callBack);
           }
         }
       }
       e.printStackTrace();
     } // catch
     SwankDebugInfo info =
-      getLispImplementation().getDebugInfo(debugInfo.result);
+      si.getLispImplementation().getDebugInfo(debugInfo.result);
     LispVariable[] xx = si.getFrameLocals(1, info.thread, null);
     si.swank.removeListener(debugStart);
     si.swank.removeListener(debugInfo);
       @Override
       public void run()
       {
-        LispNode info = debugInfo.result;
-        String thread = info.get(1).value;
-
-        si.sendQuitDebug(callBack, thread);
+        SwankDebugInfo info =
+          si.getLispImplementation().getDebugInfo(debugInfo.result);
+        si.sendQuitDebug(callBack, info.thread);
       }
     };
 
       @Override
       public void run()
       {
-        LispNode info = debugInfo.result;
-        String thread = info.get(1).value;
-        String level = info.get(2).value;
-
-        si.sendDebug("1", level, thread, callBack);
+        SwankDebugInfo info =
+          si.getLispImplementation().getDebugInfo(debugInfo.result);
+        si.sendDebug("1", String.valueOf(info.level), info.thread, callBack);
       }
     };
     final SwankRunnable debugStop = new SwankRunnable(){