Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Reusable Analysis
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
Reusable Analysis
Commits
78f72227
Commit
78f72227
authored
5 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
add inner/outer test case from standard/compliance test library
parent
40d94718
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testprograms/modelica/ComplicatedNameLookup.mo
+73
-0
73 additions, 0 deletions
testprograms/modelica/ComplicatedNameLookup.mo
with
73 additions
and
0 deletions
testprograms/modelica/ComplicatedNameLookup.mo
0 → 100644
+
73
−
0
View file @
78f72227
within ModelicaCompliance.Scoping.InnerOuter;
model ComplicatedNameLookup
extends Icons.TestCase;
class A
outer Integer TI;
class B
Integer TI = 1;
class C
Integer TI = 2;
class D
outer Integer TI;
end D;
D d;
end C;
C c;
end B;
B b;
end A;
class E
inner Integer TI = 3;
class F
inner Integer TI = 4;
class G
Integer TI = 5;
class H
A a;
end H;
H h;
end G;
G g;
end F;
F f;
end E;
class I
inner Integer TI = 10;
E e;
// e.f.g.h.a.TI, e.f.g.h.a.b.c.d.TI, and e.f.TI is the same variable
// But e.f.TI, e.TI and TI are different variables
A a; // a.TI, a.b.c.d.TI, and TI is the same variable
end I;
I i;
equation
assert(i.TI == 10, "i.TI was not set correctly!");
assert(i.a.b.TI == 1, "i.a.b.TI was not set correctly!");
assert(i.a.b.c.TI == 2, "i.a.b.c.TI was not set correctly!");
assert(i.e.TI == 3, "i.e.TI was not set correctly!");
assert(i.e.f.TI == 4, "i.e.f.TI was not set correctly!");
assert(i.e.f.g.TI == 5, "i.e.f.g.TI was not set correctly!");
assert(i.e.f.g.h.a.b.TI == 1, "i.e.f.g.h.a.b.TI was not set correctly!");
assert(i.e.f.g.h.a.b.c.TI == 2, "i.e.f.g.h.a.b.c.TI was not set correctly!");
annotation (
__ModelicaAssociation(TestCase(shouldPass = true, section = {"5.4"})),
experiment(StopTime = 0.01),
Documentation(info = "
<html>
Checks that inner and outer have the same value. Shadowing of inner.
</html>
"));
end ComplicatedNameLookup;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment