Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit a69a410

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Add external object connection test.
Belonging to [master]: - OpenModelica/OMCompiler#3013 - #1153
1 parent 0184306 commit a69a410

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// name: ConnectExternalObject1
2+
// keywords:
3+
// status: correct
4+
// cflags: -d=newInst
5+
//
6+
//
7+
8+
class ExtObj
9+
extends ExternalObject;
10+
11+
function constructor
12+
output ExtObj obj;
13+
external "C" obj = initObject();
14+
end constructor;
15+
16+
function destructor
17+
input ExtObj obj;
18+
external "C" destroyObject(obj);
19+
end destructor;
20+
end ExtObj;
21+
22+
connector C
23+
ExtObj eo;
24+
end C;
25+
26+
model ConnectExternalObject1
27+
C c1, c2;
28+
equation
29+
connect(c1, c2);
30+
end ConnectExternalObject1;
31+
32+
// Result:
33+
// function ExtObj.constructor
34+
// output ExtObj obj;
35+
//
36+
// external "C" obj = initObject();
37+
// end ExtObj.constructor;
38+
//
39+
// function ExtObj.destructor
40+
// input ExtObj obj;
41+
//
42+
// external "C" destroyObject(obj);
43+
// end ExtObj.destructor;
44+
//
45+
// class ConnectExternalObject1
46+
// ExtObj c1.eo;
47+
// ExtObj c2.eo;
48+
// equation
49+
// c1.eo = c2.eo;
50+
// end ConnectExternalObject1;
51+
// endResult

flattening/modelica/scodeinst/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ ConnectComplex1.mo \
219219
ConnectComplexFlow1.mo \
220220
ConnectDiffOrder1.mo \
221221
ConnectDiffOrder2.mo \
222+
ConnectExternalObject1.mo \
222223
ConnectInitial.mo \
223224
ConnectInvalidForm1.mo \
224225
ConnectInvalidType1.mo \

0 commit comments

Comments
 (0)