Ignore:
Timestamp:
Oct 29, 2019 1:28:58 PM (7 weeks ago)
Author:
molsson
Message:

#5843 Moved type checking of conditional attributes so that it is always done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-mo-2617/Compiler/ModelicaFrontEnd/test/modelica/NameTests.mo

    r13456 r13898  
    31473147            flatModel="
    31483148fclass NameTests.ConditionalComponentTest8
    3149  parameter Boolean b = false /* false */;
     3149 structural parameter Boolean b = false /* false */;
    31503150
    31513151end NameTests.ConditionalComponentTest8;
     
    31783178            flatModel="
    31793179fclass NameTests.ConditionalComponentTest9
    3180  parameter Boolean b = false /* false */;
     3180 structural parameter Boolean b = false /* false */;
    31813181
    31823182end NameTests.ConditionalComponentTest9;
     
    33803380")})));
    33813381end ConditionalComponentTest14;
     3382
     3383
     3384model ConditionalComponentTest15_Err
     3385    connector C
     3386        Real x;
     3387    end C;
     3388   
     3389    parameter Integer b[2] = {1,1};
     3390    C c if b;
     3391annotation(__JModelica(UnitTesting(tests={
     3392    ErrorTestCase(
     3393        description="Test of type checking of conditional composite component.",
     3394        errorMessage="
     33952 errors found:
     3396
     3397Error at line 7, column 5, in file 'Compiler/ModelicaFrontEnd/test/modelica/NameTests.mo', NON_BOOLEAN_CONDITIONAL_GUARD:
     3398  The guard expression of a conditional component should be a boolean expression
     3399
     3400Error at line 7, column 5, in file 'Compiler/ModelicaFrontEnd/test/modelica/NameTests.mo', NON_SCALAR_CONDITIONAL_GUARD:
     3401  The guard expression of a conditional component should be a scalar expression
     3402")})));
     3403end ConditionalComponentTest15_Err;
     3404
     3405
     3406model ConditionalComponentTest16
     3407    connector C
     3408        Real x;
     3409    end C;
     3410   
     3411    parameter Boolean b = false;
     3412    C c if b;
     3413annotation(__JModelica(UnitTesting(tests={
     3414    FlatteningTestCase(
     3415        description="Flattening conditional composite component",
     3416        flatModel="
     3417fclass NameTests.ConditionalComponentTest16
     3418 structural parameter Boolean b = false /* false */;
     3419end NameTests.ConditionalComponentTest16;
     3420")})));
     3421end ConditionalComponentTest16;
     3422
     3423
     3424model ConditionalComponentTest17
     3425    connector C
     3426        Real x;
     3427    end C;
     3428   
     3429    parameter Boolean b = true;
     3430    C c if b;
     3431annotation(__JModelica(UnitTesting(tests={
     3432    FlatteningTestCase(
     3433        description="Flattening conditional composite component",
     3434        flatModel="
     3435fclass NameTests.ConditionalComponentTest17
     3436 structural parameter Boolean b = true /* true */;
     3437 potential Real c.x;
     3438end NameTests.ConditionalComponentTest17;
     3439")})));
     3440end ConditionalComponentTest17;
     3441
     3442
    33823443
    33833444model AttributeDot1
Note: See TracChangeset for help on using the changeset viewer.