Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Are these equivalents?

Are these equivalents? 21 Aug 2006 15:43 #6936

Hi All,

I'm pretty sure that the following two tests have exactly the same
behaviour, but could anyone confirm this for me please; I just want to
be absolutely certain?

testcase testOne () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}

testcase testTwo () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}


Many Thanks

Ray Cheung


Motorola, Swindon, UK
The administrator has disabled public write access.

Are these equivalents? 21 Aug 2006 16:09 #6937

Ray,



In my opinion they have the same behavior. The messages received are processed the same way in both testcases.





[]'s







Rodolfo de A. Vasconcelos

Analista de Desenvolvimento


Venturus - Centro de Inovação Tecnológica

Rodovia Ermênio de Oliveira Penteado, Km 57,5
Indaiatuba - SP - Brasil - CEP 13330-972
Caixa Postal: 2.1.37



Fone: +55 (19) 3801-7817

Celular: +55 (19) 9266-5256



This email address is being protected from spambots. You need JavaScript enabled to view it. <This email address is being protected from spambots. You need JavaScript enabled to view it.>

www.venturus.org.br <BLOCKED::http://www.venturus.org.br/>

________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Cheung Ray-RCHEUNG1
Sent: segunda-feira, 21 de agosto de 2006 12:44
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Are these equivalents?



Hi All,



I'm pretty sure that the following two tests have exactly the same behaviour, but could anyone confirm this for me please; I just want to be absolutely certain?



testcase testOne () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}



[] any port.check
{
setverdict(fail);
stop;
}
}
}



[] any port.check
{
setverdict(fail);
stop;
}
}
}



testcase testTwo () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );
}



[] any port.check
{
setverdict(fail);
stop;
}
}



alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}



[] any port.check
{
setverdict(fail);
stop;
}
}
}



Many Thanks



Ray Cheung





Motorola, Swindon, UK
The administrator has disabled public write access.

Are these equivalents? 21 Aug 2006 16:09 #6938

Ray,



In my opinion they have the same behavior. The messages received are processed the same way in both testcases.





[]'s







Rodolfo de A. Vasconcelos

Analista de Desenvolvimento


Venturus - Centro de Inovação Tecnológica

Rodovia Ermênio de Oliveira Penteado, Km 57,5
Indaiatuba - SP - Brasil - CEP 13330-972
Caixa Postal: 2.1.37



Fone: +55 (19) 3801-7817

Celular: +55 (19) 9266-5256



This email address is being protected from spambots. You need JavaScript enabled to view it. <This email address is being protected from spambots. You need JavaScript enabled to view it.>

www.venturus.org.br <BLOCKED::http://www.venturus.org.br/>

________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Cheung Ray-RCHEUNG1
Sent: segunda-feira, 21 de agosto de 2006 12:44
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Are these equivalents?



Hi All,



I'm pretty sure that the following two tests have exactly the same behaviour, but could anyone confirm this for me please; I just want to be absolutely certain?



testcase testOne () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}



[] any port.check
{
setverdict(fail);
stop;
}
}
}



[] any port.check
{
setverdict(fail);
stop;
}
}
}



testcase testTwo () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );
}



[] any port.check
{
setverdict(fail);
stop;
}
}



alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}



[] any port.check
{
setverdict(fail);
stop;
}
}
}



Many Thanks



Ray Cheung





Motorola, Swindon, UK
The administrator has disabled public write access.

Are these equivalents? 22 Aug 2006 07:00 #6939

Hi Ray,
basically both behave in the same way, but I think that it could be good if you try to use "Interleaved behaviour" (see ETSI ES 201 873-4).
Regards.

Sergio Lobato.
Cetecom, Spain.

_____

De: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Cheung Ray-RCHEUNG1
Enviado el: lunes, 21 de agosto de 2006 17:44
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Are these equivalents?


Hi All,

I'm pretty sure that the following two tests have exactly the same behaviour, but could anyone confirm this for me please; I just want to be absolutely certain?

testcase testOne () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}

testcase testTwo () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}


Many Thanks

Ray Cheung


Motorola, Swindon, UK
The administrator has disabled public write access.

Are these equivalents? 22 Aug 2006 07:46 #6940

  • G
  • G's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 0
Hi,

Since Your test purpose seems to be a given sequential behavior You might consider using an altstep, which would result in a more simple and more structured (therefore, more readable and maintainable) code:
//
altstep as_checkAnyPort() runs on MTCType {
[] any port.check
{
setverdict(fail);
stop;
}
}

testcase singleTestCase runs on MTCType {

var default mydefault := activate(as_checkAnyPort());

pcoA.receive( msgA );
pcoB.receive( msgB );
setverdict(pass);
}
//


Regards,

Gábor Ziegler M.Sc.E.E., dr.univ
Test System Engineer

Ericsson Hungary Ltd.
Research & Development


________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Sergio Lobato López
Sent: 2006. augusztus 22. 9:00
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Are these equivalents?


Hi Ray,
basically both behave in the same way, but I think that it could be good if you try to use "Interleaved behaviour" (see ETSI ES 201 873-4).
Regards.

Sergio Lobato.
Cetecom, Spain.

________________________________

De: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Cheung Ray-RCHEUNG1
Enviado el: lunes, 21 de agosto de 2006 17:44
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Are these equivalents?


Hi All,

I'm pretty sure that the following two tests have exactly the same behaviour, but could anyone confirm this for me please; I just want to be absolutely certain?

testcase testOne () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}

testcase testTwo () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}


Many Thanks

Ray Cheung


Motorola, Swindon, UK
The administrator has disabled public write access.

Are these equivalents? 22 Aug 2006 08:33 #6941

Hi,

Many thanks for all the responses.

I really like the idea below, but is this subject to tool vendor implementation or is it really an official TTCN3 language feature? Because:

Sect. 21.1 of the Core Language spec says, "... The default mechanism is evoked at the end of each **alt** statement ...". Since "testcase singleTestCase" below does not contain any "alt" statements, will "altstep as_checkAnyPort" really be invoked if either of the "receive" statements did not match?

Sect. 23.2.2 says "... The **receive** operation removes the top message ... if, and only if, that top message satisfies all the matching criteria ... If the match is not successful, the top message shall not be removed ... If the **receive** operation is used as an alternative of an **alt** statement ..., the execution shall continue with the next alternative of the **alt** statement."

It seems to imply that if "testcase singleTestCase" receives msgXXX on pcoA and receives msgYYY on pcoB, then I'm going to get a pass verdict.


Thanks

Ray


Original Message
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Gábor Ziegler (IJ/ETH)
Sent: 22 August 2006 08:47
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Are these equivalents?

Hi,

Since Your test purpose seems to be a given sequential behavior You might consider using an altstep, which would result in a more simple and more structured (therefore, more readable and maintainable) code:
//
altstep as_checkAnyPort() runs on MTCType { [] any port.check
{
setverdict(fail);
stop;
}
}

testcase singleTestCase runs on MTCType {

var default mydefault := activate(as_checkAnyPort());

pcoA.receive( msgA );
pcoB.receive( msgB );
setverdict(pass);
}
//


Regards,

Gábor Ziegler M.Sc.E.E., dr.univ
Test System Engineer

Ericsson Hungary Ltd.
Research & Development


________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Sergio Lobato López
Sent: 2006. augusztus 22. 9:00
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Are these equivalents?


Hi Ray,
basically both behave in the same way, but I think that it could be good if you try to use "Interleaved behaviour" (see ETSI ES 201 873-4).
Regards.

Sergio Lobato.
Cetecom, Spain.

________________________________

De: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Cheung Ray-RCHEUNG1
Enviado el: lunes, 21 de agosto de 2006 17:44
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Are these equivalents?


Hi All,

I'm pretty sure that the following two tests have exactly the same behaviour, but could anyone confirm this for me please; I just want to be absolutely certain?

testcase testOne () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}

testcase testTwo () runs on MTCType
{
alt
{
[] pcoA.receive( msgA )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}

alt
{
[] pcoB.receive( msgB )
{
setverdict( pass );
}

[] any port.check
{
setverdict(fail);
stop;
}
}
}


Many Thanks

Ray Cheung


Motorola, Swindon, UK
The administrator has disabled public write access.

Are these equivalents? 22 Aug 2006 10:14 #6942

  • G
  • G's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 0
Hi,


>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Cheung
> Ray-RCHEUNG1
> Sent: 2006. augusztus 22. 10:33
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
> Hi,
>
> Many thanks for all the responses.
>
> I really like the idea below, but is this subject to tool
> vendor implementation or is it really an official TTCN3
> language feature?
The latter.

> Because:
>
> Sect. 21.1 of the Core Language spec says, "... The default
> mechanism is evoked at the end of each **alt** statement
> ...". Since "testcase singleTestCase" below does not contain
> any "alt" statements, will "altstep as_checkAnyPort" really
> be invoked if either of the "receive" statements did not match?

On the contrary, "testcase singleTestCase" does contain two altsteps.

Please refer to the introductory text of Section 7 of the Operational Semantics (ETSI ES 201 873-4 V3.1.1 (2005-06)) of the TTCN-3 language:
"Short forms have to be expanded by the corresponding complete definitions on a textual level before this operational
semantics can be used for the explanation of TTCN-3 behavior."

Then refer to Section 7.3 of the same standard mentioned just above:
"A receiving operation can be used as stand-alone statement in a function, an altstep or a test case. [..] In such a case the receiving operation as
considered to be shorthand for an alt statement with only one alternative defined by the receiving operation."

It means that the default context of the test component does apply to single receiving statements, as well.


>
> Sect. 23.2.2 says "... The **receive** operation removes the
> top message ... if, and only if, that top message satisfies
> all the matching criteria ... If the match is not successful,
> the top message shall not be removed ... If the **receive**
> operation is used as an alternative of an **alt** statement
> ..., the execution shall continue with the next alternative
> of the **alt** statement."
>
> It seems to imply that if "testcase singleTestCase" receives
> msgXXX on pcoA and receives msgYYY on pcoB, then I'm going to
> get a pass verdict.

No. If it receives msgXXX on pcoA first then
* either the first single receive statement would be considered "successful" according to the snapshot semantics (provided that the message msgXXX matches the specified receive template msgA) and it would first silently remove the message from the queue then proceed execution with the second single receive statement,
* or it would block (provided that the message msgXXX does not match the specified receive template msgA), therefore it would be considered unsuccessful. In this latter case the execution would block forever. However, the activated default would save your poor ass and it would assign a fail verdict, then it would successfully exit the testcase with the "stop;" statement.

Regards,

Gábor Ziegler M.Sc.E.E., dr.univ
Test System Engineer

Ericsson Hungary Ltd.
Research & Development

