From d18524c957aecf827157208adf8278af39339cbd Mon Sep 17 00:00:00 2001 From: jestin Date: Wed, 5 Jun 2002 16:21:56 +0000 Subject: Looking for bugs. --- tests/Bug.java | 36 ++++++++++++++++++++++++++++++++++++ tests/BugTok.java | 38 ++++++++++++++++++++++++++++++++++++++ tests/Makefile | 8 ++++---- 3 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 tests/Bug.java create mode 100644 tests/BugTok.java (limited to 'tests') diff --git a/tests/Bug.java b/tests/Bug.java new file mode 100644 index 0000000..706d951 --- /dev/null +++ b/tests/Bug.java @@ -0,0 +1,36 @@ +import fr.dgac.ivy.* ; + +class Bug implements IvyApplicationListener { + + private Ivy bus; + + Bug() { + bus = new Ivy("Bug","Hello le monde",this); + try { + bus.start(null); + } catch (IvyException ie) { + System.err.println("can't run the Ivy bus" + ie.getMessage()); + } + } + + public void disconnect(IvyClient client) { } + + public void directMessage(IvyClient client,int id,String msgarg) {} + + public void connect(IvyClient client) { + System.out.println("sending messages"); + bus.sendMsg("coucou"); + bus.sendMsg("titi"); + bus.sendMsg("tata"); + bus.sendMsg("toto"); + System.out.println("done"); + } + + public void die(IvyClient client,int id) { + System.out.println("argh. cya"); + } + + public static void main(String args[]) { + new Bug(); + } +} diff --git a/tests/BugTok.java b/tests/BugTok.java new file mode 100644 index 0000000..c5bc445 --- /dev/null +++ b/tests/BugTok.java @@ -0,0 +1,38 @@ +import java.util.Vector ; +class BugTok { + + public static String[] decoupe(String s,String sep) { + int index=0, last=0, length=s.length(); + Vector v = new Vector(); + if (length!=0) while (true) { + index=s.indexOf(sep,last); + if (index==-1) { + v.add(s.substring(last,length)); + break; + } else if (index