Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Dynamic test case error: Performing a valueof or send operation on a non-specific template(Dynamic test case error: Performing a valueof or send operation on a non-specific template)
Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723171] Fri, 12 February 2016 10:34 Go to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi,

While runing the script. I am getting below error.

"15:32:29.733367 RLC_r3_wk37.ttcn:30204: Dynamic test case error: Performing a valueof or send operation on a non-specific template of type @Class-definitions.SSDT-Information."

I have attached the script for reference. Kindly help.

Regards,
Murli
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723173 is a reply to message #1723171] Fri, 12 February 2016 10:37 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi,
Is there any easy way to find exactly which line is causing dynamic error inside a template.
Looks like adding LOG inside a template is not allowed.

Regards,
Murli
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723174 is a reply to message #1723171] Fri, 12 February 2016 10:41 Go to previous messageGo to next message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 133
Registered: December 2015
Senior Member
Just place the log() statement before the send()

Like:
GVC_.tcv_TGCFN := 0;
/* 1. */
log(ca_DL_DPCH_Info(p_CellId, tsc_DL_DPCH1, cb_DL_DPCH_SRB_StandAloneDPCH_Offset(GVC_.tcv_TmpCellInfo.dl_DPCH_2ndScrCode)))
CPHY.send(ca_DL_DPCH_Info(p_CellId, tsc_DL_DPCH1, cb_DL_DPCH_SRB_StandAloneDPCH_Offset(GVC_.tcv_TmpCellInfo.dl_DPCH_2ndScrCode)));

The cause of the dte is that one of the fields is not initialized or set properly.
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723198 is a reply to message #1723174] Fri, 12 February 2016 13:06 Go to previous messageGo to next message
Gustavo Gonnet is currently offline Gustavo GonnetFriend
Messages: 36
Registered: October 2015
Location: Montreal, Quebec, Canada
Member
Hi Murli,

you could also protect your code like this:

@try {
//dangerous code
}
@catch(error_) {
log("my dangerous code failed badly");
}

Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723359 is a reply to message #1723198] Mon, 15 February 2016 06:12 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi,

It seems the problem is the Default field and/or the Optional field.
trchConfigToFollow BOOLEAN DEFAULT TRUE,
relAspTypeExtension SEQUENCE {} OPTIONAL

These fields have not been given any values in the template.
But in the Titan Programmers' Guide section 6.1.1, it is mentioned that if the -d option is used then default values are sent.
I've used the -d option even then I'm getting the dynamic error.

I tried to investigate the problem by isolating the default field template in the following code:
ASN Type:
TestType ::= SEQUENCE {
	n1 INTEGER,
	n2 INTEGER DEFAULT 1
}

TTCN template:
template TestType testtype := 
{
	n1 := 10
}

After this when I do,
log(valueof(testtype));

It compiles fine but while running It gives following Dynamic Error:
 Dynamic test case error: Performing a valueof or send operation on a non-specific integer template.


I'm also using the -R and the -M compiler flags.

Please point out the issue.

Thanks
Murli
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723382 is a reply to message #1723359] Mon, 15 February 2016 10:11 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,


The default value (or 'omit' in case compiler option d is used) is only set automatically for values defined in ASN.1 code. Values and templates in TTCN-3 code need the attribute 'with { optional "implicit omit" }' to automatically set default values to omit.

Example:
template TestType testtype :=
{
n1 := 10
}
with { optional "implicit omit" }

For details about -d, please see ch 6.1.1 of the reference guide:


-d
This switch changes the way fields of ASN.1 SEQUENCE /SET types with DEFAULT values are handled. Without -d, the runtime handles the encoding and decoding of default values in a way that is consistent with DER and CER. With -d in effect, the ETS is responsible for the handling of fields with default values. This makes it possible to send encodings which are valid BER but not valid DER/CER and to verify that the SUT has performed the encoding correctly (note that without -d, the cases marked * and ** below cannot be distinguished in TTCN code).

Sending	                       Without d	               With d
Explicit value	               Send value	               Send value
Default value	               Do not send (omit)	Send default value
omit	                        N/A	                                Do not send (omit)

Receiving	                  Without d	                           With d
Receive explicit value	TTCN sees value	                   TTCN sees value
Receive default value	TTCN sees default value*	   TTCN sees default value
Omitted	                        TTCN sees default value**	  TTCN sees 'omit'


Warning! Existing tests may behave differently when compiled with -d. Every behavior without -d can be duplicated when compiled with -d.





Best regards

Elemer
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723513 is a reply to message #1723382] Tue, 16 February 2016 10:23 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

Thanks for the info.
I have some ttcn-3 scripts in which some templates do not initialize few members of the corresponding type.
Now whenever such templates are passed to send() or valueof() function, it compiles but produces Dynamic Testcase Error at runtime.
It becomes tedious to debug such errors one by one.

Is there some compiler flag or some other way so that Titan gives warnings/errors for such templates during compilation?
this will enable me to fix all such errors at once instead of solving one, compiling, testing, solving the other and so one.

