Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the package follows a Modelica version naming convention just strip the version string and use the package name.
- Loading branch information
Showing
11 changed files
with
101 additions
and
7 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
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,63 @@ | ||
// name: ReadOnlyPkg.mos | ||
// keywords: Tests the export and import of read only packages i.e, package.mol | ||
// status: correct | ||
// teardown_command: rm -rf buildEncryptedPackage.log "ReadOnlyPkg 1.1.mol" | ||
// | ||
|
||
loadFile("ReadOnlyPkg/package.mo"); | ||
getErrorString(); | ||
getClassNames(); | ||
getErrorString(); | ||
|
||
buildEncryptedPackage(ReadOnlyPkg, false); | ||
getErrorString(); | ||
deleteClass(ReadOnlyPkg); | ||
getErrorString(); | ||
|
||
parseEncryptedPackage("ReadOnlyPkg.mol"); | ||
getErrorString(); | ||
loadEncryptedPackage("ReadOnlyPkg.mol"); | ||
getErrorString(); | ||
getClassNames(); | ||
getErrorString(); | ||
deleteClass(ReadOnlyPkg); | ||
getErrorString(); | ||
|
||
// create a versioned package | ||
system("mv \"ReadOnlyPkg.mol\" \"ReadOnlyPkg 1.1.mol\""); | ||
getErrorString(); | ||
|
||
// load a versioned package | ||
parseEncryptedPackage("ReadOnlyPkg 1.1.mol"); | ||
getErrorString(); | ||
loadEncryptedPackage("ReadOnlyPkg 1.1.mol"); | ||
getErrorString(); | ||
getClassNames(); | ||
getErrorString(); | ||
|
||
// Result: | ||
// true | ||
// "" | ||
// {ReadOnlyPkg} | ||
// "" | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// {ReadOnlyPkg} | ||
// "" | ||
// true | ||
// "" | ||
// {ReadOnlyPkg} | ||
// "" | ||
// true | ||
// "" | ||
// 0 | ||
// "" | ||
// {ReadOnlyPkg} | ||
// "" | ||
// true | ||
// "" | ||
// {ReadOnlyPkg} | ||
// "" | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
within ReadOnlyPkg; | ||
|
||
model M | ||
equation | ||
|
||
end M; |
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 ReadOnlyPkg.P1; | ||
|
||
model M1 | ||
equation | ||
|
||
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,6 @@ | ||
within ReadOnlyPkg.P1; | ||
|
||
model M2 | ||
equation | ||
|
||
end M2; |
4 changes: 4 additions & 0 deletions
4
testsuite/openmodelica/interactive-API/ReadOnlyPkg/P1/package.mo
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,4 @@ | ||
within ReadOnlyPkg; | ||
|
||
package P1 | ||
end P1; |
2 changes: 2 additions & 0 deletions
2
testsuite/openmodelica/interactive-API/ReadOnlyPkg/P1/package.order
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,2 @@ | ||
M1 | ||
M2 |
2 changes: 2 additions & 0 deletions
2
testsuite/openmodelica/interactive-API/ReadOnlyPkg/package.mo
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,2 @@ | ||
package ReadOnlyPkg | ||
end ReadOnlyPkg; |
2 changes: 2 additions & 0 deletions
2
testsuite/openmodelica/interactive-API/ReadOnlyPkg/package.order
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,2 @@ | ||
M | ||
P1 |