conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 23_timer_operations / 2302_the_start_timer_operataion / Sem_2302_timer_start_001.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2016 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 * Contributors:
9 * Adrien Kirjak – initial implementation
10 *
11 ** @version 0.0.1
12 ** @purpose 1:23, Ensure timer runs from zero to stated value
13 ** @verdict pass accept, ttnc3verdict:pass
14 ***************************************************/
15 // #reqname /Requirements/23 Timer operations/23.2 The start timer operation/timer clock runs from 0 to the value set
16
17 module Sem_2302_timer_start_001 {
18 type component TComp{
19 timer t_timer := 1.0;
20 }
21
22 testcase TC_Sem_2302_timer_start_001() runs on TComp{
23 timer t_short, t_long;
24 var float v_elapsed;
25 var float v_last := 0.0;
26
27 t_long.start(2.0);
28 t_timer.start(1.0);
29 t_short.start(0.5);
30
31 while (t_short.running) {
32 v_elapsed := t_timer.read;
33 log("t_timer.read = ", v_elapsed);
34 if (v_elapsed<0.0 or v_elapsed < v_last){
35 setverdict(fail)
36 }
37 v_last := v_elapsed;
38 }
39 while (t_timer.running) {
40 v_elapsed := t_long.read;
41 log("t_long.read = ", v_elapsed);
42 if (v_elapsed < v_last){
43 setverdict(fail)
44 }
45 v_last := v_elapsed;
46 }
47 setverdict(pass);
48
49 }
50
51 control{
52 execute(TC_Sem_2302_timer_start_001())
53 }
54 }
This page took 0.032561 seconds and 5 git commands to generate.