Commit | Line | Data |
---|---|---|
970ed795 EL |
1 | /****************************************************************************** |
2 | * Copyright (c) 2000-2014 Ericsson Telecom AB | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | ******************************************************************************/ | |
8 | // HS41022 - Titan 2.2.pl0 Wrong value for matching for 19 digit integer | |
9 | ||
10 | module HS41022 { | |
11 | ||
12 | // the number of bits this value is represented on (in this case 63) needs to be dividable by 7 | |
13 | const integer BIG_NUMBER := 9223372036854775807; | |
14 | ||
15 | type port PT message { | |
16 | inout integer | |
17 | } with { extension "internal" } | |
18 | ||
19 | type component CT { | |
20 | port PT pt | |
21 | } | |
22 | ||
23 | function fc_par(in integer i) runs on CT { | |
24 | if (i == BIG_NUMBER) { | |
25 | setverdict(pass); | |
26 | } | |
27 | else { | |
28 | setverdict(fail); | |
29 | } | |
30 | } | |
31 | ||
32 | function fc_msg() runs on CT { | |
33 | timer t := 2.0; | |
34 | alt { | |
35 | [] pt.receive(integer:BIG_NUMBER) { setverdict(pass); } | |
36 | [] pt.receive(integer:?) { setverdict(fail); } | |
37 | [] t.timeout { setverdict(inconc); } | |
38 | } | |
39 | } | |
40 | ||
41 | // Send the number as a function parameter | |
42 | testcase tc_big_int_par_with_2_comps() runs on CT { | |
43 | var CT the_other_comp := CT.create; | |
44 | connect(self:pt, the_other_comp:pt); | |
45 | ||
46 | the_other_comp.start(fc_par(BIG_NUMBER)); | |
47 | ||
48 | the_other_comp.done; | |
49 | setverdict(pass); | |
50 | } | |
51 | ||
52 | // Send the number as a message on a port | |
53 | testcase tc_big_int_msg_with_2_comps() runs on CT { | |
54 | var CT the_other_comp := CT.create; | |
55 | connect(self:pt, the_other_comp:pt); | |
56 | ||
57 | the_other_comp.start(fc_msg()); | |
58 | pt.send(BIG_NUMBER); | |
59 | ||
60 | the_other_comp.done; | |
61 | setverdict(pass); | |
62 | } | |
63 | ||
64 | control { | |
65 | execute(tc_big_int_par_with_2_comps()); | |
66 | execute(tc_big_int_msg_with_2_comps()); | |
67 | } | |
68 | ||
69 | } |