Thanks
Murli
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723519 is a reply to message #1723513] Tue, 16 February 2016 11:13 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,


I discussed it with the developer team, and the best they came up with is the following:

if you use an isbound construct as below:

if (not (isbound(sometemplate )))  { log (sometemplate)}


this will log uninitialized templates and will make <unbound> fields visible


Maybe you can do this in a separate file for all templates and correct them in one run.

We will look into the possibility to add warnings for such an occurrence.

Best regards

Elemer




Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723650 is a reply to message #1723519] Wed, 17 February 2016 05:35 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

Thanks for the info.

In the thread https://www.eclipse.org/forums/index.php/t/1074285/ you mentioned that some bug-fixes related to "implicit omit of optional fields in templates" and "passing values (not templates) to ispresent() function" have been done but not yet released.

Can you give us a patch with those fixes so that we can compile Titan with the patch ourself until it's officially released?

Thanks
Murli
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723677 is a reply to message #1723650] Wed, 17 February 2016 08:13 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

there's a release procedure for minor releases ( such as CRL 113 200/5 R4C (5.4 pl2) was) and full releases
(CRL 113 200/5 R4A (5.4 pl0) ) we follow. There are a couple more requests I have to fit in and then I can release R4D.
This should not take more than maybe two weeks. I ask for your patience until then.

Thank you and best regards
Elemer

Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1723727 is a reply to message #1723677] Wed, 17 February 2016 11:36 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

Thanks for update.
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724163 is a reply to message #1723727] Mon, 22 February 2016 04:36 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

As stated earlier, in our ttcn script many templates have uninitialized fields which results in DTE.
To make our test cases run, we can assign `omit` to all such uninitialized fields for now but fixing one template then running then fixing other and so on is highly time consuming.

If you can tell me some way to temporarily disable the DTE for the error "Performing a valueof or send operation on a non-specific template of type ..." and generate warnings instead,
then we can fix all such uninitialized fields at once.

Thanks
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724201 is a reply to message #1724163] Mon, 22 February 2016 09:47 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

although this appears to be a solution, it really is not.
If we would disable DTE for this particular issue, than the program error would propagate to other parts of the code and would stop execution a couple of lines later. A corrupt variable/template would poison any other
variable/template it transfers value into.
DTE is meant to stop such propagation of programming errors.


I would assume you have your templates in a separate file , so it should not be very complicated to check them with the "isbound" logic as above,

or similarly with :

if (not(isvalue(sometemplate )))  { log (sometemplate)}



You can also protect your code in the file which is executed with these if statements, or with try /catch as suggested below.



Best regards

Elemer




Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724218 is a reply to message #1724201] Mon, 22 February 2016 10:42 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

I understand that.


Our problem is that we have around 800 test cases to run and very less time.
We can't wait till the official release of the next version of Titan.
Can you please give us the patch with the fix for making implicit omit work?

Thanks
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724222 is a reply to message #1724218] Mon, 22 February 2016 11:06 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

what's the platform you need Titan for?

Best regards

Elemer
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724226 is a reply to message #1724222] Mon, 22 February 2016 11:21 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

I need for Ubuntu 64 bit. Following are my system information:
Linux linaro 3.2.0-88-generic #126-Ubuntu SMP Mon Jul 6 21:33:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


Thanks
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724231 is a reply to message #1724226] Mon, 22 February 2016 12:11 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

that appears to be Ubuntu 14.04;

pls. download from:

https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-snapshot-nolicense-linux64-gcc4.8-ubuntu14.04.tgz


Best regards
Elemer
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724467 is a reply to message #1724231] Wed, 24 February 2016 06:10 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

Thanks a lot. This will save a lot of effort.

I have one related question. Does Titan supports the DEFAULT fields of ASN SEQUENCE?
I observed that Titan takes omit for DEFAULT fields instead of the default value specified in the ASN definition.

My ASN sequence looks like this:
MyData ::= SEQUENCE {
	n1 INTEGER DEFAULT 7,
	n2 INTEGER OPTIONAL
}


And its template is like this:
template MyData setMyData := {
} with {optional "implicit omit"}


When I do
log(valueof(setMyData));
It prints
{ n1 := omit, n2 := omit }
Where as `n2 == 7` was expected.

I'm attaching the script in which I tried this.

Thanks
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724508 is a reply to message #1724467] Wed, 24 February 2016 09:44 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

the way it works is the following:


one has to specify the default value in the TTCN-3 template as well:


Types DEFINITIONS AUTOMATIC TAGS ::=

BEGIN

MyData ::= SEQUENCE {
	n1 INTEGER DEFAULT 7,
	n2 INTEGER OPTIONAL
}
END




module Example {

	/* import types from ASN.1 */
	import from Types language "ASN.1:1997" all;

	type component Test {}
	type component SUT  {}
	
	template MyData setMyData := {
	} with {optional "implicit omit"}
	

	
	template MyData setMyData1 := {n1:= 7
	} with {optional "implicit omit"}
	
