mjtest issueshttps://git.scc.kit.edu/IPDSnelting/mjtest/-/issues2021-11-30T14:02:20+01:00https://git.scc.kit.edu/IPDSnelting/mjtest/-/issues/10Integrate CReduce directly2021-11-30T14:02:20+01:00johannes.bechbergerjohannes.bechberger@kit.eduIntegrate CReduce directlyIntegrate [CReduce](https://embed.cs.utah.edu/creduce/), so that we have a flag `--reduce` (with optional time out argument) that tells mjtest to reduce the failing test cases and output them.
The reduction takes some time, but would pr...Integrate [CReduce](https://embed.cs.utah.edu/creduce/), so that we have a flag `--reduce` (with optional time out argument) that tells mjtest to reduce the failing test cases and output them.
The reduction takes some time, but would probably reduce the bug finding effort.https://git.scc.kit.edu/IPDSnelting/mjtest/-/issues/8Generation of .java_output files spuriously fails2019-01-27T11:23:40+01:00rp1446Generation of .java_output files spuriously failsThere are very simple `.java` tests that nondeterministically either
- Fail to produce a non-empty `.out` reference file
```
class HitboxTest {
public static void main(String[] args) {
Position p = new Position();
...There are very simple `.java` tests that nondeterministically either
- Fail to produce a non-empty `.out` reference file
```
class HitboxTest {
public static void main(String[] args) {
Position p = new Position();
p.x = 100;
p.y = 50;
Hitbox b = new Hitbox();
b.x = 160;
b.y = 90;
b.w = 30;
b.h = 20;
while (!b.contains(p)) {
p.move(2, 1);
}
System.out.println(p.x);
System.out.println(p.y);
}
}
class Position {
public int x;
public int y;
public void move(int xstep, int ystep) {
x = x + xstep;
y = y + ystep;
}
}
class Hitbox {
public int x;
public int y;
public int w;
public int h;
public boolean contains(Position p) {
return p.x >= x && p.x <= x + w && p.y >= y && p.y <= y + h;
}
}
```
- Have strange `javac` compile errors:
```
[FAIL ] compile:transitive_object_chain.java invalid java code, but output file missing
Report for failing test case transitive_object_chain.java
Invalid java code, but output file missing
Error code: 1
Javac error message:
[0001] transitive_object_chain.java:8: error: non-static variable out cannot be referenced from a static context
[0002] System.out.println(a.ref.ref.n);
[0003] ^
[0004] transitive_object_chain.java:8: error: method println in class System cannot be applied to given types;
[0005] System.out.println(a.ref.ref.n);
[0006] ^
[0007] required: no arguments
[0008] found: int
[0009] reason: actual and formal argument lists differ in length
[0010] 2 errors
[0011]
Source file:
[0001] class transitive_object_chain {
[0002] public static void main(String[] args) {
[0003] A_2 a = new A_2();
[0004] A_2 b = new A_2();
[0005] a.ref = b;
[0006] b.ref = a;
[0007] a.n = 5;
[0008] System.out.println(a.ref.ref.n);
[0009] }
[0010] }
[0011]
[0012] class A_2 {
[0013] public A_2 ref;
[0014] public int n;
[0015] }
[0016]
```
You can (hopefully) reproduce this by doing a `git clean -fxd` in the `tests` repository, followed by re-running `mjtest`.
Johannes (@uqddy), maybe you suspect something?uqddyuqddy