|
From: <ma...@us...> - 2009-09-13 23:56:11
|
Revision: 329
http://scstudio.svn.sourceforge.net/scstudio/?rev=329&view=rev
Author: madzin
Date: 2009-09-13 23:56:04 +0000 (Sun, 13 Sep 2009)
Log Message:
-----------
Fix z120_test45.mpr. When a file contains partial declaration of complete message, the parser creates incomplete message and prints a warning.
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/tests/z120_test/CMakeLists.txt
Added Paths:
-----------
trunk/tests/z120_test/z120_test45.mpr.result
trunk/tests/z120_test/z120_test51.mpr
trunk/tests/z120_test/z120_test51.mpr.result
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2009-09-12 15:34:00 UTC (rev 328)
+++ trunk/src/data/Z120/Context.cpp 2009-09-13 23:56:04 UTC (rev 329)
@@ -254,6 +254,22 @@
if(!context->messages.empty()){
context->z->print_report(RS_WARNING, L"Warning 05: There is complete message with only one event\n");
+
+ IncompleteMessagePtr message;
+ std::multimap<std::string, CompleteMessagePtr>::iterator msg_it;
+
+ for(msg_it = context->messages.begin(); msg_it != context->messages.end(); msg_it++)
+ {
+ if(msg_it->second->get_send_event() == NULL){
+ message = new IncompleteMessage(FOUND, msg_it->second->get_label());
+ message->glue_event(msg_it->second->get_receive_event());
+ }
+ else
+ {
+ message = new IncompleteMessage(LOST, msg_it->second->get_label());
+ message->glue_event(msg_it->second->get_send_event());
+ }
+ }
}
if(!context->future_events.empty()){
Modified: trunk/tests/z120_test/CMakeLists.txt
===================================================================
--- trunk/tests/z120_test/CMakeLists.txt 2009-09-12 15:34:00 UTC (rev 328)
+++ trunk/tests/z120_test/CMakeLists.txt 2009-09-13 23:56:04 UTC (rev 329)
@@ -65,11 +65,13 @@
ADD_Z120_TEST(z120_test42.mpr 1)
ADD_Z120_TEST(z120_test43.mpr 0)
ADD_Z120_TEST(z120_test44.mpr 0)
-ADD_Z120_TEST(z120_test45.mpr 0)
+ADD_Z120_TEST(z120_test45.mpr 1)
ADD_Z120_TEST(z120_test46.mpr 0)
ADD_Z120_TEST(z120_test47.mpr 1)
ADD_Z120_TEST(z120_test48.mpr 0)
ADD_Z120_TEST(z120_test49.mpr 1)
ADD_Z120_TEST(z120_test50.mpr 0)
+ADD_Z120_TEST(z120_test51.mpr 1)
+
# $Id$
Added: trunk/tests/z120_test/z120_test45.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test45.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test45.mpr.result 2009-09-13 23:56:04 UTC (rev 329)
@@ -0,0 +1,20 @@
+Warning 05: There is complete message with only one event
+
+OK: z120_test45 is correct, should be correct
+
+mscdocument z120_test45;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+in A,0 from found;
+concurrent;
+label e0; out B1,1 to B;
+label e1; out B,2 to lost;
+endconcurrent;
+endinstance;
+B: instance;
+in jedna,3 from found;
+in B1,1 from A;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test51.mpr
===================================================================
--- trunk/tests/z120_test/z120_test51.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test51.mpr 2009-09-13 23:56:04 UTC (rev 329)
@@ -0,0 +1,19 @@
+/*****************************************************
+Simple test of bmsc (event driven notification)
+
+******************************************************/
+
+mscdocument bbb;
+msc pok2;
+A: instance;
+B: instance;
+A: in A,1 from found;
+A: out jedna,2 to B;
+A: concurrent;
+A: out B1,3 to B;
+B: in B1,3 from A;
+A: out B,4 to lost;
+A: endconcurrent;
+A: endinstance;
+B: endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test51.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test51.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test51.mpr.result 2009-09-13 23:56:04 UTC (rev 329)
@@ -0,0 +1,20 @@
+Warning 05: There is complete message with only one event
+
+OK: z120_test51 is correct, should be correct
+
+mscdocument z120_test51;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+in A,0 from found;
+out jedna,1 to lost;
+concurrent;
+label e0; out B1,2 to B;
+label e1; out B,3 to lost;
+endconcurrent;
+endinstance;
+B: instance;
+in B1,2 from A;
+endinstance;
+endmsc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|