>
>
> Thanks
>
> Ray
>
>
>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Gábor
> Ziegler (IJ/ETH)
> Sent: 22 August 2006 08:47
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
> Hi,
>
> Since Your test purpose seems to be a given sequential
> behavior You might consider using an altstep, which would
> result in a more simple and more structured (therefore, more
> readable and maintainable) code:
> //
> altstep as_checkAnyPort() runs on MTCType { [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
>
> testcase singleTestCase runs on MTCType {
>
> var default mydefault := activate(as_checkAnyPort());
>
> pcoA.receive( msgA );
> pcoB.receive( msgB );
> setverdict(pass);
> }
> //
>
>
> Regards,
>
> Gábor Ziegler M.Sc.E.E., dr.univ
> Test System Engineer
>
> Ericsson Hungary Ltd.
> Research & Development
>
>
> ________________________________
>
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Sergio
> Lobato López
> Sent: 2006. augusztus 22. 9:00
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
>
> Hi Ray,
> basically both behave in the same way, but I think that
> it could be good if you try to use "Interleaved behaviour"
> (see ETSI ES 201 873-4).
> Regards.
>
> Sergio Lobato.
> Cetecom, Spain.
>
> ________________________________
>
> De: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Cheung
> Ray-RCHEUNG1
> Enviado el: lunes, 21 de agosto de 2006 17:44
> Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Asunto: Are these equivalents?
>
>
> Hi All,
>
> I'm pretty sure that the following two tests have
> exactly the same behaviour, but could anyone confirm this for
> me please; I just want to be absolutely certain?
>
> testcase testOne () runs on MTCType
> {
> alt
> {
> [] pcoA.receive( msgA )
> {
> setverdict( pass );
>
> alt
> {
> [] pcoB.receive( msgB )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
> testcase testTwo () runs on MTCType
> {
> alt
> {
> [] pcoA.receive( msgA )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
>
> alt
> {
> [] pcoB.receive( msgB )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
>
> Many Thanks
>
> Ray Cheung
>
>
> Motorola, Swindon, UK
>
>
The administrator has disabled public write access.

Are these equivalents? 22 Aug 2006 10:25 #6943

Many thanks for the clarification. That's very useful to know.

Regards

Ray


Original Message
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Gábor Ziegler (IJ/ETH)
Sent: 22 August 2006 11:14
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Are these equivalents?


Hi,


>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Cheung
> Ray-RCHEUNG1
> Sent: 2006. augusztus 22. 10:33
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
> Hi,
>
> Many thanks for all the responses.
>
> I really like the idea below, but is this subject to tool vendor
> implementation or is it really an official TTCN3 language feature?
The latter.

> Because:
>
> Sect. 21.1 of the Core Language spec says, "... The default mechanism
> is evoked at the end of each **alt** statement ...". Since "testcase
> singleTestCase" below does not contain any "alt" statements, will
> "altstep as_checkAnyPort" really be invoked if either of the "receive"
> statements did not match?

On the contrary, "testcase singleTestCase" does contain two altsteps.

Please refer to the introductory text of Section 7 of the Operational Semantics (ETSI ES 201 873-4 V3.1.1 (2005-06)) of the TTCN-3 language:
"Short forms have to be expanded by the corresponding complete definitions on a textual level before this operational semantics can be used for the explanation of TTCN-3 behavior."

Then refer to Section 7.3 of the same standard mentioned just above:
"A receiving operation can be used as stand-alone statement in a function, an altstep or a test case. [..] In such a case the receiving operation as considered to be shorthand for an alt statement with only one alternative defined by the receiving operation."

It means that the default context of the test component does apply to single receiving statements, as well.


>
> Sect. 23.2.2 says "... The **receive** operation removes the top
> message ... if, and only if, that top message satisfies all the
> matching criteria ... If the match is not successful, the top message
> shall not be removed ... If the **receive** operation is used as an
> alternative of an **alt** statement ..., the execution shall continue
> with the next alternative of the **alt** statement."
>
> It seems to imply that if "testcase singleTestCase" receives msgXXX on
> pcoA and receives msgYYY on pcoB, then I'm going to get a pass
> verdict.

No. If it receives msgXXX on pcoA first then
* either the first single receive statement would be considered "successful" according to the snapshot semantics (provided that the message msgXXX matches the specified receive template msgA) and it would first silently remove the message from the queue then proceed execution with the second single receive statement,
* or it would block (provided that the message msgXXX does not match the specified receive template msgA), therefore it would be considered unsuccessful. In this latter case the execution would block forever. However, the activated default would save your poor ass and it would assign a fail verdict, then it would successfully exit the testcase with the "stop;" statement.

Regards,

Gábor Ziegler M.Sc.E.E., dr.univ
Test System Engineer

Ericsson Hungary Ltd.
Research & Development

>
>
> Thanks
>
> Ray
>
>
>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Gábor Ziegler (IJ/ETH)
> Sent: 22 August 2006 08:47
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
> Hi,
>
> Since Your test purpose seems to be a given sequential behavior You
> might consider using an altstep, which would result in a more simple
> and more structured (therefore, more readable and maintainable) code:
> //
> altstep as_checkAnyPort() runs on MTCType { [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
>
> testcase singleTestCase runs on MTCType {
>
> var default mydefault := activate(as_checkAnyPort());
>
> pcoA.receive( msgA );
> pcoB.receive( msgB );
> setverdict(pass);
> }
> //
>
>
> Regards,
>
> Gábor Ziegler M.Sc.E.E., dr.univ
> Test System Engineer
>
> Ericsson Hungary Ltd.
> Research & Development
>
>
> ________________________________
>
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Sergio Lobato López
> Sent: 2006. augusztus 22. 9:00
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
>
> Hi Ray,
> basically both behave in the same way, but I think that it could be
> good if you try to use "Interleaved behaviour"
> (see ETSI ES 201 873-4).
> Regards.
>
> Sergio Lobato.
> Cetecom, Spain.
>
> ________________________________
>
> De: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Cheung
> Ray-RCHEUNG1
> Enviado el: lunes, 21 de agosto de 2006 17:44
> Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Asunto: Are these equivalents?
>
>
> Hi All,
>
> I'm pretty sure that the following two tests have exactly the same
> behaviour, but could anyone confirm this for me please; I just want to
> be absolutely certain?
>
> testcase testOne () runs on MTCType
> {
> alt
> {
> [] pcoA.receive( msgA )
> {
> setverdict( pass );
>
> alt
> {
> [] pcoB.receive( msgB )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
> testcase testTwo () runs on MTCType
> {
> alt
> {
> [] pcoA.receive( msgA )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
>
> alt
> {
> [] pcoB.receive( msgB )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
>
> Many Thanks
>
> Ray Cheung
>
>
> Motorola, Swindon, UK
>
>
The administrator has disabled public write access.

Are these equivalents? 22 Aug 2006 11:36 #6944

Hi Ray,

without looking for citations from the standard: a single receive is an alt statement with one alternative - meaning that in the case of no match, activated defaults will be invoked in their order.

With best regards,

Ina.

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Cheung
> Ray-RCHEUNG1
> Sent: Tuesday, August 22, 2006 10:33 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
> Hi,
>
> Many thanks for all the responses.
>
> I really like the idea below, but is this subject to tool vendor
> implementation or is it really an official TTCN3 language feature?
> Because:
>
> Sect. 21.1 of the Core Language spec says, "... The default mechanism
> is evoked at the end of each **alt** statement ...". Since "testcase
> singleTestCase" below does not contain any "alt" statements, will
> "altstep as_checkAnyPort" really be invoked if either of the "receive"
> statements did not match?
>
> Sect. 23.2.2 says "... The **receive** operation removes the top
> message ... if, and only if, that top message satisfies all the
> matching criteria ... If the match is not successful, the top message
> shall not be removed ... If the **receive** operation is used as an
> alternative of an **alt** statement ..., the execution shall continue
> with the next alternative of the **alt** statement."
>
> It seems to imply that if "testcase singleTestCase" receives msgXXX on
> pcoA and receives msgYYY on pcoB, then I'm going to get a pass
> verdict.
>
>
> Thanks
>
> Ray
>
>
>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Gábor Ziegler (IJ/ETH)
> Sent: 22 August 2006 08:47
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
> Hi,
>
> Since Your test purpose seems to be a given sequential behavior You
> might consider using an altstep, which would result in a more simple
> and more structured (therefore, more readable and maintainable) code:
> //
> altstep as_checkAnyPort() runs on MTCType { [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
>
> testcase singleTestCase runs on MTCType {
>
> var default mydefault := activate(as_checkAnyPort());
>
> pcoA.receive( msgA );
> pcoB.receive( msgB );
> setverdict(pass);
> }
> //
>
>
> Regards,
>
> Gábor Ziegler M.Sc.E.E., dr.univ
> Test System Engineer
>
> Ericsson Hungary Ltd.
> Research & Development
>
>
> ________________________________
>
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Sergio Lobato López
> Sent: 2006. augusztus 22. 9:00
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Are these equivalents?
>
>
> Hi Ray,
> basically both behave in the same way, but I think that it could be
> good if you try to use "Interleaved behaviour"
> (see ETSI ES 201 873-4).
> Regards.
>
> Sergio Lobato.
> Cetecom, Spain.
>
> ________________________________
>
> De: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Cheung
> Ray-RCHEUNG1
> Enviado el: lunes, 21 de agosto de 2006 17:44
> Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Asunto: Are these equivalents?
>
>
> Hi All,
>
> I'm pretty sure that the following two tests have exactly the same
> behaviour, but could anyone confirm this for me please; I just want to
> be absolutely certain?
>
> testcase testOne () runs on MTCType
> {
> alt
> {
> [] pcoA.receive( msgA )
> {
> setverdict( pass );
>
> alt
> {
> [] pcoB.receive( msgB )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
> testcase testTwo () runs on MTCType
> {
> alt
> {
> [] pcoA.receive( msgA )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
>
> alt
> {
> [] pcoB.receive( msgB )
> {
> setverdict( pass );
> }
>
> [] any port.check
> {
> setverdict(fail);
> stop;
> }
> }
> }
>
>
> Many Thanks
>
> Ray Cheung
>
>
> Motorola, Swindon, UK
>
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin