Commit ca6ccd36 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Update test cases

the Ada backend now exports C symbols with _PI_ to be compatible with TASTE
parent aa4c17e9
......@@ -2,8 +2,8 @@
#include <stdio.h>
/* Ada code external interface */
extern void challenge_run();
extern void challenge_any_one();
extern void challenge_PI_run();
extern void challenge_PI_any_one();
extern int adainit();
//extern long long l_result;
......@@ -17,11 +17,11 @@ void challenge_RI_pow(long long *a, long long *b, long long *res)
int main()
{
adainit();
challenge_run();
challenge_run();
challenge_PI_run();
challenge_PI_run();
//printf("Internal state: %lld\n", l_result);
challenge_any_one();
challenge_run();
challenge_PI_any_one();
challenge_PI_run();
return 0;
}
......
......@@ -2,8 +2,8 @@
#include <stdio.h>
/* Ada code external interface */
extern void challenge_run();
extern void challenge_any_one();
extern void challenge_PI_run();
extern void challenge_PI_any_one();
extern int adainit();
//extern long long l_result;
......@@ -17,11 +17,11 @@ void challenge_RI_pow(long long *a, long long *b, long long *res)
int main()
{
adainit();
challenge_run();
challenge_run();
challenge_PI_run();
challenge_PI_run();
//printf("Internal state: %lld\n", l_result);
challenge_any_one();
challenge_run();
challenge_PI_any_one();
challenge_PI_run();
return 0;
}
......
......@@ -28,7 +28,7 @@ Type2 ::= BOOLEAN
Toto ::= SEQUENCE { elem-1 Type1, elem-2 Type2 }
SeqBool ::= SEQUENCE(SIZE(1..5)) OF BOOLEAN
Enum ::= ENUMERATED {enum1}
Enum-T ::= ENUMERATED {enum1}
default-seqof SeqOf ::= {4,7,9}
default-str My-OctStr ::= 'DEADBEEF'H
......
......@@ -3,7 +3,7 @@
#include "dataview-uniq.h"
extern void adainit();
extern void controlflow_run();
extern void controlflow_PI_run();
void controlflow_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
if (!*res) {
......@@ -19,6 +19,6 @@ void controlflow_RI_fail(asn1SccCharString *msg) {
int main() {
adainit();
controlflow_run();
controlflow_PI_run();
return 0;
}
......@@ -3,7 +3,7 @@
extern void adainit();
extern void og_go(asn1SccMy_OctStr *);
extern void og_PI_go(asn1SccMy_OctStr *);
void og_RI_rezult (asn1SccMy_OctStr *val)
{
......@@ -13,7 +13,7 @@ void og_RI_rezult (asn1SccMy_OctStr *val)
int main() {
asn1SccMy_OctStr toto;
adainit();
og_go(&toto);
og_PI_go(&toto);
return 0;
}
......@@ -2,8 +2,8 @@
#include <stdio.h>
/* Ada code external interface */
extern void challenge_run();
extern void challenge_go_off();
extern void challenge_PI_run();
extern void challenge_PI_go_off();
extern int adainit();
//extern long long l_result;
......@@ -17,8 +17,8 @@ void challenge_RI_pow(long long *a, long long *b, long long *res)
int main()
{
adainit();
challenge_run();
challenge_go_off();
challenge_PI_run();
challenge_PI_go_off();
return 0;
}
......
......@@ -3,7 +3,7 @@
#include "dataview-uniq.h"
extern void adainit();
extern void expressions_run();
extern void expressions_PI_run();
void expressions_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
if (!*res) {
......@@ -14,6 +14,6 @@ void expressions_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
int main() {
adainit();
expressions_run();
expressions_PI_run();
return 0;
}
......@@ -3,7 +3,7 @@
extern void adainit();
extern void og_go(asn1SccMy_OctStr *);
extern void og_PI_go(asn1SccMy_OctStr *);
void og_RI_rezult (asn1SccMy_OctStr *val)
{
......@@ -13,9 +13,9 @@ void og_RI_rezult (asn1SccMy_OctStr *val)
int main() {
asn1SccMy_OctStr toto = test_string; // send "hello"
adainit();
og_go(&toto); // will move state to Running
og_go(&toto); // will display ay
og_go(&toto); // will display ay
og_PI_go(&toto); // will move state to Running
og_PI_go(&toto); // will display ay
og_PI_go(&toto); // will display ay
return 0;
}
......@@ -13,7 +13,7 @@ SeqBoolFix ::= SEQUENCE (SIZE(2)) OF BOOLEAN
SeqEnum ::= SEQUENCE (SIZE(1..5)) OF ENUMERATED { hello, world }
SeqEnumFix ::= SEQUENCE (SIZE(2)) OF ENUMERATED { hello, world }
Enum ::= ENUMERATED {a, b, c, d, eE}
Enum-T ::= ENUMERATED {a, b, c, d, eE}
Choice ::= CHOICE {c1 BOOLEAN, cDe2 BOOLEAN}
END
......
......@@ -3,7 +3,7 @@
#include "dataview-uniq.h"
extern void adainit();
extern void expressions_run();
extern void expressions_PI_run();
void expressions_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
if (!*res) {
......@@ -14,6 +14,6 @@ void expressions_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
int main() {
adainit();
expressions_run();
expressions_PI_run();
return 0;
}
......@@ -9,7 +9,7 @@ CharString ::= OCTET STRING (SIZE(0..100))
FixSeqof ::= SEQUENCE (SIZE(3)) OF Integer
VarSeqof ::= SEQUENCE (SIZE(0..100)) OF Integer
Enum ::= ENUMERATED { one(12), two(13), three(111) }
Enum-T ::= ENUMERATED { one(12), two(13), three(111) }
Choice ::= CHOICE {
b BOOLEAN,
......
......@@ -5,7 +5,7 @@ PROCESS operators;
DCL f Real := 2.0;
DCL b Boolean := true;
DCL s CharString := 'HELLO';
DCL e Enum := one;
DCL e Enum_T := one;
DCL fixSeqOf FixSeqof := {1, 2, 3};
DCL varSeqOf varSeqOf := {1, 2, 3};
DCL c Choice := i:2;
......@@ -53,4 +53,4 @@ DCL c Choice := i:2;
/* CIF NEXTSTATE (164, 1048), (100, 50) */
NEXTSTATE Wait;
ENDSTATE;
ENDPROCESS operators;
\ No newline at end of file
ENDPROCESS operators;
......@@ -3,7 +3,7 @@
#include "dataview-uniq.h"
extern void adainit();
extern void operators_run();
extern void operators_PI_run();
void operators_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
if (!*res) {
......@@ -14,6 +14,6 @@ void operators_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
int main() {
adainit();
operators_run();
operators_PI_run();
return 0;
}
......@@ -28,7 +28,7 @@ Type2 ::= BOOLEAN
Toto ::= SEQUENCE { elem-1 Type1, elem-2 Type2 }
SeqBool ::= SEQUENCE(SIZE(1..5)) OF BOOLEAN
Enum ::= ENUMERATED {enum1}
Enum-T ::= ENUMERATED {enum1}
default-seqof SeqOf ::= {4,7,9}
default-str My-OctStr ::= 'DEADBEEF'H
......
......@@ -28,7 +28,7 @@ Type2 ::= BOOLEAN
Toto ::= SEQUENCE { elem-1 Type1, elem-2 Type2 }
SeqBool ::= SEQUENCE(SIZE(1..5)) OF BOOLEAN
Enum ::= ENUMERATED {enum1}
Enum-T ::= ENUMERATED {enum1}
default-seqof SeqOf ::= {4,7,9}
default-str My-OctStr ::= 'DEADBEEF'H
......
......@@ -18,35 +18,40 @@ system og;
state NestedState;
substructure
out (getOut);
/* CIF TEXT (80, 232), (366, 83) */
/* CIF TEXT (80, 232), (368, 113) */
-- Declare a variable with the same name as the level above
dcl toto MySeq := { a FALSE, b 2 };
-- Declare a non-shadowing variable
dcl tutu MySeq := { a TRUE, b 8 };
dcl ghost MyInt := 3;
/* CIF ENDTEXT */
/* CIF START (747, 207), (70, 35) */
START;
/* CIF PROCEDURECALL (565, 262), (433, 35) */
call writeln ('Entering state with ', toto.a, toto.b, ' (should be FALSE 2)' );
/* CIF task (733, 317), (98, 38) */
/* CIF task (733, 317), (98, 53) */
task toto := toto,
tutu := tutu;
/* CIF PROCEDURECALL (577, 375), (410, 35) */
tutu := tutu,
ghost := 4;
/* CIF PROCEDURECALL (577, 400), (410, 35) */
call writeln ('Value should be the same: ', toto.a, toto.b);
/* CIF task (705, 430), (153, 53) */
/* CIF task (705, 455), (153, 53) */
task toto.a := TRUE,
toto.b := 3,
toto := { a FALSE, b 4 };
/* CIF task (705, 503), (153, 53) */
/* CIF task (705, 528), (153, 53) */
task tutu.a := TRUE;
/* CIF PROCEDURECALL (577, 571), (410, 35) */
/* CIF PROCEDURECALL (577, 596), (410, 35) */
call writeln ('Value should be (FALSE 4) : ', toto.a, toto.b);
/* CIF return (764, 626), (35, 35) */
/* CIF return (764, 651), (35, 35) */
return getOut;
endsubstructure;
/* CIF TEXT (57, 58), (287, 140) */
dcl toto MySeq;
dcl ghost MySeq;
/* CIF ENDTEXT */
/* CIF START (475, 177), (70, 35) */
START;
......
......@@ -28,7 +28,7 @@ Type2 ::= BOOLEAN
Toto ::= SEQUENCE { elem-1 Type1, elem-2 Type2 }
SeqBool ::= SEQUENCE(SIZE(1..5)) OF BOOLEAN
Enum ::= ENUMERATED {enum1}
Enum-T ::= ENUMERATED {enum1}
default-seqof SeqOf ::= {4,7,9}
default-str My-OctStr ::= 'DEADBEEF'H
......
......@@ -6,8 +6,8 @@
#include "dataview-uniq.h"
extern void adainit();
extern void myfunction_start_something(asn1SccT_Int32 *);
extern void myfunction_mytimer();
extern void myfunction_PI_start_something(asn1SccT_Int32 *);
extern void myfunction_PI_mytimer();
void myfunction_RI_result_data(long long *val)
......@@ -22,7 +22,7 @@ int main()
printf("[C Code] Running test\n");
adainit();
myfunction_start_something(&test);
myfunction_PI_start_something(&test);
return 0;
}
......@@ -3,7 +3,7 @@
extern void adainit();
extern void og_go(asn1SccMy_OctStr *);
extern void og_PI_go(asn1SccMy_OctStr *);
void og_RI_rezult (asn1SccMy_OctStr *val)
{
......@@ -13,9 +13,9 @@ void og_RI_rezult (asn1SccMy_OctStr *val)
int main() {
asn1SccMy_OctStr toto = test_string; // send "hello"
adainit();
og_go(&toto); // will move state to Running
og_go(&toto); // will display ay
og_go(&toto); // will display ay
og_PI_go(&toto); // will move state to Running
og_PI_go(&toto); // will display ay
og_PI_go(&toto); // will display ay
return 0;
}
......@@ -2,8 +2,8 @@
#include <stdio.h>
/* Ada code external interface */
extern void challenge_run();
extern void challenge_any_one();
extern void challenge_PI_run();
extern void challenge_PI_any_one();
extern int adainit();
//extern long long l_result;
......@@ -17,11 +17,11 @@ void challenge_RI_pow(long long *a, long long *b, long long *res)
int main()
{
adainit();
challenge_run();
challenge_run();
challenge_PI_run();
challenge_PI_run();
//printf("Internal state: %lld\n", l_result);
challenge_any_one();
challenge_run();
challenge_PI_any_one();
challenge_PI_run();
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment