From 5902bb56d21530912c42c504554b71781eb512bc Mon Sep 17 00:00:00 2001 From: Botond Baranyi <botond.baranyi@ericsson.com> Date: Mon, 7 Jun 2021 18:23:06 +0200 Subject: [PATCH] Added missing tests for issue #495 Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com> --- .../Semantic_Analyser/issues/.gitignore | 2 + .../Semantic_Analyser/issues/Issue495_SE.ttcn | 37 +++++++++++++++++++ .../Semantic_Analyser/issues/Makefile | 12 ++++++ function_test/Semantic_Analyser/issues/t | 9 +++++ 4 files changed, 60 insertions(+) create mode 100644 function_test/Semantic_Analyser/issues/.gitignore create mode 100644 function_test/Semantic_Analyser/issues/Issue495_SE.ttcn create mode 100644 function_test/Semantic_Analyser/issues/Makefile create mode 100755 function_test/Semantic_Analyser/issues/t diff --git a/function_test/Semantic_Analyser/issues/.gitignore b/function_test/Semantic_Analyser/issues/.gitignore new file mode 100644 index 000000000..e2d293255 --- /dev/null +++ b/function_test/Semantic_Analyser/issues/.gitignore @@ -0,0 +1,2 @@ +!Makefile +!*.ttcn diff --git a/function_test/Semantic_Analyser/issues/Issue495_SE.ttcn b/function_test/Semantic_Analyser/issues/Issue495_SE.ttcn new file mode 100644 index 000000000..17d4b671c --- /dev/null +++ b/function_test/Semantic_Analyser/issues/Issue495_SE.ttcn @@ -0,0 +1,37 @@ +/****************************************************************************** + * Copyright (c) 2000-2021 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 + * + ******************************************************************************/ + +module Issue495 //^In TTCN-3 module// +{ + +modulepar +{ + integer tsp_cl_num := 10; +} + + +type component MTC_CT {}; + + + testcase tc_Fatal_Error() runs on MTC_CT //^In testcase definition// + { + const integer cl_num0 := 10; + var integer Int0[cl_num0]; + + const integer cl_num := tsp_cl_num; + var integer Int[cl_num]; //^In variable definition// //^In array size// //Referenced constant value cannot be evaluated at compile-time// + + var integer Int2[tsp_cl_num]; //^In variable definition// //^In array size// //Reference to an \(evaluable\) constant value was expected instead of module parameter// + + } + +} diff --git a/function_test/Semantic_Analyser/issues/Makefile b/function_test/Semantic_Analyser/issues/Makefile new file mode 100644 index 000000000..7abfd0db9 --- /dev/null +++ b/function_test/Semantic_Analyser/issues/Makefile @@ -0,0 +1,12 @@ +############################################################################## +# Copyright (c) 2000-2021 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 +# +############################################################################## +include ../common.mk diff --git a/function_test/Semantic_Analyser/issues/t b/function_test/Semantic_Analyser/issues/t new file mode 100755 index 000000000..3a4b58ec1 --- /dev/null +++ b/function_test/Semantic_Analyser/issues/t @@ -0,0 +1,9 @@ +#!/usr/bin/perl +# note this is called through "perl -w" +use strict; + +my $self = $0; +$self =~ s!/t!!; + +exec('make check --no-print-directory -s -C ' . $self); + -- GitLab