Commit 7b3f5674 authored by balaskoa's avatar balaskoa
Browse files

test <references> has been added to Regression_Test_java


Signed-off-by: default avatarbalaskoa <Jeno.Balasko@ericsson.com>
Change-Id: I21c51d8c2005a9bdc180d44b0de82978e3b8dd23
parent d5f1c476
......@@ -23,7 +23,7 @@
#"src/assignmentNotation/TassignmentNotation.cfg" #Verdict Statistics: 0 none (0 %), 7 pass (100 %), 0 inconc (0 %), 0 fail (0 %), 0 error (0 %)
#HACK: escaped double quote added, ass. not. nok Error message:
# Error while setting parameter field 'tsp_editor' to 'vim': Referenced module parameter cannot be found. Module `vim' does not exist, and no parameter with name `vim' exists in any module.
"src/ERC/config.cfg" #fails in single mode, cfg file parse problems, 4 pass in parallel mode TODO: cfg parser bug fix
#"src/ERC/config.cfg" #fails in single mode, cfg file parse problems, 4 pass in parallel mode TODO: cfg parser bug fix
"src/recofOper/config.cfg" #only for init! (58 pass)
[EXECUTE]
#all_from_with_functions #TODO: JSON enc-dec function handling,
......
......@@ -36,6 +36,9 @@
#"src/text2ttcn/text2ttcn_1.cfg" #legacy mode
"src/ucharstrOper/config.cfg"
"src/uidChars/config.cfg"
"src/map_param/single_mode/single.cfg" #3 pass
"src/references/references.cfg"
[EXECUTE]
#==acceptance_test==
......@@ -214,6 +217,7 @@ Macros # 2pass
# modifiedTemplate
TmodifiedTemplate # 5 pass
#map_param : see in [ORDERED_INCLUDE] !
TobjidOper.control
#ocetstrOper:
ToctetstrOper
......@@ -270,6 +274,8 @@ RAWCodingAttributes.control
### recordOper ###
TrecordOper
#references: see in [ORDERED_INCLUDE] TODO: class part commented out
#selectUnion
SelectUnion.control
......
......@@ -8,7 +8,8 @@
#"src/EncodeDecode/OER_EncDec/OER_EncDec.cfg"
#"src/EncodeDecode/XER_EncDec/XER_EncDec.cfg"
#"src/text2ttcn_nolegacy/text2ttcn_1.cfg"
"src/map_param/single_mode/single.cfg" #3 pass
#"src/map_param/single_mode/single.cfg" #3 pass
"src/references/references.cfg"
[EXECUTE]
#### EncodeDecode folder #####
#all_from_with_functions
......
/******************************************************************************
* Copyright (c) 2000-2020 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Baranyi, Botond
*
******************************************************************************/
// this module is imported into the reference test module
module imp {
type record Rec {
integer a
}
const integer a := 2;
const Rec r := { a := 5 };
function f() return integer {
return 7;
}
type component CT2 {
timer tmr;
}
altstep as() runs on CT2 {
[] tmr.timeout { setverdict(pass); }
}
}
###############################################################################
# Copyright (c) 2000-2020 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Baranyi, Botond
#
###############################################################################
[LOGGING]
FileMask := LOG_ALL | DEBUG | MATCHING
ConsoleMask := ERROR | WARNING | TESTCASE | STATISTICS | PORTEVENT
LogSourceInfo := Yes
AppendFile := No
TimeStampFormat := DateTime
LogEventTypes := Yes
SourceInfoFormat := Single
LogEntityName := Yes
[EXECUTE]
references2.control
references2.tc_ref_simple_local
\ No newline at end of file
/******************************************************************************
* Copyright (c) 2000-2020 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Baranyi, Botond
*
******************************************************************************/
// this module tests the compiler's handling of references
// (requires object oriented features to be enabled)
module references2 {
import from imp all;
type component CT {}
function f() return integer {
return 3;
}
//TODO: OBject Oriented features shall be implemented
//type class Class {
// public function f() return integer {
// return 6;
// }
//}
// case <id>, local reference
testcase tc_ref_simple_local() runs on CT {
var integer a := 1;
if (a == 1) {
setverdict(pass);
} else {
setverdict(fail, a);
}
}
// case <id>, imported reference
testcase tc_ref_simple_imported() runs on CT {
if (a == 2) {
setverdict(pass);
} else {
setverdict(fail, a);
}
}
// case <id>(<params>), function reference
testcase tc_ref_simple_pard() runs on CT {
if (f() == 3) {
setverdict(pass);
} else {
setverdict(fail, f());
}
}
// case <id>.<id>, field of a local record
testcase tc_ref_double_local() runs on CT {
var Rec imp := { a := 4 };
if (imp.a == 4) {
setverdict(pass);
} else {
setverdict(fail, imp.a);
}
}
// case <id>.<id>, reference from a specific module
testcase tc_ref_double_specific() runs on CT {
if (imp.a == 2) {
setverdict(pass);
} else {
setverdict(fail, imp.a);
}
}
// case <id>.<id>, field of an imported record
testcase tc_ref_double_imported() runs on CT {
if (r.a == 5) {
setverdict(pass);
} else {
setverdict(fail, r.a);
}
}
// case <id>.objid{...}.<id>, reference from a specific module
testcase tc_ref_double_with_objid() runs on CT {
var Rec imp := { a := 4 };
if (imp.objid{ 0 1 }.a == 2) { // note: the actual components of the objid are ignored
setverdict(pass);
} else {
setverdict(fail, imp.objid{ 0 1 }.a);
}
}
//TODO: OBject Oriented features shall be implemented
// case <id>.<id>(<params>), method of a local class object
//testcase tc_ref_double_pard_local() runs on CT {
// var Class imp := Class.create;
// if (imp.f() == 6) {
// setverdict(pass);
// }
// else {
// setverdict(fail, imp.f());
// }
//}
// case <id>.<id>(<params>), function reference from a specific module
testcase tc_ref_double_pard_specific() runs on CT {
if (imp.f() == 7) {
setverdict(pass);
} else {
setverdict(fail, imp.f());
}
}
//TODO: OBject Oriented features shall be implemented
// case <id>.objid{...}.<id>(<params>), function reference from a specific module
//testcase tc_ref_double_pard_with_objid() runs on CT {
// var Class imp := Class.create;
// if (imp.objid{ 0 1 }.f() == 7) { // note: the actual components of the objid are ignored
// setverdict(pass);
// }
// else {
// setverdict(fail, imp.objid{ 0 1 }.f());
// }
//}
// Bug 565952
testcase tc_activate_imported_altstep() runs on CT2 {
var default def := null;
timer tmr_local;
tmr.start(0.1);
tmr_local.start(2.0);
def := activate(imp.as());
alt {
[] tmr_local.timeout { setverdict(fail); }
}
}
testcase tc_uninitialized_local_var() runs on CT2 {
var charstring cs1;
@try {
var charstring cs2 := cs1;
setverdict(fail, "This line should not be reached - DTE expected")
} @catch(e) {
setverdict(pass, "Caught the expected DTE:", e);
}
}
control {
execute(tc_ref_simple_local());
execute(tc_ref_simple_imported());
execute(tc_ref_simple_pard());
execute(tc_ref_double_local());
execute(tc_ref_double_specific());
execute(tc_ref_double_imported());
execute(tc_ref_double_with_objid());
//execute(tc_ref_double_pard_local());
execute(tc_ref_double_pard_specific());
//execute(tc_ref_double_pard_with_objid());
execute(tc_activate_imported_altstep());
execute(tc_uninitialized_local_var());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment