Skip to content
Snippets Groups Projects
Commit 96c1c9b0 authored by Ben Franksen's avatar Ben Franksen
Browse files

test: added tests for option +p and -p

parent 8a247215
No related branches found
No related tags found
No related merge requests found
/*************************************************************************\
Copyright (c) 2014 Helmholtz-Zentrum Berlin f. Materialien
und Energie GmbH, Germany (HZB)
This file is distributed subject to a Software License Agreement found
in the file LICENSE that is included with this distribution.
\*************************************************************************/
program opt_p
option -p;
int a[1];
assign a to {};
ss test {
state test {
when () {
pvAssign(a,""); /* error: not allowed */
pvAssigned(a); /* error: not allowed */
pvConnected(a); /* error: not allowed */
pvCount(a); /* error: not allowed */
pvFlushQ(a); /* error: not allowed */
pvFreeQ(a); /* error: not allowed */
pvGet(a); /* error: not allowed */
pvGetCancel(a); /* ok: did not exist in 2.1 */
pvGetComplete(a); /* error: not allowed in compatibility mode (option -p) */
pvGetQ(a); /* error: not allowed */
pvIndex(a); /* error: not allowed */
pvMessage(a); /* error: not allowed */
pvMonitor(a); /* error: not allowed in compatibility mode (option -p) */
pvName(a); /* error: not allowed */
pvPut(a); /* error: not allowed */
pvPutCancel(a); /* ok: did not exist in 2.1 */
pvPutComplete(a); /* ok: was already allowed in 2.1 */
pvSeverity(a); /* error: not allowed */
pvStatus(a); /* error: not allowed */
pvStopMonitor(a); /* error: not allowed in compatibility mode (option -p) */
pvSync(a); /* error: not allowed in compatibility mode (option -p) */
pvTimeStamp(a); /* error: not allowed */
} exit
}
}
/*************************************************************************\
Copyright (c) 2014 Helmholtz-Zentrum Berlin f. Materialien
und Energie GmbH, Germany (HZB)
This file is distributed subject to a Software License Agreement found
in the file LICENSE that is included with this distribution.
\*************************************************************************/
program opt_p
option +p;
int a[1];
assign a to {};
ss test {
state test {
when () {
pvAssign(a,""); /* error: not allowed (even with +p) */
pvAssigned(a); /* error: not allowed (even with +p) */
pvConnected(a); /* error: not allowed (even with +p) */
pvCount(a); /* error: not allowed (even with +p) */
pvFlushQ(a); /* error: not allowed (even with +p) */
pvFreeQ(a); /* error: not allowed (even with +p) */
pvGet(a); /* error: not allowed (even with +p) */
pvGetCancel(a); /* ok: always allowed */
pvGetComplete(a); /* ok: allowed due to +p */
pvGetQ(a); /* error: not allowed (even with +p) */
pvIndex(a); /* error: not allowed (even with +p) */
pvMessage(a); /* error: not allowed (even with +p) */
pvMonitor(a); /* ok: allowed due to +p */
pvName(a); /* error: not allowed (even with +p) */
pvPut(a); /* error: not allowed (even with +p) */
pvPutCancel(a); /* ok: always allowed */
pvPutComplete(a); /* ok: always allowed */
pvSeverity(a); /* error: not allowed (even with +p) */
pvStatus(a); /* error: not allowed (even with +p) */
pvStopMonitor(a); /* ok: allowed due to +p */
pvSync(a); /* ok: allowed due to +p */
pvTimeStamp(a); /* error: not allowed (even with +p) */
} exit
}
}
...@@ -18,6 +18,8 @@ my $tests = { ...@@ -18,6 +18,8 @@ my $tests = {
misplacedExit => { warnings => 0, errors => 1 }, misplacedExit => { warnings => 0, errors => 1 },
namingConflict => { warnings => 0, errors => 0 }, namingConflict => { warnings => 0, errors => 0 },
nesting_depth => { warnings => 0, errors => 0 }, nesting_depth => { warnings => 0, errors => 0 },
opt_minus_p => { warnings => 0, errors => 19 },
opt_plus_p => { warnings => 0, errors => 15 },
pvNotAssigned => { warnings => 0, errors => 20 }, pvNotAssigned => { warnings => 0, errors => 20 },
reservedId => { warnings => 0, errors => 2 }, reservedId => { warnings => 0, errors => 2 },
state_not_reachable => { warnings => 3, errors => 0 }, state_not_reachable => { warnings => 3, errors => 0 },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment