| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,36 @@ | |||
| 1 | + import processing.core.*; | ||
| 2 | + import processing.xml.*; | ||
| 3 | + | ||
| 4 | + import java.applet.*; | ||
| 5 | + import java.awt.Dimension; | ||
| 6 | + import java.awt.Frame; | ||
| 7 | + import java.awt.event.MouseEvent; | ||
| 8 | + import java.awt.event.KeyEvent; | ||
| 9 | + import java.awt.event.FocusEvent; | ||
| 10 | + import java.awt.Image; | ||
| 11 | + import java.io.*; | ||
| 12 | + import java.net.*; | ||
| 13 | + import java.text.*; | ||
| 14 | + import java.util.*; | ||
| 15 | + import java.util.zip.*; | ||
| 16 | + import java.util.regex.*; | ||
| 17 | + | ||
| 18 | + public class bug136 extends PApplet { | ||
| 19 | + | ||
| 20 | + java.util.List alist = Collections.synchronizedList(new ArrayList()); | ||
| 21 | + | ||
| 22 | + public void setup() { | ||
| 23 | + size(400, 200); | ||
| 24 | + alist.add("hello"); | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public void draw() { | ||
| 28 | + rect(width/4, height/4, width/2, height/2); | ||
| 29 | + synchronized(alist) { | ||
| 30 | + alist.get(0); | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + static public void main(String args[]) { | ||
| 34 | + PApplet.main(new String[] { "--bgcolor=null", "bug136" }); | ||
| 35 | + } | ||
| 36 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,13 @@ | |||
| 1 | + java.util.List alist = Collections.synchronizedList(new ArrayList()); | ||
| 2 | + | ||
| 3 | + void setup() { | ||
| 4 | + size(400, 200); | ||
| 5 | + alist.add("hello"); | ||
| 6 | + } | ||
| 7 | + | ||
| 8 | + void draw() { | ||
| 9 | + rect(width/4, height/4, width/2, height/2); | ||
| 10 | + synchronized(alist) { | ||
| 11 | + alist.get(0); | ||
| 12 | + } | ||
| 13 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,9 @@ | |||
| 1 | + println("Here comes an unterminated comment!") | ||
| 2 | + | ||
| 3 | + /* | ||
| 4 | + banana | ||
| 5 | + apple | ||
| 6 | + pear | ||
| 7 | + * / | ||
| 8 | + | ||
| 9 | + println("Do you see what I did there?") | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + int a; | ||
| 2 | + void setup() | ||
| 3 | + { | ||
| 4 | + a = #FF000; | ||
| 5 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,27 @@ | |||
| 1 | + import processing.core.*; | ||
| 2 | + import processing.xml.*; | ||
| 3 | + | ||
| 4 | + import java.applet.*; | ||
| 5 | + import java.awt.Dimension; | ||
| 6 | + import java.awt.Frame; | ||
| 7 | + import java.awt.event.MouseEvent; | ||
| 8 | + import java.awt.event.KeyEvent; | ||
| 9 | + import java.awt.event.FocusEvent; | ||
| 10 | + import java.awt.Image; | ||
| 11 | + import java.io.*; | ||
| 12 | + import java.net.*; | ||
| 13 | + import java.text.*; | ||
| 14 | + import java.util.*; | ||
| 15 | + import java.util.zip.*; | ||
| 16 | + import java.util.regex.*; | ||
| 17 | + | ||
| 18 | + public class bug4 extends PApplet { | ||
| 19 | + public void setup() { | ||
| 20 | + int x = 12; | ||
| 21 | + float u = (PApplet.parseFloat(x)/width); | ||
| 22 | + noLoop(); | ||
| 23 | + } | ||
| 24 | + static public void main(String args[]) { | ||
| 25 | + PApplet.main(new String[] { "--bgcolor=null", "bug4" }); | ||
| 26 | + } | ||
| 27 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + int x = 12; | ||
| 2 | + float u = (float(x)/width); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,9 +78,27 @@ static void expectRecognitionException(final String id, | |||
| 78 | 78 | assertEquals(expectedLine, e.getLine()); | |
| 79 | 79 | } catch (Exception e) { | |
| 80 | 80 | if (!e.equals(e.getCause()) && e.getCause() != null) | |
| 81 | - fail(e.getCause().getMessage()); | ||
| 81 | + fail(e.getCause().toString()); | ||
| 82 | 82 | else | |
| 83 | - fail(e.getMessage()); | ||
| 83 | + fail(e.toString()); | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + static void expectRunnerException(final String id, | ||
| 88 | + final String expectedMessage, | ||
| 89 | + final int expectedLine) { | ||
| 90 | + try { | ||
| 91 | + preprocess(id, res(id + ".pde")); | ||
| 92 | + fail("Expected to fail with \"" + expectedMessage + "\" on line " | ||
| 93 | + + expectedLine); | ||
| 94 | + } catch (RunnerException e) { | ||
| 95 | + assertEquals(expectedMessage, e.getMessage()); | ||
| 96 | + assertEquals(expectedLine, e.getCodeLine()); | ||
| 97 | + } catch (Exception e) { | ||
| 98 | + if (!e.equals(e.getCause()) && e.getCause() != null) | ||
| 99 | + fail(e.getCause().toString()); | ||
| 100 | + else | ||
| 101 | + fail(e.toString()); | ||
| 84 | 102 | } | |
| 85 | 103 | } | |
| 86 | 104 | ||
@@ -108,12 +126,17 @@ static void expectGood(final String id) { | |||
| 108 | 126 | ||
| 109 | 127 | } catch (Exception e) { | |
| 110 | 128 | if (!e.equals(e.getCause()) && e.getCause() != null) | |
| 111 | - fail(e.getCause().getMessage()); | ||
| 129 | + fail(e.getCause().toString()); | ||
| 112 | 130 | else | |
| 113 | - fail(e.getMessage()); | ||
| 131 | + fail(e.toString()); | ||
| 114 | 132 | } | |
| 115 | 133 | } | |
| 116 | 134 | ||
| 135 | + @Test | ||
| 136 | + public void bug4() { | ||
| 137 | + expectGood("bug4"); | ||
| 138 | + } | ||
| 139 | + | ||
| 117 | 140 | @Test | |
| 118 | 141 | public void bug5a() { | |
| 119 | 142 | expectGood("bug5a"); | |
@@ -124,6 +147,22 @@ public void bug5b() { | |||
| 124 | 147 | expectGood("bug5b"); | |
| 125 | 148 | } | |
| 126 | 149 | ||
| 150 | + @Test | ||
| 151 | + public void bug16() { | ||
| 152 | + expectRunnerException("bug16", "Unclosed /* comment */", 2); | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + @Test | ||
| 156 | + public void bug136() { | ||
| 157 | + expectGood("bug136"); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + @Test | ||
| 161 | + public void bug196() { | ||
| 162 | + expectRecognitionException("bug196", | ||
| 163 | + "Web colors must be exactly 6 hex digits. This looks like 5.", 4); | ||
| 164 | + } | ||
| 165 | + | ||
| 127 | 166 | @Test | |
| 128 | 167 | public void bug1511() { | |
| 129 | 168 | expectGood("bug1511"); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments