mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-18 17:34:43 -04:00
Merge branch 'master' into romManager
This commit is contained in:
commit
0674855221
@ -272,8 +272,11 @@ public class Splitter implements Element {
|
||||
if (pos >= 0) {
|
||||
int from = Integer.decode(strVal.substring(0, pos).trim());
|
||||
int to = Integer.decode(strVal.substring(pos + 1).trim());
|
||||
if (to < from)
|
||||
throw new BitsException(Lang.get("err_spitterDefSyntaxError", definition));
|
||||
if (to < from) {
|
||||
int z = to;
|
||||
to = from;
|
||||
from = z;
|
||||
}
|
||||
add(new Port(from, to - from + 1));
|
||||
} else
|
||||
add(new Port(bits, Integer.decode(strVal)));
|
||||
|
@ -50,7 +50,7 @@ public class MissingShape implements Shape {
|
||||
while (c != null) {
|
||||
y += style.getFontSize();
|
||||
String message = c.getMessage();
|
||||
if (message.length() > 100)
|
||||
if (message != null && message.length() > 100)
|
||||
message = message.substring(0, 100) + "...";
|
||||
graphic.drawText(new Vector(4, y), new Vector(5, y), message, Orientation.LEFTTOP, style);
|
||||
c = c.getCause();
|
||||
|
@ -89,13 +89,11 @@ public class PortsTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testInputConsistency3() throws Exception {
|
||||
Splitter.Ports p = new Splitter.Ports("4-7,4-4");
|
||||
try {
|
||||
p = new Splitter.Ports("4-7,4-3");
|
||||
fail();
|
||||
} catch (NodeException e) {
|
||||
assertTrue(true);
|
||||
}
|
||||
Splitter.Ports p = new Splitter.Ports("7-4,4-4");
|
||||
assertEquals(4, p.getPort(0).getPos());
|
||||
assertEquals(4, p.getPort(0).getBits());
|
||||
assertEquals(4, p.getPort(1).getPos());
|
||||
assertEquals(1, p.getPort(1).getBits());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user