	// test case definition
	group TestCases {
		testcase test_msg_exchange() runs on Test system SUT {
			log("****************************************");
			log("ASN Seqence:");
			log(valueof(setMyData));
		}

		testcase test_msg_exchange1() runs on Test system SUT {
			log("****************************************");
			log("ASN Seqence:");
			log(valueof(setMyData1));
		}




	}
	
	control {
		execute(test_msg_exchange())
                execute(test_msg_exchange1())
	}
	
} with { encode "BER:1997" }



with the result:

10:38:03.096654 TTCN-3 Main Test Component started on esekilxxen1842. Version: CRL 113 200/5 R4C.
10:38:03.096791 TTCN Logger v2.2 options: TimeStampFormat:=Time; LogEntityName:=No; LogEventTypes:=No; SourceInfoFormat:=None; *.FileMask:=LOG_ALL; *.ConsoleMask:=LOG_ALL; LogFileSize:=0; LogFileNumber:=1; DiskFullAction:=Error
10:38:03.096879 Connected to MC.
10:38:03.103655 Executing control part of module Example.
10:38:03.103699 Execution of control part in module Example started.
10:38:03.103754 Test case test_msg_exchange started.
10:38:03.103793 Initializing variables, timers and ports of component type Example.Test inside testcase test_msg_exchange.
10:38:03.103842 Component type Example.Test was initialized.
10:38:03.103863 ****************************************
10:38:03.103881 ASN Seqence:
10:38:03.103899 { n1 := omit, n2 := omit }
10:38:03.103966 Terminating component type Example.Test.
10:38:03.103992 Component type Example.Test was shut down inside testcase test_msg_exchange.
10:38:03.104019 Waiting for PTCs to finish.
10:38:03.104118 Setting final verdict of the test case.
10:38:03.104163 Local verdict of MTC: none
10:38:03.104207 No PTCs were created.
10:38:03.104230 Test case test_msg_exchange finished. Verdict: none
10:38:03.104264 Test case test_msg_exchange1 started.
10:38:03.104286 Initializing variables, timers and ports of component type Example.Test inside testcase test_msg_exchange1.
10:38:03.104312 Component type Example.Test was initialized.
10:38:03.104333 ****************************************
10:38:03.104351 ASN Seqence:
10:38:03.104376 { n1 := 7, n2 := omit }
10:38:03.104415 Terminating component type Example.Test.
10:38:03.104437 Component type Example.Test was shut down inside testcase test_msg_exchange1.
10:38:03.104466 Waiting for PTCs to finish.
10:38:03.104543 Setting final verdict of the test case.
10:38:03.104572 Local verdict of MTC: none
10:38:03.104593 No PTCs were created.
10:38:03.104615 Test case test_msg_exchange1 finished. Verdict: none
10:38:03.104641 Execution of control part in module Example finished.
10:38:03.111636 Verdict statistics: 2 none (100.00 %), 0 pass (0.00 %), 0 inconc (0.00 %), 0 fail (0.00 %), 0 error (0.00 %).
10:38:03.111712 Test execution summary: 2 test cases were executed. Overall verdict: none
10:38:03.111735 Exit was requested from MC. Terminating MTC.


I admit it may be a bit counter intuitive; please also be aware that behaviour also depends on the -d switch and the chosen encoding BR vs. CER/DER (see description of the -d switch in the refguide)


I hope this helps

Best regards
Elemer





Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1724517 is a reply to message #1724508] Wed, 24 February 2016 10:06 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,
One more thing here for clarification:

the ASN.1 DEFAULT does not mean that the field qualified as such is optional; in the abstract layer representation it will still have to be present.
It refers to the transfer layer , meaning that it can be omitted during encoding.
DER/CER does not support this omission so in case of DER/CER , DEFAULT will have no effect practically.


Best regards
Elemer

Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1725931 is a reply to message #1724517] Tue, 08 March 2016 14:50 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

I have published R4D binaries; for Ubuntu 14.04 pls. download

https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.4.pl3-linux64-gcc4.8-ubuntu14.04.tgz
https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.4.pl3-linux64-gcc4.8-ubuntu14.04.tgz.sha512


Best regards
Elemer
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1726289 is a reply to message #1725931] Fri, 11 March 2016 06:30 Go to previous messageGo to next message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

I noticed, On github Titan version 5.4 pl3 has been released.
Does it contain the fixes you provided in the above binaries?

Thanks
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1726294 is a reply to message #1726289] Fri, 11 March 2016 07:42 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Hi Murli,

yes it does.

Best regards

Elemer
Re: Dynamic test case error: Performing a valueof or send operation on a non-specific template [message #1726296 is a reply to message #1726294] Fri, 11 March 2016 07:50 Go to previous message
murli sharma is currently offline murli sharmaFriend
Messages: 85
Registered: November 2015
Member
Hi Elemer,

Thanks for the info.
Previous Topic:Encoding text-based protocols in Titan
Next Topic:BITSTRING getting created reverse
Goto Forum:
  


Current Time: Fri Apr 19 18:59:54 GMT 2024

Powered by FUDForum. Page generated in 0.04399 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top