Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve OF and NF checkModel (#8473)
- Consider ExternalObject to have size 0 in both the OF and the NF checkModel implementations. - Implement proper counting of tuples in the NF checkModel. - Work around MetaModelica bug when counting size of complex types in the NF checkModel.
- Loading branch information
Showing
4 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
testsuite/flattening/modelica/external-objects/ExternalObjectSize1.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// name: ExternalObjectSize1 | ||
// keywords: external object | ||
// cflags: -d=newInst | ||
// status: correct | ||
// | ||
// description: External object in extended class | ||
|
||
loadString(" | ||
class EO | ||
extends ExternalObject; | ||
|
||
function constructor | ||
output EO e; | ||
external \"C\" e = init(); | ||
end constructor; | ||
|
||
function destructor | ||
input EO e; | ||
external \"C\" deinit(e); | ||
end destructor; | ||
end EO; | ||
|
||
model M | ||
EO e1 = EO(); | ||
EO e2[1] = {e1}; | ||
end M; | ||
"); | ||
|
||
checkModel(M); | ||
|
||
// Result: | ||
// true | ||
// "Check of M completed successfully. | ||
// Class M has 0 equation(s) and 0 variable(s). | ||
// 0 of these are trivial equation(s)." | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters