Commit 7801f5ea by Maxime Perrotin

### More complex cases

parent d1233471
 ... ... @@ -21,6 +21,16 @@ MySeqi2 ::= SEQUENCE { b MySeqOf } MySeq3 ::= SEQUENCE { a MyEnum, b MyEnum } MySeq4 ::= SEQUENCE { a MyEnum, b MyVarSeqOf } --MyChoice ::= CHOICE { -- choice-a MyInteger, -- choice-b MySeqOf ... ...
 ... ... @@ -30,6 +30,8 @@ procedure test_generic is use MySeqOfEnum_Pkg; use MySeq_Pkg; use MySeqi2_Pkg; use MySeq3_Pkg; use MySeq4_Pkg; -- Test cases MyIt : MyInteger_Pkg.Instance; ... ... @@ -40,6 +42,8 @@ procedure test_generic is Seq : MySeq_Pkg.Instance; Seq2 : MySeqi2_Pkg.Instance; Seq3 : MySeq3_Pkg.Instance; Seq4 : MySeq4_Pkg.Instance; SeqOfItm : asn1SccMySeqOf; VarSeqOfItm : asn1SccMyVarSeqOf; ... ... @@ -104,7 +108,7 @@ begin Put_Line ("Sequence with a complex field"); i := 1; count := 0; for Each of Seq2 loop for each of Seq2 loop count := count + 1; Put (Image (Each) & " "); i := (if i mod 6 = 0 then 1 else i + 1); ... ... @@ -116,6 +120,41 @@ begin Put_Line ("total: " & count'img & " values were computed"); New_Line; Put_Line ("Sequence with two enums field"); i := 1; count := 0; for each of Seq3 loop count := count + 1; Put (Image (Each) & " "); i := (if i mod 6 = 0 then 1 else i + 1); if i = 1 then New_Line; end if; end loop; New_Line; Put_Line ("total: " & count'img & " values were computed"); New_Line; Put_Line ("Bigger Sequence"); i := 1; count := 0; for each of Seq4 loop count := count + 1; if count < 30 or count > 1500 then Put (Image (Each) & " "); i := (if i mod 3 = 0 then 1 else i + 1); if i = 1 then New_Line; end if; end if; if count = 30 then New_Line; Put_Line ("..."); end if; end loop; New_Line; Put_Line ("total: " & count'img & " values were computed"); New_Line; end test_generic;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!