Opened 7 years ago

Closed 3 years ago

#4142 closed defect (fixed)

OMC does not detect as error the use of noEvent clause in a When structure

Reported by: Andrea.Bartolini Owned by: somebody
Priority: high Milestone: 1.17.0
Component: New Instantiation Version: v1.11.0
Keywords: Cc:

Description (last modified by Andrea.Bartolini)

Consider the following model:

model TestNoEvent
  discrete Real x1,x2;
  Real y;
algorithm
  when time>2 then
    x1 := time;
  end when;
  when noEvent(time>2) then  // this is an error !!!
    x2 := time;
  end when;
equation
    y=x1+x2;
end TestNoEvent;

When the model is checked (e.g. in OMedit) no error is detected nor any warning is shown, the model passes the test, as reported in attached file CheckModel.png.

Simulating the model, the simulation ends without errors and the "when" structure with the noEvent clause does not trigger the condition "time>2", as shown in attached file Result.png.

The expected behavior should be the detection of the "noEvent" clause in the "when" structure as an error, and consequently the model check failure.

Simulation of model should end with an error.

Omc version: OpenModelica 1.11.0~dev-428-ge629542
Sysop: Linux Ubuntu 14.04

Attachments (2)

CheckModel.png (18.9 KB) - added by Andrea.Bartolini 7 years ago.
Results.png (11.9 KB) - added by Andrea.Bartolini 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Andrea.Bartolini

Changed 7 years ago by Andrea.Bartolini

comment:1 Changed 7 years ago by Andrea.Bartolini

  • Description modified (diff)

comment:2 Changed 7 years ago by Andrea.Bartolini

  • Version set to v1.11.0-dev-nightly

comment:3 Changed 3 years ago by perost

  • Component changed from *unknown* to New Instantiation
  • Milestone changed from Future to 1.17.0
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in f877fea and 0d36d06.

Note: See TracTickets for help on using tickets.