Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sequencer-2-2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
epics-modules
sequencer-2-2
Commits
a1ae7f50
Commit
a1ae7f50
authored
11 years ago
by
benjamin.franksen
Browse files
Options
Downloads
Patches
Plain Diff
added validation test for access to variables of foreign types
parent
4e9c9ddb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/validate/Makefile
+1
-0
1 addition, 0 deletions
test/validate/Makefile
test/validate/foreignTypes.st
+74
-0
74 additions, 0 deletions
test/validate/foreignTypes.st
with
75 additions
and
0 deletions
test/validate/Makefile
+
1
−
0
View file @
a1ae7f50
...
...
@@ -43,6 +43,7 @@ REGRESSION_TESTS_WITHOUT_DB += array
REGRESSION_TESTS_WITHOUT_DB
+=
assign
REGRESSION_TESTS_WITHOUT_DB
+=
change
REGRESSION_TESTS_WITHOUT_DB
+=
commaOperator
REGRESSION_TESTS_WITHOUT_DB
+=
foreignTypes
REGRESSION_TESTS_WITHOUT_DB
+=
local
REGRESSION_TESTS_WITHOUT_DB
+=
opttVar
REGRESSION_TESTS_WITHOUT_DB
+=
pvSync
...
...
This diff is collapsed.
Click to expand it.
test/validate/foreignTypes.st
0 → 100644
+
74
−
0
View file @
a1ae7f50
program
foreignTypesTest
%%
#include
"../testSupport.h"
/*
option
+
r
;
*/
%%
struct
struct_t
{
int
i
;
struct
{
double
d
;
}
s
;
};
%%
union
union_t
{
int
i
;
struct
struct_t
*
p
;
};
%%
enum
enum_t
{
zero
,
one
,
two
};
%%
typedef
short
typedef_t
;
foreign
zero,
one
,
two
;
struct
struct_t
s
=
{
1
,
{
0.1
}};
union
union_t
u
=
{
13
};
enum
enum_t
e
=
one
;
typename
typedef_t
t
=
42
;
entry
{
seq_test_init
(
24
);
}
ss
simple
{
state
simple
{
when
()
{
struct
struct_t
*
ps
=
&
s
;
union
union_t
*
pu
=
&
u
;
enum
enum_t
*
pe
=
&
e
;
typename
typedef_t
*
pt
=
&
t
;
testOk1
(
s
.
i
==
1
);
testOk1
(
s
.
s
.
d
==
0.1
);
testOk1
(
u
.
i
==
13
);
u
.
p
=
ps
;
testOk1
(
u
.
p
==
ps
);
testOk1
(
u
.
p
->
i
==
1
);
testOk1
(
u
.
p
->
s
.
d
==
0.1
);
u
.
i
=
13
;
/*
restore
*/
testOk1
(
e
==
one
);
testOk1
(
t
==
42
);
testOk1
(
ps
->
i
==
1
);
testOk1
(
ps
->
s
.
d
==
0.1
);
testOk1
(
pu
->
i
==
13
);
pu->
p
=
ps
;
testOk1
(
pu
->
p
==
ps
);
testOk1
(
pu
->
p
->
i
==
1
);
testOk1
(
pu
->
p
->
s
.
d
==
0.1
);
pu->
i
=
13
;
/*
restore
*/
testOk1
(
*
pe
==
one
);
testOk1
(
*
pt
==
42
);
ps->
i
++
;
ps
->
s
.
d
/=
3.0
;
pu->
i
--
;
*
pe
=
two
;
*
pt
%=
10
;
testOk1
(
ps
->
i
==
2
);
testOk1
(
ps
->
s
.
d
==
0.1
/
3.0
);
testOk1
(
pu
->
i
==
12
);
pu->
p
=
ps
;
testOk1
(
pu
->
p
==
ps
);
testOk1
(
pu
->
p
->
i
==
2
);
testOk1
(
pu
->
p
->
s
.
d
==
0.1
/
3.0
);
testOk1
(
*
pe
==
two
);
testOk1
(
*
pt
==
2
);
}
exit
}
}
exit
{
seq_test_done
();
}
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