Commit 114d1c9a authored by Elemer Lelik's avatar Elemer Lelik
Browse files

Titan Core Initial Contribution

parent 055af2fa
# Makefile for pseudoinstall
TOP := ..
include $(TOP)/Makefile.cfg
all run:
$(ABS_SRC)/../pseudoinstall
# Should this delete ?
clean distclean: ;
# definitely do-nothing
dep install: ;
# All targets are phony
.PHONY: all run clean distclean dep install
export OPENSSL_DIR XMLDIR
/******************************************************************************
* 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 HQ30279A { //^In TTCN-3 module//
// "components should be initialized before templates" is not true.
//
//
type record of integer integers;
type set of integer intset; // superset/subset needs set-of; record-of not good enough
type component MTC {
var integer ct_variable;
var template integer ct_template;
const integer ct_const := 42;
}
template integer t_int(integer par) := par;
type function int_ret_fn_type() return template integer;
function int_ret_fn () return template integer { return 42; }
modulepar int_ret_fn_type mp_int_ret_fn := refers(int_ret_fn);
const int_ret_fn_type co_int_ret_fn := refers(int_ret_fn);
function forty_two() runs on MTC return integer
{
return 42;
}
/* * * * * * */
function f1(
integer pl_in
:= ct_const
) runs on MTC
{}
function f0(template intset z) runs on MTC
{
}
function f2( //^In function definition `f2':$// //^In formal parameter list:$//
template integer f_par //^In parameter `f_par':$//
:= t_int(ct_variable) //^In default value:$// \
//^error: default value cannot refer to a template field of the component in the `runs on' clause$//
) runs on MTC
{}
function f_defval_tpl( //^In function definition `f_defval_tpl':$// //^In formal parameter list:$//
template integer f_par //^In parameter `f_par':$//
:= ct_template //^In default value:$// \
//^error: default value cannot refer to a field of the component in the `runs on' clause$//
) runs on MTC
{}
function f_defval_invoke( //^In function definition `f_defval_invoke':$// //^In formal parameter list:$//
template integer f_par //^In parameter `f_par':$//
:= mp_int_ret_fn.apply() //^In default value:$// \
//^error: default value can not be a function invocation$//
) runs on MTC
{}
function f_defal_value_list(
template integer f_par
:= (3, 14, 15, 9, 26)
) runs on MTC
{}
function f_defval_compl_list(
template integer f_par
:= complement (3, 14, 15, 9, 26)
) runs on MTC
{}
function f_defval_range(
template integer f_par
:= (7 .. ct_variable)
) runs on MTC
{}
function f_defval_permutation(
template integers f_par
:= { permutation (3, 14, 15, 9, 26) }
) runs on MTC
{}
function f_defval_subset(
template intset f_par
:= subset (3, 14, 15, 9, 26)
) runs on MTC
{}
function f_defval_superset(
template intset f_par
:= superset (3, 14, 15, 9, 26)
) runs on MTC
{}
/* * * * Anything should be accepted as an actual parameter when _calling_ * * * */
testcase tc_component_var () runs on MTC
{
f2(ct_template)
}
testcase tc_not_used() runs on MTC
{
f2(-)
}
testcase tc_omit() runs on MTC
{
f2(omit)
}
testcase tc_any() runs on MTC
{
f2(*)
}
testcase tc_any_or_omit() runs on MTC
{
f2(?)
}
testcase tc_value_list() runs on MTC
{
f2(integer : (3, 14, 15, 9, 26))
f2( (3, 14, 15, 9, 26))
}
testcase tc_complemented_list() runs on MTC
{
f2(integer : complement (3, 14, 15, 9, 26))
f2( complement (3, 14, 15, 9, 26))
}
testcase tc_invoke() runs on MTC
{
var int_ret_fn_type v_int_ret_fn := refers(int_ret_fn);
f2(v_int_ret_fn.apply());
}
testcase tc_superset() runs on MTC
{
f0( superset (3, 14, 15, 9, 26) )
}
testcase tc_subset() runs on MTC
{
f0( subset (3, 14, 15, 9, 26) )
}
control
{
execute(tc_not_used())
execute(tc_omit())
execute(tc_any())
execute(tc_any_or_omit())
execute(tc_value_list())
}
}
###############################################################################
# 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
###############################################################################
include ../common.mk
/******************************************************************************
* 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 bende_fn_SE { //^In TTCN-3 module//
type record Cause
{
octetstring causeValue,
bitstring cS
}
type record PrivateExtension
{}
type set DownlinkDataNotificationFailureIndication
{
Cause cause,
PrivateExtension privateExtension optional
};
type union GTPCv2_PDUs
{
DownlinkDataNotificationFailureIndication downlinkDataNotificationFailureIndication
}
const bitstring zerobit := '0'B;
// GTPCv2_IE_Templates.ttcn:122
template Cause t_GTPCv2_IE_cause (
template bitstring pl_cS := // specific value, which is either:
'0'B, // V_BSTR
template octetstring pl_causeValue := omit
) :=
{
causeValue := pl_causeValue,
cS := pl_cS
// The presence of this _parameterized_ template alone is not enough for fatal error.
// It has to be the default value of a parameter (template or function).
}
const octetstring cg_GTPv2_CV_UENotResponding := '57'O
// The original kaboom was caused by a template
//template GTPCv2_PDUs t_GTPCv2_DataDownlinkNotificationFailureIndication(
// template Cause pl_Cause := t_GTPCv2_IE_cause(pl_causeValue := cg_GTPv2_CV_UENotResponding)
//) :=
//{
// downlinkDataNotificationFailureIndication :=
// {
// cause := pl_Cause,
// privateExtension := omit
// }
//} /* template t_GTPCv2_DataDownlinkNotificationFailureIndication */
// But it can be made to appear with a function also
function f(in template Cause p_cause := t_GTPCv2_IE_cause(pl_causeValue := cg_GTPv2_CV_UENotResponding)) runs on C
{}
type component C {
var octetstring m_os;
var bitstring m_bs;
var template Cause mt_cause := {};
}
// correctly flagged as error:
// "default value cannot refer to a field of the component in the `runs on' clause"
function f2( //^In function definition// //^In formal parameter list:$//
in template Cause p_cause := mt_cause //^In parameter `p_cause':$// //^In default value:// \
//^error\: default value cannot refer to a field of the component in the \`runs on\' clause$//
) runs on C
{}
testcase tc1() runs on C
{
// no problems here
var template Cause vt_cause := t_GTPCv2_IE_cause(pl_causeValue := cg_GTPv2_CV_UENotResponding);
}
}
/******************************************************************************
* 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 bende_t_SE { //^In TTCN-3 module//
type record Cause
{
octetstring causeValue,
bitstring cS
}
type record PrivateExtension
{}
type set DownlinkDataNotificationFailureIndication
{
Cause cause,
PrivateExtension privateExtension optional
};
type union GTPCv2_PDUs
{
DownlinkDataNotificationFailureIndication downlinkDataNotificationFailureIndication
}
const bitstring zerobit := '0'B;
// GTPCv2_IE_Templates.ttcn:122
template Cause t_GTPCv2_IE_cause (
template bitstring pl_cS := // specific value, which is either:
'0'B, // V_BSTR
template octetstring pl_causeValue := omit
) :=
{
causeValue := pl_causeValue,
cS := pl_cS
// The presence of this _parameterized_ template alone is not enough for fatal error.
// It has to be the default value of a parameter (template or function).
}
const octetstring cg_GTPv2_CV_UENotResponding := '57'O
// The original kaboom
template GTPCv2_PDUs t_GTPCv2_DataDownlinkNotificationFailureIndication(
template Cause pl_Cause := t_GTPCv2_IE_cause(pl_causeValue := cg_GTPv2_CV_UENotResponding)
) :=
{
downlinkDataNotificationFailureIndication :=
{
cause := pl_Cause,
privateExtension := omit
}
} /* template t_GTPCv2_DataDownlinkNotificationFailureIndication */
// Parameterized template as default value => kaboom!
//function f(in template Cause p_cause := t_GTPCv2_IE_cause(pl_causeValue := cg_GTPv2_CV_UENotResponding)) runs on C
//{}
type component C {
var octetstring m_os;
var bitstring m_bs;
var template Cause mt_cause := {};
}
// correctly flagged as error:
// "default value cannot refer to a field of the component in the `runs on' clause"
function f2( //^In function definition// //^In formal parameter list:$//
in template Cause p_cause := mt_cause //^In parameter `p_cause':$// //^In default value:// \
//^error\: default value cannot refer to a field of the component in the \`runs on\' clause$//
) runs on C
{}
testcase tc1() runs on C
{
// no problems here
var template Cause vt_cause := t_GTPCv2_IE_cause(pl_causeValue := cg_GTPv2_CV_UENotResponding);
}
}
###############################################################################
# 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
###############################################################################
include ../common.mk
/******************************************************************************
* 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 encode_SE { //^In TTCN-3 module//
type integer AnInt with { encode "nonexistent" }; //^error\: Unknown encoding \'nonexistent\'$//
type record ARecord { //^error\: Unknown encoding \'whatever\'$//
integer i,
octetstring os
}
control { //^In control part//
var ARecord x;
var AnInt y;
var bitstring bs := '110'B;
if (decvalue(bs, y) != 0) {} //^In if statement// //^In the left operand of operation// //^In the parameters of decvalue()//
if (decvalue(bs, x) != 0) {} //^In if statement// //^In the left operand of operation// //^In the parameters of decvalue()//
}
} with {
encode "whatever"
}
###############################################################################
# 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
###############################################################################
NO3=3
include ../common.mk
/******************************************************************************
* 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 subtype_OK {
type float myf123 (1.0, 2.0, 3.0)
type float minf_to_zero (-infinity..0.0)
type float minf_to_mzero (-infinity..-0.0)
type float reals (-infinity..infinity)
type float reals_and_some (-infinity..infinity, 0.0, 1.0, 2.0, 3.0)
//type myf5 myf6
type float pow2 (2147483648.0, 4294967296.0, 8589934592.0)
type float two31_32 (2147483648.0..8589934592.0)
type float myf9 (myf123, minf_to_zero)
type myf9 myf10 (myf123)
type two31_32 myf11 (2147483648.0..4294967296.0, 4294967296.0..4294967300.0)
}
/******************************************************************************
* 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 subtype_SE { //^In TTCN-3 module//
import from subtype_OK all;
type component floater {}
type myf123 su2 (3.14); //^In type definition// //^error: The subtype restriction is not a subset of the restriction on the parent type\. Subtype \(3\.14e0\) is not subset of subtype \(1\.0e0,2\.0e0,3\.0e0\)$//
type minf_to_zero su3 (!6.0 .. 10.0); //^In type definition// //^error: The subtype restriction is not a subset of the restriction on the parent type\. Subtype \(!6\.0e0\.\.1\.0e1\) is not subset of subtype \(-INF\.\.0\.0e0\)$//
type float buzz_lightyear (infinity .. not_a_number) //^In type definition// //^error: upper boundary cannot be not_a_number in float subtype range$//
// to infinity and beyond
type su3 su3bis (6.0 .. 10.0);
type float one_to_ten (1.0 .. 10.0)
type float ten_to_eleven (10.0 .. 11.0)
// The real axis: -infinity -0.0 0.0 +infinity
type float strict_neg_x (-infinity .. !-0.0) //[.............)
type float strict_neg (-infinity .. -0.0) //[.............]
type float neg0_x (-infinity .. ! 0.0) //[.................)
type float neg0 (-infinity .. 0.0) //[.................]
type float pos ( -0.0 .. infinity) // [................]
type float pos_x (!-0.0 .. infinity) // (................]
type float strict_pos ( 0.0 .. infinity) // [...........]
type float strict_pos_x (! 0.0 .. infinity) // (...........]
type float zero ( -0.0 .. 0.0) // two values
type float xzero (!-0.0 .. 0.0) // one value: 0.0
type float zerox( -0.0 .. !0.0) // one value: -0.0
type float xzerox(!-0.0 .. !0.0) // no values!
testcase negative() runs on floater //^In testcase definition//
{
var strict_neg_x snx_minus_0 := -0.0; //^In variable definition// //^error: -0\.0e0 is not a valid value for type \`float\' which has subtype \(-INF\.\.!-0\.0e0\)$//
var strict_neg_x snx_plus_0 := 0.0; //^In variable definition// //^error: 0\.0e0 is not a valid value for type \`float\' which has subtype \(-INF\.\.!-0\.0e0\)$//
var strict_neg sn_minus_0 := -0.0; // OK
var strict_neg sn_plus_0 := 0.0; //^In variable definition// //^error: 0\.0e0 is not a valid value for type \`float\' which has subtype \(-INF\.\.-0\.0e0\)$//
var neg0_x n0x_minus_0 := -0.0; // OK
var neg0_x n0x_plus_0 := 0.0; //^In variable definition// //^error: 0\.0e0 is not a valid value for type \`float\' which has subtype \(-INF\.\.!0\.0e0\)$//
var neg0 nz_minus_zero := -0.0; // OK
var neg0 nz_plus_zero := 0.0; // OK
}
testcase positive() runs on floater //^In testcase definition//
{
var pos p_minus_0 := -0.0 // OK
var pos p_plus_0 := 0.0 // OK
var pos_x px_minus_0 := -0.0 //^In variable definition// //^error: -0\.0e0 is not a valid value for type \`float\' which has subtype \(!-0\.0e0\.\.INF\)$//
var pos_x px_plus_0 := 0.0 // OK
var strict_pos sp_minus_0 := -0.0 //^In variable definition// //^error: -0\.0e0 is not a valid value for type \`float\' which has subtype \(0\.0e0\.\.INF\)$//
var strict_pos sp_0 := 0.0 // OK
var strict_pos_x spx_minus_0 := -0.0 //^In variable definition// //^error: -0\.0e0 is not a valid value for type \`float\' which has subtype \(!0\.0e0\.\.INF\)$//
var strict_pos_x spx_plus_0 := 0.0 //^In variable definition// //^error: 0\.0e0 is not a valid value for type \`float\' which has subtype \(!0\.0e0\.\.INF\)$//
}
testcase nulla() runs on floater
{
var zero minus_zero := -0.0; // OK
var zero plus_zero := 0.0; // OK
}
control { //^In control part:$ nothing right now
var one_to_ten six := 6.6;
var ten_to_eleven ten := six;
execute(negative());
execute(positive());
execute(nulla());
}
}
/******************************************************************************
* 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 A_CYCLIC {
import from C_CYCLIC {import all};
const integer i_A := 60;
}
/******************************************************************************
* 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 A_SE {
//import from E_DPU_SE {import all};
friend module B_APU_SE, C_BPU_SE, E_CPU, B_CEFR_SE;
//==CONST===
const integer c_A_i := 0;
public const integer c_A_i_pu := 0;
friend const integer c_A_i_fr := 0;
private const integer c_A_i_pr := 0;
//==TEMPLATES===
template integer t_A_i := 0;
public template integer t_A_i_pu := 0;
friend template integer t_A_i_fr := 0;
private template integer t_A_i_pr := 0;
//===TYPES===
type integer A_MyInt;
public type integer A_MyInt_pu;
private type integer A_MyInt_pr;
friend type integer A_MyInt_fr;
//==functions
/* public */ function f_A() { log("This is f_A") }
public function f_A_pu() { log("This is f_A_pu") }
friend function f_A_fr() { log("This is f_A_fr") }
private function f_A_pr() { log("This is f_A_pr") }
}
/******************************************************************************
* 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
******************************************************************************/
//^In TTCN-3 module `B_APR_SE'://