Commit 319ffee9 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete test case

parent 196b405f
......@@ -28,8 +28,8 @@ test-qgen-gt-c:
test-ada:
$(OPENGEODE) og.pr --toAda
mono $(ASN1SCC) -Ada -typePrefix asn1Scc -equal dataview-uniq.asn
cp ris.ada ris.ads && cp check.ada check.adb
gnat make check && ./check
cp ris.ada ris.ads && cp check.ada check.adb && cp ris_adb.ada ris.adb
gnat make -g -O0 check && ./check | diff expected -
test-c:
$(OPENGEODE) og.pr --toC
......
......@@ -4,5 +4,5 @@ with RIs;
procedure check is
begin
null;
Go;
end check;
Hello
Checking queue
Received 5
Received 10
Received 10
Received 9
Checking queue
......@@ -6,18 +6,16 @@ system og;
--use dv2 comment 'dataview2.asn';
signal pulse;
signal go;
signal send_to_uart(OctStr);
/* CIF ENDTEXT */
channel c
from env to og with pulse;
from env to og with go;
from og to env with send_to_uart;
endchannel;
block og;
signalroute r
from env to og with pulse;
from env to og with go;
from og to env with send_to_uart;
connect c and r;
/* CIF PROCESS (225, 49), (150, 75) */
......@@ -29,23 +27,32 @@ system og;
/* CIF ENDTEXT */
/* CIF START (363, 159), (70, 35) */
START;
/* CIF NEXTSTATE (363, 214), (70, 35) */
/* CIF PROCEDURECALL (338, 214), (120, 35) */
call writeln('Hello');
/* CIF NEXTSTATE (363, 264), (70, 35) */
NEXTSTATE wait;
/* CIF state (363, 214), (70, 35) */
/* CIF state (363, 264), (70, 35) */
state wait;
/* CIF provided (363, 269), (70, 35) */
/* CIF provided (240, 319), (70, 35) */
provided true;
/* CIF output (322, 324), (152, 35) */
/* CIF output (199, 374), (152, 35) */
output send_to_uart ('hello');
/* CIF output (293, 379), (209, 35) */
/* CIF output (170, 429), (209, 35) */
output send_to_uart ('hello' // 'world');
/* CIF output (275, 434), (246, 38) */
/* CIF output (152, 484), (246, 38) */
output send_to_uart ('How' // 'are' // 'you?');
/* CIF output (288, 492), (219, 35) */
output send_to_uart('I said' // msg // '!');;
/* CIF NEXTSTATE (363, 542), (70, 35) */
/* CIF output (165, 542), (219, 35) */
output send_to_uart('I said' // msg // '!');
/* CIF NEXTSTATE (239, 592), (71, 35) */
NEXTSTATE running;
/* CIF input (408, 319), (70, 35) */
input Go;
/* CIF NEXTSTATE (408, 374), (70, 35) */
NEXTSTATE wait;
endstate;
/* CIF state (492, 510), (74, 35) */
state Running;
endstate;
endprocess og;
endblock;
endsystem;
\ No newline at end of file
with TASTE_DataView;
use TASTE_DataView;
package ris is
procedure Send_To_UART (Msg: Access Taste_dataview.asn1SccOctStr) is null;
procedure Send_To_UART (Msg: access Taste_dataview.asn1SccOctStr);
pragma Export (C, Send_To_UART, "og_RI_send_to_uart");
function Check_Queue return Boolean is (True);
procedure Check_Queue (Result: access Boolean);
pragma Export (C, Check_Queue, "og_check_queue");
end ris;
with Text_IO; use Text_IO;
package body RIs is
procedure Check_Queue (Result: access Boolean) is
begin
Put_Line ("Checking queue");
Result.all := False;
end Check_Queue;
procedure Send_To_UART (Msg: access Taste_dataview.asn1SccOctStr) is
begin
Put_Line ("Received " & Msg.Length'Img);
end;
end RIs;
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