Commit f2dacd2e authored by Elemer Lelik's avatar Elemer Lelik
Browse files

Initial contribution

parent e0fa3b58
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module complex_expr {
control {
var integer i := 0;
// large complexity (20)
for(i:=0; i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i < 1; i:=i+1) {}
while(i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i < 1) {}
do {} while(i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i < 1);
if (i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i < 1) {}
i := i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i+i;
// no complexity (1)
for(i:=0; i < 1; i:=i+1) {}
while(i < 1) {}
do {} while(i < 1);
if (i < 1) {}
i := i+i;
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module many_param {
import from types all;
// Too many parameters (10)
function f(t1 p1, t1 p2, t1 p3, t1 p4, t1 p5, t1 p6, t1 p7, t1 p8, t1 p9, t1 p10) {}
// no problem (1 parameter)
testcase t(t1 p1) runs on c1_CT {}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module many_statements {
function nyan() return charstring {return "NYAN";}
// too many statements (1000)
control {
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan(); nyan();
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module type_in_def {
// containing their type
function integer_f() return integer {return 0;}
external function integer_ef() return integer;
external const integer integer_2;
const integer integer_1 := 0;
// no problem
function f() return integer {return 0;}
external function ef() return integer;
external const integer i_2;
const integer i_1 := 0;
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module types
{
type integer t1;
type boolean t2;
type charstring t3;
type record of integer ROI;
type port test_port message
{
inout t1;
in t2;
out t3;
};
type port test_int_port message
{
inout integer;
}
type component c1_CT
{
port test_port p1_PT;
}
}
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module no_comment {
import from types all;
// the below function/testcase/altstep definitions should have a comment
const integer comment_separation_1 := 0;
function f1() {}
testcase t1() runs on c1_CT {}
altstep a1() {
[] any port.receive {}
}
const integer comment_separation_2 := 0;
// fine, as it has a comment
function f2() {}
// fine, as it has a comment
testcase t2() runs on c1_CT {}
// fine, as it has a comment
altstep a2() {
[] any port.receive {}
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module init_var {
control {
// bad: uninitialized
var integer i1;
var template integer ti1;
// good: initialized
var integer i2 := 1;
var template integer ti2 := (2,3,0);
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module overcomp {
import from types all;
function f(test_int_port p) {
var integer i := 0;
// unnecessary
for (i:=0; false; i:=i+1) {}
// unnecessary
while (false) {}
// unnecessary
do {} while (false);
select(i) {
case else {}
case(0) {/* never reach */}
}
if (true) {
} else {
// never reach
}
if (false) {
// never reach
} else {
}
alt {
[else] {}
[] p.receive {/* never reach */}
}
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module omit_valueof {
control {
var integer i;
const integer c := 1;
template integer ti := 23;
var template integer ti2;
// valueof has no effect
i := valueof(5);
i := valueof(c + 2);
// valueof is ok ??? (not sure about this)
i := valueof(i);
i := valueof(ti);
i := valueof(ti2);
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module omit_retval {
function f1() return integer {return 0;}
function f2() {}
control {
// not used return value
f1();
// fine
var integer i := f1();
f2();
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module unused_global {
// unused
type integer INT1;
// used
type integer INT2;
// unused
const INT2 this_is_also_not_used_globally := 3;
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module unused_import {
// This import is not used
import from switch_bool all;
// this is used
import from types all;
const t1 i := 0;
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module unused_local {
control {
// unused local definition
var integer i := 0;
// used
var integer i2 := 1;
i2 := i2 * 4;
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module omit_started_retval {
import from types all;
function f1() runs on c1_CT return integer {return 0;}
function f2() runs on c1_CT {}
testcase t() runs on c1_CT {
var c1_CT c := c1_CT.create;
// unused return value from started function
c.start(f1());
// fine
c.start(f2());
// should test a type with 'done' extension attribute
}
}
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
module visibility {
// these contain visibility keywords:
const integer public_i := 0;
const integer i_private_var := 21;
const integer my_friend := 42;
// fine
const integer frienpubliprivatE := 23;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<TITAN_Designer_Properties>
<ActiveConfiguration>Default</ActiveConfiguration>
<ProjectProperties>
<MakefileSettings>
<targetExecutable>bin\test1.exe</targetExecutable>
</MakefileSettings>
<LocalBuildSettings>
<MakefileScript/>
<workingDirectory>bin</workingDirectory>
</LocalBuildSettings>
</ProjectProperties>
</TITAN_Designer_Properties>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>test1</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.titan.designer.core.TITANBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.titan.designer.core.TITANNature</nature>
<nature>org.eclipse.titan.log.viewer.TitanLogProject</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<TITAN_Designer_Properties>
<ActiveConfiguration>Default</ActiveConfiguration>
<ProjectProperties>
<MakefileSettings>
<targetExecutable>bin\test1.exe</targetExecutable>
</MakefileSettings>
<LocalBuildSettings>
<MakefileScript/>
<workingDirectory>bin</workingDirectory>
</LocalBuildSettings>
</ProjectProperties>
</TITAN_Designer_Properties>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>test1</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.titan.designer.core.TITANBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.titan.designer.core.TITANNature</nature>
<nature>org.eclipse.titan.log.viewer.TitanLogProject</nature>
</natures>
</projectDescription>
/******************************************************************************
* Copyright (c) 2000-2014 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
/*
//AUTHOR:
//DATE:
//VERSION:
*/
module a
// [.objid{ itu_t(0) identified_organization(4) etsi(0)
// identified_organization(127) ericsson(5) testing(0)
// <put further nodes here if needed>}]
{
//=========================================================================
// Import Part
//=========================================================================
import from b all;
import from c all;