Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
181 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
// name: CopyClass | ||
// keywords: copyClass | ||
// status: correct | ||
// | ||
// Tests the copyClass API. | ||
// | ||
|
||
loadFile("TestFilePkg.mo"); | ||
getErrorString(); | ||
loadFile("TestDirPkg/package.mo"); | ||
getErrorString(); | ||
|
||
// Top file package to top. | ||
copyClass(TestFilePkg, "TestFilePkgcopy"); | ||
getClassInformation(TestFilePkgcopy); | ||
|
||
// Top dir package to top. | ||
copyClass(TestDirPkg, "TestDirPkgcopy"); | ||
getClassInformation(TestDirPkgcopy); | ||
|
||
// Class in top file package to top. | ||
copyClass(TestFilePkg.A, "Acopy"); | ||
getClassInformation(Acopy); | ||
|
||
// Class in top dir package to top. | ||
copyClass(TestDirPkg.B, "Bcopy"); | ||
getClassInformation(Bcopy); | ||
|
||
// Package in nested file package to top. | ||
copyClass(TestDirPkg.M1, "M1copy"); | ||
getClassInformation(M1copy); | ||
|
||
// Package in nested dir package to top. | ||
copyClass(TestDirPkg.SubDirPkg, "SubDirPkgcopy"); | ||
getClassInformation(SubDirPkgcopy); | ||
|
||
// Class in nested file package to top. | ||
copyClass(TestDirPkg.SubFilePkg.SFPA, "SFPAcopy"); | ||
getClassInformation(SFPAcopy); | ||
|
||
// Class in nested dir package to top. | ||
copyClass(TestDirPkg.SubDirPkg.SDPA, "SDPAcopy"); | ||
getClassInformation(SDPAcopy); | ||
|
||
// Top file package to within. | ||
copyClass(TestFilePkg, "TestFilePkgcopy", TestDirPkg); | ||
getClassInformation(TestDirPkg.TestFilePkgcopy); | ||
|
||
// Top dir package to within. | ||
copyClass(TestDirPkg, "TestDirPkgcopy", TestDirPkg); | ||
getClassInformation(TestDirPkg.TestDirPkgcopy); | ||
|
||
// Class in top file package to within. | ||
copyClass(TestFilePkg.A, "Acopy", TestDirPkg); | ||
getClassInformation(TestDirPkg.Acopy); | ||
|
||
// Class in top dir package to within. | ||
copyClass(TestDirPkg.A, "Acopy", TestDirPkg.SubDirPkg); | ||
getClassInformation(TestDirPkg.SubDirPkg.Acopy); | ||
|
||
// Nested file package to same scope. | ||
copyClass(TestDirPkg.SubFilePkg, "SubFilePkgcopy", TestDirPkg); | ||
getClassInformation(TestDirPkg.SubFilePkgcopy); | ||
|
||
// Nested dir package to same scope. | ||
copyClass(TestDirPkg.SubDirPkg, "SubDirPkgcopy", TestDirPkg); | ||
getClassInformation(TestDirPkg.SubDirPkgcopy); | ||
|
||
// Nested file package to different scope. | ||
copyClass(TestDirPkg.SubFilePkg, "SubFilePkgcopy", TestDirPkg.SubDirPkg); | ||
getClassInformation(TestDirPkg.SubDirPkg.SubFilePkgcopy); | ||
|
||
// Nested dir package to different scope. | ||
copyClass(TestDirPkg.SubDirPkg, "SubDirPkgcopy", TestDirPkg.SubFilePkg); | ||
getClassInformation(TestDirPkg.SubFilePkg.SubDirPkgcopy); | ||
|
||
// Nested class in file package to same scope. | ||
copyClass(TestDirPkg.SubFilePkg.SFPA, "SFPAcopy", TestDirPkg.SubFilePkg); | ||
getClassInformation(TestDirPkg.SubFilePkg.SFPAcopy); | ||
|
||
// Nested class in dir package to same scope. | ||
copyClass(TestDirPkg.SubDirPkg.SDPA, "SDPAcopy", TestDirPkg.SubDirPkg); | ||
getClassInformation(TestDirPkg.SubDirPkg.SDPAcopy); | ||
|
||
// Nested class in file package to different scope. | ||
copyClass(TestDirPkg.SubFilePkg.SFPA, "SFPAcopy", TestDirPkg.SubDirPkg); | ||
getClassInformation(TestDirPkg.SubDirPkg.SFPAcopy); | ||
|
||
// Nested class in dir package to different scope. | ||
copyClass(TestDirPkg.SubDirPkg.SDPA, "SDPAcopy", TestDirPkg.SubFilePkg); | ||
getClassInformation(TestDirPkg.SubFilePkg.SDPAcopy); | ||
|
||
// Result: | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/TestFilePkgcopy.mo",false,1,1,11,16,{},false,false) | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/TestDirPkgcopy/package.mo",false,1,1,11,15,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/Acopy.mo",false,8,3,10,8,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/Bcopy.mo",false,7,3,10,8,{},false,false) | ||
// true | ||
// ("model","",false,false,false,"openmodelica/interactive-API/M1copy.mo",false,3,1,6,7,{},false,false) | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/SubDirPkgcopy/package.mo",false,3,1,7,14,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/SFPAcopy.mo",false,4,3,6,11,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/SDPAcopy.mo",false,4,3,6,11,{},false,false) | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/TestDirPkg/TestFilePkgcopy.mo",false,1,1,11,16,{},false,false) | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/TestDirPkg/TestDirPkgcopy/package.mo",false,1,1,11,15,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/TestDirPkg/Acopy.mo",false,8,3,10,8,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubDirPkg/Acopy.mo",false,2,3,5,8,{},false,false) | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubFilePkgcopy.mo",false,3,1,7,15,{},false,false) | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubDirPkgcopy/package.mo",false,3,1,7,14,{},false,false) | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubDirPkg/SubFilePkgcopy.mo",false,3,1,7,15,{},false,false) | ||
// true | ||
// ("package","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubFilePkg/SubDirPkgcopy/package.mo",false,3,1,7,14,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubFilePkg.mo",false,4,3,6,11,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubDirPkg/package.mo",false,4,3,6,11,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubDirPkg/SFPAcopy.mo",false,4,3,6,11,{},false,false) | ||
// true | ||
// ("class","",false,false,false,"openmodelica/interactive-API/TestDirPkg/SubFilePkg/SDPAcopy.mo",false,4,3,6,11,{},false,false) | ||
// 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
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,6 @@ | ||
within TestDirPkg; | ||
|
||
model M1 | ||
model MM1 | ||
end MM1; | ||
end M1; |
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,7 @@ | ||
within TestDirPkg; | ||
|
||
package SubDirPkg | ||
class SDPA | ||
class SSDPA end SSDPA; | ||
end SDPA; | ||
end SubDirPkg; |
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,7 @@ | ||
within TestDirPkg; | ||
|
||
package SubFilePkg | ||
class SFPA | ||
class SSFPA end SSFPA; | ||
end SFPA; | ||
end SubFilePkg; |
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,11 @@ | ||
package TestDirPkg | ||
class A | ||
class AA | ||
end AA; | ||
end A; | ||
|
||
class B | ||
class BB | ||
end BB; | ||
end B; | ||
end TestDirPkg; |
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,11 @@ | ||
package TestFilePkg | ||
package SubPkg | ||
class SA | ||
class SSA end SSA; | ||
end SA; | ||
end SubPkg; | ||
|
||
class A | ||
class AA end AA; | ||
end A; | ||
end TestFilePkg; |
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