Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
M
mjtest
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • IPDSnelting
  • mjtest
  • Issues
  • #8

Closed
Open
Opened Jan 25, 2019 by sebastian.graf@sgrafOwner

Generation of .java_output files spuriously fails

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?

Edited Jan 25, 2019 by sebastian.graf
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: IPDSnelting/mjtest#8