|
From: <got...@us...> - 2009-07-06 09:43:09
|
Revision: 259
http://scstudio.svn.sourceforge.net/scstudio/?rev=259&view=rev
Author: gotthardp
Date: 2009-07-06 09:43:03 +0000 (Mon, 06 Jul 2009)
Log Message:
-----------
Removed some link errors on Win32 platforms.
Modified Paths:
--------------
trunk/src/check/time/CMakeLists.txt
trunk/src/check/time/time_consistency.h
trunk/src/data/time.h
trunk/tests/CMakeLists.txt
Modified: trunk/src/check/time/CMakeLists.txt
===================================================================
--- trunk/src/check/time/CMakeLists.txt 2009-07-06 07:12:18 UTC (rev 258)
+++ trunk/src/check/time/CMakeLists.txt 2009-07-06 09:43:03 UTC (rev 259)
@@ -10,5 +10,6 @@
TARGET_LINK_LIBRARIES(sctime
scmsc
+ scpseudocode
)
Modified: trunk/src/check/time/time_consistency.h
===================================================================
--- trunk/src/check/time/time_consistency.h 2009-07-06 07:12:18 UTC (rev 258)
+++ trunk/src/check/time/time_consistency.h 2009-07-06 09:43:03 UTC (rev 259)
@@ -143,7 +143,7 @@
};
-class FloydWarshall:
+class SCTIME_EXPORT FloydWarshall:
public MscIntervalTightener,
public MscIntervalConsistencyCheck
{
@@ -160,7 +160,7 @@
{}
};
-class MscSolveTCSP
+class SCTIME_EXPORT MscSolveTCSP
{
private:
MscIntervalTightener* tightener;
@@ -184,7 +184,7 @@
IntervalSetMatrix solve(const IntervalSetMatrix& m);
};
-class BmscMatrixConverter:public WhiteEventFoundListener
+class SCTIME_EXPORT BmscMatrixConverter:public WhiteEventFoundListener
{
private:
// Vector of all events - event <-- matrix number
Modified: trunk/src/data/time.h
===================================================================
--- trunk/src/data/time.h 2009-07-06 07:12:18 UTC (rev 258)
+++ trunk/src/data/time.h 2009-07-06 09:43:03 UTC (rev 259)
@@ -19,6 +19,8 @@
#ifndef _TIME_H_
#define _TIME_H_
+#include "data/export.h"
+
#include<limits.h>
#include<algorithm>
#include<exception>
@@ -270,7 +272,7 @@
* @brief class representing couple value-number and bracket
*/
template<class T>
-class MscIntervalCouple
+class SCMSC_EXPORT MscIntervalCouple
{
private:
bool m_closed;
@@ -457,7 +459,7 @@
* @brief class representing Interval
*/
template<class T>
-class MscTimeInterval
+class SCMSC_EXPORT MscTimeInterval
{
private:
MscIntervalCouple<T> m_begin;
@@ -812,7 +814,7 @@
* Keeping sorted list of intervals, dont have intersection
*/
template<class T>
-class MscTimeIntervalSet
+class SCMSC_EXPORT MscTimeIntervalSet
{
private:
typedef std::list< MscTimeInterval<T> > IntervalList;
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2009-07-06 07:12:18 UTC (rev 258)
+++ trunk/tests/CMakeLists.txt 2009-07-06 09:43:03 UTC (rev 259)
@@ -108,12 +108,23 @@
ADD_EXECUTABLE(decimal_test
decimal_test.cpp
)
+TARGET_LINK_LIBRARIES(decimal_test
+ scmsc
+)
+
ADD_EXECUTABLE(interval_test
interval_test.cpp
)
+TARGET_LINK_LIBRARIES(interval_test
+ scmsc
+)
+
ADD_EXECUTABLE(interval_set_test
interval_set_test.cpp
)
+TARGET_LINK_LIBRARIES(interval_set_test
+ scmsc
+)
ADD_EXECUTABLE(interval_string
interval_string.cpp
@@ -130,7 +141,6 @@
ADD_EXECUTABLE(bmsc_matrix_converter_test
bmsc_matrix_converter_test.cpp
)
-
TARGET_LINK_LIBRARIES(bmsc_matrix_converter_test
scmsc
sctime
@@ -140,7 +150,6 @@
ADD_EXECUTABLE(incon_test
incon_test.cpp
)
-
TARGET_LINK_LIBRARIES(incon_test
scmsc
sctime
@@ -150,18 +159,15 @@
ADD_EXECUTABLE(tighten_msc_test
tighten_msc_test.cpp
)
-
TARGET_LINK_LIBRARIES(tighten_msc_test
scmsc
sctime
-
scpseudocode
)
ADD_EXECUTABLE(bmsc_tightening_test
bmsc_tightening_test.cpp
)
-
TARGET_LINK_LIBRARIES(bmsc_tightening_test
scmsc
sctime
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <va...@us...> - 2009-07-07 15:09:24
|
Revision: 260
http://scstudio.svn.sourceforge.net/scstudio/?rev=260&view=rev
Author: vacek
Date: 2009-07-07 15:09:15 +0000 (Tue, 07 Jul 2009)
Log Message:
-----------
Local Choice Initial Commit, no functionality yet
Modified Paths:
--------------
trunk/src/check/CMakeLists.txt
trunk/tests/CMakeLists.txt
Added Paths:
-----------
trunk/src/check/localchoice/
trunk/src/check/localchoice/CMakeLists.txt
trunk/src/check/localchoice/export.h
trunk/src/check/localchoice/local_choice_checker.cpp
trunk/src/check/localchoice/local_choice_checker.h
trunk/src/check/localchoice/module.cpp
trunk/tests/local_choice_checker_test.cpp
Modified: trunk/src/check/CMakeLists.txt
===================================================================
--- trunk/src/check/CMakeLists.txt 2009-07-06 09:43:03 UTC (rev 259)
+++ trunk/src/check/CMakeLists.txt 2009-07-07 15:09:15 UTC (rev 260)
@@ -7,5 +7,6 @@
ADD_SUBDIRECTORY(boundedness)
ADD_SUBDIRECTORY(structure)
ADD_SUBDIRECTORY(time)
+ADD_SUBDIRECTORY(localchoice)
# $Id$
Added: trunk/src/check/localchoice/CMakeLists.txt
===================================================================
--- trunk/src/check/localchoice/CMakeLists.txt (rev 0)
+++ trunk/src/check/localchoice/CMakeLists.txt 2009-07-07 15:09:15 UTC (rev 260)
@@ -0,0 +1,18 @@
+ADD_LIBRARY(sclocalchoice SHARED
+ export.h
+ module.cpp
+ local_choice_checker.cpp
+ local_choice_checker.h
+)
+
+TARGET_LINK_LIBRARIES(sclocalchoice
+ scmsc
+ scpseudocode
+)
+
+INSTALL(TARGETS sclocalchoice
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+# $Id:$
Added: trunk/src/check/localchoice/export.h
===================================================================
--- trunk/src/check/localchoice/export.h (rev 0)
+++ trunk/src/check/localchoice/export.h 2009-07-07 15:09:15 UTC (rev 260)
@@ -0,0 +1,37 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2008 Petr Gotthard <pet...@ce...>
+ *
+ * $Id$
+ */
+
+#ifndef _SCLOCALCHOICE_EXPORT_H
+#define _SCLOCALCHOICE_EXPORT_H
+
+#if defined(_MSC_VER)
+#pragma warning(disable: 4251)
+
+#if defined(sclocalchoice_EXPORTS)
+#define SCLOCALCHOICE_EXPORT __declspec(dllexport)
+#else
+#define SCLOCALCHOICE_EXPORT __declspec(dllimport)
+#endif
+
+#else
+#define SCLOCALCHOICE_EXPORT
+#endif
+
+#endif /* _SCLOCALCHOICE_EXPORT_H*/
+
+// $Id$
Property changes on: trunk/src/check/localchoice/export.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/src/check/localchoice/local_choice_checker.cpp
===================================================================
--- trunk/src/check/localchoice/local_choice_checker.cpp (rev 0)
+++ trunk/src/check/localchoice/local_choice_checker.cpp 2009-07-07 15:09:15 UTC (rev 260)
@@ -0,0 +1,43 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2008 V\xE1clav Vacek <va...@ic...>
+ *
+ * $Id$
+ */
+
+#include "check/localchoice/local_choice_checker.h"
+
+LocalChoiceCheckerPtr LocalChoiceChecker::m_instance;
+
+HMscPtr LocalChoiceChecker::create_counter_example(const MscElementPList &path)
+{
+ return NULL;
+}
+
+HMscPtr LocalChoiceChecker::check(HMscPtr hmsc, ChannelMapperPtr chm)
+{
+ return NULL;
+}
+
+void LocalChoiceChecker::cleanup_attributes(void)
+{
+}
+
+Checker::PreconditionList LocalChoiceChecker::get_preconditions(MscPtr msc) const
+{
+ Checker::PreconditionList result;
+ result.push_back(CheckerPrecondition(L"Unique Instance Names", PP_RECOMMENDED));
+
+ return result;
+}
\ No newline at end of file
Property changes on: trunk/src/check/localchoice/local_choice_checker.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/src/check/localchoice/local_choice_checker.h
===================================================================
--- trunk/src/check/localchoice/local_choice_checker.h (rev 0)
+++ trunk/src/check/localchoice/local_choice_checker.h 2009-07-07 15:09:15 UTC (rev 260)
@@ -0,0 +1,83 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2008 V\xE1clav Vacek <va...@ic...>
+ *
+ * $Id$
+ */
+
+#include "data/checker.h"
+#include "data/msc.h"
+#include "check/pseudocode/msc_duplicators.h"
+#include "check/localchoice/export.h"
+
+
+class LocalChoiceChecker;
+
+
+typedef boost::shared_ptr<LocalChoiceChecker> LocalChoiceCheckerPtr;
+
+
+class SCLOCALCHOICE_EXPORT LocalChoiceChecker: public Checker, public HMscChecker
+{
+protected:
+
+ /**
+ * Common instance.
+ */
+ static LocalChoiceCheckerPtr m_instance;
+
+ HMscPtr create_counter_example(const MscElementPList &path);
+
+
+public:
+
+ LocalChoiceChecker(){};
+ /**
+ * Human readable name of the property being checked.
+ */
+ // note: DLL in Windows cannot return pointers to static data
+ virtual std::wstring get_property_name() const
+ { return L"Local Choice"; }
+
+ virtual PreconditionList get_preconditions(MscPtr msc) const;
+
+ /**
+ * Checks whether hmsc satisfy universal boundedness property.
+ */
+ HMscPtr check(HMscPtr hmsc, ChannelMapperPtr chm);
+
+ /**
+ * Cleans up no more needed attributes.
+ */
+ void cleanup_attributes();
+
+ /**
+ * Supports all mappers
+ */
+ bool is_supported(ChannelMapperPtr chm)
+ {
+ return true;
+ }
+
+
+ static LocalChoiceCheckerPtr instance()
+ {
+ if(!m_instance.get())
+ m_instance = LocalChoiceCheckerPtr(new LocalChoiceChecker());
+ return m_instance;
+ }
+
+};
+
+// $Id$
Property changes on: trunk/src/check/localchoice/local_choice_checker.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/src/check/localchoice/module.cpp
===================================================================
--- trunk/src/check/localchoice/module.cpp (rev 0)
+++ trunk/src/check/localchoice/module.cpp 2009-07-07 15:09:15 UTC (rev 260)
@@ -0,0 +1,33 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2009 Petr Gotthard <pet...@ce...>
+ *
+ * $Id$
+ */
+
+#include "check/localchoice/local_choice_checker.h"
+
+// module initialization function
+// note: the Visio add-on searches for a function of this name
+extern "C" SCLOCALCHOICE_EXPORT
+Checker** init_checkers()
+{
+ Checker **result = new Checker* [2];
+ result[0] = new LocalChoiceChecker();
+ result[1] = NULL;
+
+ return result;
+}
+
+// $Id$
Property changes on: trunk/src/check/localchoice/module.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2009-07-06 09:43:03 UTC (rev 259)
+++ trunk/tests/CMakeLists.txt 2009-07-07 15:09:15 UTC (rev 260)
@@ -10,6 +10,18 @@
)
ADD_TEST(universal_boundedness_checker ${EXECUTABLE_OUTPUT_PATH}/universal_boundedness_checker_test)
+ADD_EXECUTABLE(local_choice_checker_test
+ local_choice_checker_test.cpp
+)
+TARGET_LINK_LIBRARIES(local_choice_checker_test
+ sclocalchoice
+ scmsc
+ scpseudocode
+)
+ADD_TEST(local_choice_checker
+ ${EXECUTABLE_OUTPUT_PATH}/local_choice_checker_test)
+
+
ADD_EXECUTABLE(deadlock_checker_test
deadlock_checker_test.cpp
)
Added: trunk/tests/local_choice_checker_test.cpp
===================================================================
--- trunk/tests/local_choice_checker_test.cpp (rev 0)
+++ trunk/tests/local_choice_checker_test.cpp 2009-07-07 15:09:15 UTC (rev 260)
@@ -0,0 +1,211 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2009 V\xE1clav Vacek <va...@ic...>
+ *
+ * $Id$
+ */
+
+#include "data/msc.h"
+#include "check/localchoice/local_choice_checker.h"
+
+
+#include <iostream>
+
+#define RETURN_IF_FAILED(res) if(!(res)) return 1;
+
+bool print_result(const HMscPtr hmsc,const bool is_local_choice)
+{
+ bool result = true;
+
+
+ return result;
+}
+
+bool check(HMscPtr hmsc,const bool is_local_choice)
+{
+ LocalChoiceCheckerPtr checker = LocalChoiceChecker::instance();
+
+ SRChannelMapperPtr srm = SRChannelMapper::instance();
+
+ return print_result(checker->check(hmsc,srm),is_local_choice);
+}
+
+bool HMscA() {
+ std::cout << "Checking this bmsc in a cycle:" << std::endl;
+ std::cout << " p1 p2 " << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << "e1 O-----a----->O e3" << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << "e2 O<----a------O e4" << std::endl;
+ std::cout << " | | " << std::endl;
+
+ BMscPtr bmsc1(new BMsc());
+
+ InstancePtr i1(new Instance(L"p1"));
+ bmsc1->add_instance(i1);
+ InstancePtr i2(new Instance(L"p2"));
+ bmsc1->add_instance(i2);
+
+ EventAreaPtr a1(new StrictOrderArea());
+ i1->add_area(a1);
+ EventAreaPtr a2(new StrictOrderArea());
+ i2->add_area(a2);
+
+ EventPtr e1 = a1->add_event();
+ EventPtr e2 = a1->add_event();
+ EventPtr e3 = a2->add_event();
+ EventPtr e4 = a2->add_event();
+
+ CompleteMessagePtr m1 = new CompleteMessage(L"a");
+ m1->glue_events(e1, e3);
+ CompleteMessagePtr m2 = new CompleteMessage(L"a");
+ m2->glue_events(e4, e2);
+
+ HMscPtr hmsc1(new HMsc(L"HMsc1"));
+ StartNodePtr start1 = new StartNode();
+ hmsc1->set_start(start1);
+ ReferenceNodePtr r1_1(new ReferenceNode());
+ EndNodePtr end1(new EndNode());
+ hmsc1->add_node(r1_1);
+ hmsc1->add_node(end1);
+ start1->add_successor(r1_1.get());
+ r1_1->add_successor(end1.get());
+ r1_1->add_successor(r1_1.get());
+ r1_1->set_msc(bmsc1);
+
+ return check(hmsc1,true);
+}
+
+bool HMscB() {
+ std::cout << "Checking these bmscs in a cycle:" << std::endl;
+ std::cout << " p1 p2 " << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << "e1 O-----a----->O e2" << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << std::endl;
+ std::cout << " p1 p2 " << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << "e3 O<----a------O e4" << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << " | | " << std::endl;
+
+ BMscPtr bmsc2(new BMsc());
+
+ InstancePtr i1(new Instance(L"p1"));
+ bmsc2->add_instance(i1);
+ InstancePtr i2(new Instance(L"p2"));
+ bmsc2->add_instance(i2);
+
+ EventAreaPtr a1(new StrictOrderArea());
+ i1->add_area(a1);
+ EventAreaPtr a2(new StrictOrderArea());
+ i2->add_area(a2);
+
+ EventPtr e1 = a1->add_event();
+ EventPtr e2 = a2->add_event();
+
+ CompleteMessagePtr m1 = new CompleteMessage(L"a");
+ m1->glue_events(e1, e2);
+
+ //////////////
+ BMscPtr bmsc3(new BMsc());
+
+ InstancePtr i3(new Instance(L"p1"));
+ bmsc3->add_instance(i3);
+ InstancePtr i4(new Instance(L"p2"));
+ bmsc3->add_instance(i4);
+
+ EventAreaPtr a3(new StrictOrderArea());
+ i3->add_area(a3);
+ EventAreaPtr a4(new StrictOrderArea());
+ i4->add_area(a4);
+
+ EventPtr e3 = a3->add_event();
+ EventPtr e4 = a4->add_event();
+
+ CompleteMessagePtr m2 = new CompleteMessage(L"a");
+ m2->glue_events(e4, e3);
+
+ HMscPtr hmsc2(new HMsc(L"HMsc2"));
+ StartNodePtr start1 = new StartNode();
+ hmsc2->set_start(start1);
+ ReferenceNodePtr r1_1(new ReferenceNode());
+ ReferenceNodePtr r1_2(new ReferenceNode());
+ EndNodePtr end1(new EndNode());
+ hmsc2->add_node(r1_1);
+ hmsc2->add_node(r1_2);
+ hmsc2->add_node(end1);
+ start1->add_successor(r1_1.get());
+ r1_1->add_successor(r1_2.get());
+ r1_2->add_successor(end1.get());
+ r1_2->add_successor(r1_1.get());
+ r1_1->set_msc(bmsc2);
+ r1_2->set_msc(bmsc3);
+
+ return check(hmsc2,true);
+}
+
+bool HMscC() {
+ std::cout << "Checking this bmsc in a cycle:" << std::endl;
+ std::cout << " p1 p2 " << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << "e1 O-----a----->O e2" << std::endl;
+ std::cout << " | | " << std::endl;
+ std::cout << " | | " << std::endl;
+
+ BMscPtr bmsc1(new BMsc());
+
+ InstancePtr i1(new Instance(L"p1"));
+ bmsc1->add_instance(i1);
+ InstancePtr i2(new Instance(L"p2"));
+ bmsc1->add_instance(i2);
+
+ EventAreaPtr a1(new StrictOrderArea());
+ i1->add_area(a1);
+ EventAreaPtr a2(new StrictOrderArea());
+ i2->add_area(a2);
+
+ EventPtr e1 = a1->add_event();
+ EventPtr e2 = a2->add_event();
+
+ CompleteMessagePtr m1 = new CompleteMessage(L"a");
+ m1->glue_events(e1, e2);
+
+
+ HMscPtr hmsc1(new HMsc(L"HMsc1"));
+ StartNodePtr start1 = new StartNode();
+ hmsc1->set_start(start1);
+ ReferenceNodePtr r1_1(new ReferenceNode());
+ EndNodePtr end1(new EndNode());
+ hmsc1->add_node(r1_1);
+ hmsc1->add_node(end1);
+ start1->add_successor(r1_1.get());
+ r1_1->add_successor(end1.get());
+ r1_1->add_successor(r1_1.get());
+ r1_1->set_msc(bmsc1);
+
+ return check(hmsc1,false);
+}
+
+int main(int argc, char** argv) {
+
+ RETURN_IF_FAILED(HMscA());
+
+ RETURN_IF_FAILED(HMscB());
+
+ RETURN_IF_FAILED(HMscC());
+}
+
+// $Id$
Property changes on: trunk/tests/local_choice_checker_test.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <koc...@us...> - 2009-07-08 14:39:03
|
Revision: 261
http://scstudio.svn.sourceforge.net/scstudio/?rev=261&view=rev
Author: kocianon
Date: 2009-07-08 14:39:02 +0000 (Wed, 08 Jul 2009)
Log Message:
-----------
some comments added.
Modified Paths:
--------------
trunk/src/check/time/hmsc_all_paths.cpp
trunk/src/check/time/hmsc_all_paths.h
trunk/src/check/time/hmsc_tighten.h
trunk/src/check/time/time_consistency.h
trunk/tests/incon_test.cpp
Modified: trunk/src/check/time/hmsc_all_paths.cpp
===================================================================
--- trunk/src/check/time/hmsc_all_paths.cpp 2009-07-07 15:09:15 UTC (rev 260)
+++ trunk/src/check/time/hmsc_all_paths.cpp 2009-07-08 14:39:02 UTC (rev 261)
@@ -1,2 +1,66 @@
#include "check/time/hmsc_all_paths.h"
+HMscAllPaths AllPaths::get_set_of_paths()
+{
+ m_paths.clear();
+ m_contains_cycle_globally=false;
+ bool contains_cycle_locally = false;
+ std::list<HMscNodePtr> path_prefix;
+ m_nodes_set = m_hmsc->get_nodes();
+
+ HMscNodePtrSet::iterator it;
+ for(it=m_nodes_set.begin();it!=m_nodes_set.end();it++)
+ set_number(*it,0);
+
+ // TODO check origin of relation
+ all_paths(m_relation->get_ref_node_a(),path_prefix,contains_cycle_locally);
+
+ return std::make_pair(m_paths,m_contains_cycle_globally);
+}
+
+void AllPaths::all_paths(
+HMscNodePtr node,
+std::list<HMscNodePtr> path_prefix,
+bool contains_cycle_locally
+)
+{
+ path_prefix.push_back(node);
+ if(node == m_relation->get_ref_node_b())
+ {
+ m_paths.push_back(std::make_pair(path_prefix,contains_cycle_locally));
+ }
+
+ set_number(node,get_number(node)+1);
+ PredecessorNode * pre;
+ pre = dynamic_cast<PredecessorNode*>(node.get());
+
+ if(pre == NULL)
+ {
+ path_prefix.pop_back();
+ set_number(node, 0);
+ return;
+ }
+
+ NodeRelationPtrSet set_succ = pre->get_successors();
+ NodeRelationPtrSet::const_iterator rel;
+ for(rel=set_succ.begin(); rel!=set_succ.end();rel++)
+ {
+ const NodeRelationPtr& node_relation = *rel;
+ HMscNodePtr new_node(dynamic_cast<HMscNode*>(node_relation.get()->get_successor()));
+ if(get_number(new_node)<=1)
+ {
+ bool contains_cycle_locally_new = contains_cycle_locally;
+ if(get_number(new_node)==1)
+ {
+ contains_cycle_locally_new = true;
+ m_contains_cycle_globally = true;
+ }
+ all_paths(new_node,path_prefix, contains_cycle_locally_new);
+
+ }
+
+ }
+ path_prefix.pop_back();
+ set_number(node, get_number(node)-1);
+ return;
+}
Modified: trunk/src/check/time/hmsc_all_paths.h
===================================================================
--- trunk/src/check/time/hmsc_all_paths.h 2009-07-07 15:09:15 UTC (rev 260)
+++ trunk/src/check/time/hmsc_all_paths.h 2009-07-08 14:39:02 UTC (rev 261)
@@ -17,7 +17,8 @@
std::list<HMscPath> m_paths;
public:
AllPaths(HMscPtr hmsc, TimeRelationRefNodePtr relation,
- const std::string& number="AllPathAlg"):m_hmsc(hmsc),m_relation(relation),m_number(number)
+ const std::string& number="AllPathAlg")
+ :m_hmsc(hmsc),m_relation(relation),m_number(number)
{
}
@@ -45,75 +46,18 @@
}
- static HMscAllPaths get_all_paths(HMscPtr hmsc, TimeRelationRefNodePtr relation)
+ static HMscAllPaths get_all_paths(
+ HMscPtr hmsc,
+ TimeRelationRefNodePtr relation
+ )
{
AllPaths allpaths(hmsc,relation);
return allpaths.get_set_of_paths();
}
- HMscAllPaths get_set_of_paths()
- {
+ HMscAllPaths get_set_of_paths();
- m_paths.clear();
- m_contains_cycle_globally=false;
- bool contains_cycle_locally = false;
- std::list<HMscNodePtr> path_prefix;
- m_nodes_set = m_hmsc->get_nodes();
+ void all_paths(HMscNodePtr, std::list<HMscNodePtr>, bool);
- HMscNodePtrSet::iterator it;
- for(it=m_nodes_set.begin();it!=m_nodes_set.end();it++)
- set_number(*it,0);
-
- // TODO check origin of relation
- all_paths(m_relation->get_ref_node_a(),path_prefix,contains_cycle_locally);
-
- return std::make_pair(m_paths,m_contains_cycle_globally);
- }
-
-
- void all_paths(HMscNodePtr node, std::list<HMscNodePtr> path_prefix, bool contains_cycle_locally)
- {
-
- path_prefix.push_back(node);
- if(node == m_relation->get_ref_node_b())
- {
- m_paths.push_back(std::make_pair(path_prefix,contains_cycle_locally));
- }
-
- set_number(node,get_number(node)+1);
- PredecessorNode * pre;
- pre = dynamic_cast<PredecessorNode*>(node.get());
-
- if(pre == NULL)
- {
- path_prefix.pop_back();
- set_number(node, 0);
- return;
- }
-
-
- NodeRelationPtrSet set_succ = pre->get_successors();
- NodeRelationPtrSet::const_iterator rel;
- for(rel=set_succ.begin(); rel!=set_succ.end();rel++)
- {
- const NodeRelationPtr& node_relation = *rel;
- HMscNodePtr new_node(dynamic_cast<HMscNode*>(node_relation.get()->get_successor()));
- if(get_number(new_node)<=1)
- {
- bool contains_cycle_locally_new = contains_cycle_locally;
- if(get_number(new_node)==1)
- {
- contains_cycle_locally_new = true;
- m_contains_cycle_globally = true;
- }
- all_paths(new_node,path_prefix, contains_cycle_locally_new);
-
- }
-
- }
- path_prefix.pop_back();
- set_number(node, get_number(node)-1);
- return;
- }
};
#endif
Modified: trunk/src/check/time/hmsc_tighten.h
===================================================================
--- trunk/src/check/time/hmsc_tighten.h 2009-07-07 15:09:15 UTC (rev 260)
+++ trunk/src/check/time/hmsc_tighten.h 2009-07-08 14:39:02 UTC (rev 261)
@@ -28,7 +28,11 @@
}
*/
- MscTimeIntervalSetD tighten(HMscAllPaths paths, MscTimeIntervalSetD i, HMscPtr hmsc)
+ MscTimeIntervalSetD tighten(
+ HMscAllPaths paths,
+ MscTimeIntervalSetD i,
+ HMscPtr hmsc
+ )
{
@@ -108,47 +112,40 @@
if(from_node)
m_msc = from_node;
-
}
else
{
-
- BMscPtr msc_tmp;
- ReferenceNode* ref_node = dynamic_cast<ReferenceNode*>((*n_path).get());
- BMscPtr from_node = ref_node->get_bmsc();
- if(from_node)
- msc_tmp = from_node;
+ BMscPtr msc_tmp;
+ ReferenceNode* ref_node = dynamic_cast<ReferenceNode*>((*n_path).get());
+ BMscPtr from_node = ref_node->get_bmsc();
+ if(from_node)
+ msc_tmp = from_node;
-// m_msc = concatenate(m_msc, msc_tmp); //TODO:concatenation
+// m_msc = concatenate(m_msc, msc_tmp); //TODO:concatenation
}
-
-
- }
+ }
- ConstMatrixPair pair;
- if(m_msc_list.empty())
- {
-
- TightenBMsc tighten_msc(m_msc);
- pair = tighten_msc.tighten_msc(i);
+ ConstMatrixPair pair;
+ if(m_msc_list.empty())
+ {
+ TightenBMsc tighten_msc(m_msc);
+ pair = tighten_msc.tighten_msc(i);
m_t = pair.second;
i_prime_prime = MscTimeIntervalSetD::set_intersection(i_prime_prime,pair.first);
-
- }
- else
- {
+ }
+ else
+ {
m_msc_list.push_back(m_msc);
- MscTimeIntervalSetD i_prime_prime_prime;
-// TightenMsgPath tighten_msg_path(m_msc_list); //TODO: MSG PATH
- i_prime_prime_prime = tighten_msg_path(m_msc_list,m_constr,i);
+ MscTimeIntervalSetD i_prime_prime_prime;
+// TightenMsgPath tighten_msg_path(m_msc_list); //TODO: MSG PATH
+ i_prime_prime_prime = tighten_msg_path(m_msc_list,m_constr,i);
- i_prime_prime = MscTimeIntervalSetD::set_intersection(i_prime_prime,pair.first);
- }
-
- }
+ i_prime_prime = MscTimeIntervalSetD::set_intersection(i_prime_prime,pair.first);
+ }
+ }
HMscNodePtrList::iterator path_it;
@@ -166,7 +163,6 @@
relation_copy->set_interval_set(interval_set);
}
-
}
//TODO:upravit nakopirovat povodne obmedzenia naspat
@@ -191,106 +187,110 @@
std::set<BMscPtr>::iterator b_it2;
for(b_it2 = m_bmsc_copy2.begin(); b_it2!= m_bmsc_copy2.end(); b_it2++)
- {
- //TODO:write get_all_constraints
- std::set<TimeRelationEventPtr> constraints;
-// constraints = get_all_constraints(*b_it);
- std::set<TimeRelationEventPtr>::iterator tr_it2;
+ {
+ //TODO:write get_all_constraints
+ std::set<TimeRelationEventPtr> constraints;
+// constraints = get_all_constraints(*b_it);
+ std::set<TimeRelationEventPtr>::iterator tr_it2;
- for(tr_it2 = constraints.begin(); tr_it2 != constraints.end(); tr_it2++)
- {
- TimeRelationEvent* relation_copy = dynamic_cast<TimeRelationEvent*>((*tr_it2)->get_original());
+ for(tr_it2 = constraints.begin(); tr_it2 != constraints.end(); tr_it2++)
+ {
+ TimeRelationEvent* relation_copy = dynamic_cast<TimeRelationEvent*>((*tr_it2)->get_original());
- //TODO:upravit
- relation_copy->set_interval_set((*tr_it2)->get_interval_set());
+ //TODO:upravit
+ relation_copy->set_interval_set((*tr_it2)->get_interval_set());
- }
+ }
- }
+ }
-return i_prime_prime;
+ return i_prime_prime;
+ }
+
+ MscTimeIntervalSetD tighten_msg_path(
+ std::list<BMscPtr> list_bmsc,
+ std::list<TimeRelationRefNodePtr> constr,
+ MscTimeIntervalSetD interval
+ )
+ {
+ MscTimeIntervalSetD tmp_interval(interval);
+ std::vector<MscTimeIntervalSetD> durations;
+ for(int i=0;i<list_bmsc.size();i++)
+ {
+ MscTimeIntervalSetD tmp;
+
+ tmp.insert(MscTimeIntervalD(0,D::infinity()));
+ durations.push_back(tmp);
+ }
+
+ MscTimeIntervalSetD s_interval;
+ do {
+ s_interval = tmp_interval;
+ std::list<BMscPtr>::iterator bmsc;
+
+ int i=0;
+ for(bmsc=list_bmsc.begin();bmsc!=list_bmsc.end();bmsc++,i++)
+ {
+ MscTimeIntervalSetD tmp_i=tmp_interval;
+ for(int j=0;j<list_bmsc.size();j++)
+ {
+ if(i==j)
+ continue;
+ tmp_i = tmp_i - durations[j];
+ }
+ std::list<TimeRelationRefNodePtr>::iterator c_it;
+ for(c_it=constr.begin();c_it!=constr.end();c_it++)
+ tmp_i = tmp_i - (*c_it)->get_interval_set();
+
+ durations[i]=TightenBMsc::tight(*bmsc,MscTimeIntervalSetD::set_intersection(tmp_i,durations[i]));
}
+ MscTimeIntervalSetD interval_set;
- MscTimeIntervalSetD tighten_msg_path(std::list<BMscPtr> list_bmsc,std::list<TimeRelationRefNodePtr> constr,MscTimeIntervalSetD interval)
+ std::list<TimeRelationRefNodePtr>::iterator c_it2;
+ for(c_it2=constr.begin();c_it2!=constr.end();c_it2++)
{
- MscTimeIntervalSetD tmp_interval(interval);
- std::vector<MscTimeIntervalSetD> durations;
- for(int i=0;i<list_bmsc.size();i++)
+ interval_set = (*c_it2)->get_interval_set();
+ MscTimeIntervalSetD tmp_i=tmp_interval;
+ for(int j=0;j<list_bmsc.size();j++)
{
- MscTimeIntervalSetD tmp;
-
- tmp.insert(MscTimeIntervalD(0,D::infinity()));
- durations.push_back(tmp);
+ tmp_i = tmp_i - durations[j];
+ }
+ interval_set = (*c_it2)->get_interval_set();
+ std::list<TimeRelationRefNodePtr>::iterator c_it;
+ for(c_it=constr.begin();c_it!=constr.end();c_it++)
+ {
+ interval_set = (*c_it2)->get_interval_set();
+ if(*c_it==*c_it2)
+ continue;
+ tmp_i = tmp_i - (*c_it)->get_interval_set();
}
- MscTimeIntervalSetD s_interval;
- do {
- s_interval = tmp_interval;
- std::list<BMscPtr>::iterator bmsc;
- int i=0;
- for(bmsc=list_bmsc.begin();bmsc!=list_bmsc.end();bmsc++,i++)
- {
- MscTimeIntervalSetD tmp_i=tmp_interval;
- for(int j=0;j<list_bmsc.size();j++)
- {
- if(i==j)
- continue;
- tmp_i = tmp_i - durations[j];
- }
- std::list<TimeRelationRefNodePtr>::iterator c_it;
- for(c_it=constr.begin();c_it!=constr.end();c_it++)
- tmp_i = tmp_i - (*c_it)->get_interval_set();
+ interval_set = (*c_it2)->get_interval_set();
+ (*c_it2)->set_interval_set(MscTimeIntervalSetD::set_intersection((*c_it2)->get_interval_set(),tmp_i));
+ interval_set = (*c_it2)->get_interval_set();
+ }
- durations[i]=TightenBMsc::tight(*bmsc,MscTimeIntervalSetD::set_intersection(tmp_i,durations[i]));
- }
- MscTimeIntervalSetD interval_set;
+ MscTimeIntervalSetD tmp;
+ tmp.insert(MscTimeIntervalD(0,0));
- std::list<TimeRelationRefNodePtr>::iterator c_it2;
- for(c_it2=constr.begin();c_it2!=constr.end();c_it2++)
- {
- interval_set = (*c_it2)->get_interval_set();
- MscTimeIntervalSetD tmp_i=tmp_interval;
- for(int j=0;j<list_bmsc.size();j++)
- {
- tmp_i = tmp_i - durations[j];
- }
- interval_set = (*c_it2)->get_interval_set();
- std::list<TimeRelationRefNodePtr>::iterator c_it;
- for(c_it=constr.begin();c_it!=constr.end();c_it++)
- {
- interval_set = (*c_it2)->get_interval_set();
- if(*c_it==*c_it2)
- continue;
- tmp_i = tmp_i - (*c_it)->get_interval_set();
- }
- interval_set = (*c_it2)->get_interval_set();
- (*c_it2)->set_interval_set(MscTimeIntervalSetD::set_intersection((*c_it2)->get_interval_set(),tmp_i));
- interval_set = (*c_it2)->get_interval_set();
- }
+ for(int j=0;j<list_bmsc.size();j++)
+ {
+ tmp = tmp + durations[j];
+ }
- MscTimeIntervalSetD tmp;
- tmp.insert(MscTimeIntervalD(0,0));
+ std::list<TimeRelationRefNodePtr>::iterator c_it;
+ for(c_it=constr.begin();c_it!=constr.end();c_it++)
+ {
+ MscTimeIntervalSetD uu = (*c_it)->get_interval_set();
+ tmp = uu + tmp;
+ }
- for(int j=0;j<list_bmsc.size();j++)
- {
- tmp = tmp + durations[j];
- }
-
- std::list<TimeRelationRefNodePtr>::iterator c_it;
- for(c_it=constr.begin();c_it!=constr.end();c_it++)
- {
- MscTimeIntervalSetD uu = (*c_it)->get_interval_set();
- tmp = uu + tmp;
- }
-
- tmp_interval = MscTimeIntervalSetD::set_intersection(tmp_interval,tmp);
-
+ tmp_interval = MscTimeIntervalSetD::set_intersection(tmp_interval,tmp);
-
- } while(s_interval!=tmp_interval);
+ } while(s_interval!=tmp_interval);
- return tmp_interval;
- }
+ return tmp_interval;
+ }
};
Modified: trunk/src/check/time/time_consistency.h
===================================================================
--- trunk/src/check/time/time_consistency.h 2009-07-07 15:09:15 UTC (rev 260)
+++ trunk/src/check/time/time_consistency.h 2009-07-08 14:39:02 UTC (rev 261)
@@ -48,8 +48,10 @@
class MatrixFunc
{
public:
- static void fill_matrix(IntervalMatrix& matrix, MscTimeIntervalD c,\
- unsigned x,unsigned y)
+ //! adding to the matrix INTERVAL c to (x,y) and its inverse to (y,x)
+ static
+ void fill_matrix(IntervalMatrix& matrix, MscTimeIntervalD c,\
+ unsigned x,unsigned y)
{
if(x>=matrix.size1()||y>=matrix.size2())
throw matrix.size1();
@@ -57,6 +59,7 @@
matrix(y,x) = MscTimeIntervalD::interval_inverse(c);
}
+ //! adding to the matrix-set INTERVAL SET c to (x,y) and its inverse to (y,x)
static
void fill_matrix(IntervalSetMatrix& matrix, MscTimeIntervalSetD c, \
unsigned x,unsigned y)
@@ -67,6 +70,7 @@
matrix(y,x) = MscTimeIntervalSetD::interval_inverse(c);
}
+ //! adding to the matrix-set INTERVAL c to (x,y) and its inverse to (y,x)
static
void fill_matrix(IntervalSetMatrix& matrix, MscTimeIntervalD c, \
unsigned x,unsigned y)
@@ -77,6 +81,7 @@
matrix(y,x).insert(MscTimeIntervalD::interval_inverse(c));
}
+ //! check whether two matrices are equal
static
bool is_equal(
IntervalSetMatrix lhs,
@@ -99,7 +104,7 @@
}
return true;
}
-
+ static
void print_out(IntervalSetMatrix matrix)
{
std::cout << "matrix: " << matrix.size1() << "x" <<
@@ -108,14 +113,14 @@
{
for(unsigned j=0;j<matrix.size2();j++)
{
- std::cout.width(15); std::cout << std::left << matrix(i,j);
+ std::cout << " {" << matrix(i,j) << "}";
}
std::cout << std::endl;
}
}
};
-
+//! time inconsistency exception
class MscTimeInconsistencyException : public std::exception
{
@@ -127,7 +132,7 @@
};
-
+//! Abstract class to the tightener
class MscIntervalTightener
{
public:
@@ -136,13 +141,14 @@
};
+//! Abstract class to the Consistency checker
class MscIntervalConsistencyCheck
{
public:
virtual bool check_consistency(const IntervalMatrix&)=0;
};
-
+//! Floyd Warshall: consistency checker and tightener, IntervalMatrix
class SCTIME_EXPORT FloydWarshall:
public MscIntervalTightener,
public MscIntervalConsistencyCheck
@@ -150,7 +156,7 @@
public:
FloydWarshall()
{}
-
+
const IntervalMatrix tight(const IntervalMatrix&)
throw(MscTimeInconsistencyException);
@@ -187,20 +193,15 @@
class SCTIME_EXPORT BmscMatrixConverter:public WhiteEventFoundListener
{
private:
- // Vector of all events - event <-- matrix number
- EventPVector m_events;
- // Map of event and its first successors
- EventPMap m_succs;
- // main matrix of Interval Sets
- IntervalSetMatrix m_matrix;
- // keeping number of colum/row of event in matrix, event --> matrix
- std::string m_number;
+ EventPVector m_events; //!< Vector of all events - event <-- matrix number
+ EventPMap m_succs; //!< Map of event and its first successors
+ IntervalSetMatrix m_matrix; //!< main matrix of Interval Sets
+ std::string m_number; //!< attribute,event(m_number=number) --> matrix
VisualClosureInitiator closure_initiator;
TopologicalOrderListener topology_listener;
DFSEventsTraverser traverser;
- // bmsc to be converted to matrix
- BMscPtr m_bmsc;
+ BMscPtr m_bmsc; //!< bmsc to be converted to the matrix
void get_first_area_events(EventArea*,Event*);
@@ -281,7 +282,6 @@
BmscMatrixConverter(const std::string number="bmsc_matrix_converter_number")
:m_number(number)
{
- std::cerr << "uuuuu" << std::endl;
}
bool is_leq(Event* a,Event *b)
Modified: trunk/tests/incon_test.cpp
===================================================================
--- trunk/tests/incon_test.cpp 2009-07-07 15:09:15 UTC (rev 260)
+++ trunk/tests/incon_test.cpp 2009-07-08 14:39:02 UTC (rev 261)
@@ -231,7 +231,7 @@
karel(4,0) = MscTimeIntervalDSet::interval_inverse(ins5);
std::cerr << karel << std::endl;
-
+ MatrixFunc::print_out(karel);
std::cout << sol.solve(karel) << std::endl;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <got...@us...> - 2009-07-28 08:21:51
|
Revision: 268
http://scstudio.svn.sourceforge.net/scstudio/?rev=268&view=rev
Author: gotthardp
Date: 2009-07-28 08:21:28 +0000 (Tue, 28 Jul 2009)
Log Message:
-----------
ExportFormatter interface enhanced to identify selected msc and specify prerequisites.
Modified Paths:
--------------
trunk/src/check/boundedness/universal_boundedness_checker.cpp
trunk/src/check/localchoice/local_choice_checker.cpp
trunk/src/check/order/fifo_checker.cpp
trunk/src/check/race/race_checker.cpp
trunk/src/data/Z120/z120.h
trunk/src/data/Z120/z120_save.cpp
trunk/src/data/checker.h
trunk/src/data/formatter.h
trunk/tests/checker_test.cpp
trunk/tests/engmann_test.cpp
trunk/tests/z120_test.cpp
Added Paths:
-----------
trunk/src/data/prerequisite_check.h
Modified: trunk/src/check/boundedness/universal_boundedness_checker.cpp
===================================================================
--- trunk/src/check/boundedness/universal_boundedness_checker.cpp 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/src/check/boundedness/universal_boundedness_checker.cpp 2009-07-28 08:21:28 UTC (rev 268)
@@ -108,7 +108,7 @@
Checker::PreconditionList UniversalBoundednessChecker::get_preconditions(MscPtr msc) const
{
Checker::PreconditionList result;
- result.push_back(CheckerPrecondition(L"Unique Instance Names", PP_RECOMMENDED));
+ result.push_back(PrerequisiteCheck(L"Unique Instance Names", PrerequisiteCheck::PP_RECOMMENDED));
return result;
}
Modified: trunk/src/check/localchoice/local_choice_checker.cpp
===================================================================
--- trunk/src/check/localchoice/local_choice_checker.cpp 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/src/check/localchoice/local_choice_checker.cpp 2009-07-28 08:21:28 UTC (rev 268)
@@ -227,9 +227,9 @@
Checker::PreconditionList LocalChoiceChecker::get_preconditions(MscPtr msc) const
{
Checker::PreconditionList result;
- result.push_back(CheckerPrecondition(L"Unique Instance Names", PP_RECOMMENDED));
+ result.push_back(PrerequisiteCheck(L"Unique Instance Names", PrerequisiteCheck::PP_RECOMMENDED));
return result;
}
-// $Id$
\ No newline at end of file
+// $Id$
Modified: trunk/src/check/order/fifo_checker.cpp
===================================================================
--- trunk/src/check/order/fifo_checker.cpp 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/src/check/order/fifo_checker.cpp 2009-07-28 08:21:28 UTC (rev 268)
@@ -26,7 +26,7 @@
Checker::PreconditionList FifoChecker::get_preconditions(MscPtr msc) const
{
Checker::PreconditionList result;
- result.push_back(CheckerPrecondition(L"Acyclic", PP_REQUIRED));
+ result.push_back(PrerequisiteCheck(L"Acyclic", PrerequisiteCheck::PP_REQUIRED));
return result;
}
Modified: trunk/src/check/race/race_checker.cpp
===================================================================
--- trunk/src/check/race/race_checker.cpp 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/src/check/race/race_checker.cpp 2009-07-28 08:21:28 UTC (rev 268)
@@ -247,12 +247,12 @@
HMscPtr hmsc = boost::dynamic_pointer_cast<HMsc>(msc);
if(hmsc != NULL)
{
- result.push_back(CheckerPrecondition(L"Deadlock Free", PP_REQUIRED));
- result.push_back(CheckerPrecondition(L"Livelock Free", PP_REQUIRED));
+ result.push_back(PrerequisiteCheck(L"Deadlock Free", PrerequisiteCheck::PP_REQUIRED));
+ result.push_back(PrerequisiteCheck(L"Livelock Free", PrerequisiteCheck::PP_REQUIRED));
}
- result.push_back(CheckerPrecondition(L"Acyclic", PP_REQUIRED));
- result.push_back(CheckerPrecondition(L"FIFO", PP_REQUIRED));
+ result.push_back(PrerequisiteCheck(L"Acyclic", PrerequisiteCheck::PP_REQUIRED));
+ result.push_back(PrerequisiteCheck(L"FIFO", PrerequisiteCheck::PP_REQUIRED));
return result;
}
Modified: trunk/src/data/Z120/z120.h
===================================================================
--- trunk/src/data/Z120/z120.h 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/src/data/Z120/z120.h 2009-07-28 08:21:28 UTC (rev 268)
@@ -44,8 +44,12 @@
//! import MSC document
virtual MscPtr load_msc(const std::string &filename);
#endif
+ //! Returns a list of preconditions for this format.
+ virtual PreconditionList get_preconditions(MscPtr msc) const;
+
//! export MSC document
- virtual int save_msc(std::ostream& stream, const std::wstring &name, const std::vector<MscPtr>& msc);
+ virtual int save_msc(std::ostream& stream, const std::wstring &name,
+ const MscPtr& selected_msc, const std::vector<MscPtr>& msc = std::vector<MscPtr>());
protected:
int save_msc(std::ostream& stream, const MscPtr& msc);
Modified: trunk/src/data/Z120/z120_save.cpp
===================================================================
--- trunk/src/data/Z120/z120_save.cpp 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/src/data/Z120/z120_save.cpp 2009-07-28 08:21:28 UTC (rev 268)
@@ -83,8 +83,16 @@
std::wstring m_name;
};
-int Z120::save_msc(std::ostream& stream, const std::wstring &name, const std::vector<MscPtr>& msc)
+ExportFormatter::PreconditionList Z120::get_preconditions(MscPtr msc) const
{
+ ExportFormatter::PreconditionList result;
+ // no preconditions
+ return result;
+}
+
+int Z120::save_msc(std::ostream& stream, const std::wstring &name,
+ const MscPtr& selected_msc, const std::vector<MscPtr>& msc)
+{
int result = 0; // error count
stream << "mscdocument " << VALID_NAME(name) << ";" << std::endl;
@@ -92,6 +100,7 @@
// list of MSC to be printed
// new references may be added to m_printing by save_hmsc()
+ m_printing.push_back(selected_msc);
std::copy(msc.begin(), msc.end(), std::back_inserter(m_printing));
for(std::list<MscPtr>::const_iterator pos = m_printing.begin();
Modified: trunk/src/data/checker.h
===================================================================
--- trunk/src/data/checker.h 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/src/data/checker.h 2009-07-28 08:21:28 UTC (rev 268)
@@ -25,6 +25,7 @@
#include <boost/shared_ptr.hpp>
#include "data/msc.h"
+#include "data/prerequisite_check.h"
class ChannelMapper;
class Checker;
@@ -49,24 +50,8 @@
*/
virtual std::wstring get_property_name() const = 0;
- enum PreconditionPriority
- {
- PP_REQUIRED, //! error if not satisfied
- PP_RECOMMENDED, //! warning if not satisfied
- PP_DISREGARDED //! may not be satisfied
- };
-
- struct CheckerPrecondition
- {
- CheckerPrecondition(const std::wstring& name, PreconditionPriority prio)
- : property_name(name), priority(prio)
- { }
-
- std::wstring property_name;
- PreconditionPriority priority;
- };
//! List of properties that must be satisfied before executing the check.
- typedef std::vector<CheckerPrecondition> PreconditionList;
+ typedef std::vector<PrerequisiteCheck> PreconditionList;
/**
* Returns a list of preconditions for the check.
Modified: trunk/src/data/formatter.h
===================================================================
--- trunk/src/data/formatter.h 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/src/data/formatter.h 2009-07-28 08:21:28 UTC (rev 268)
@@ -23,6 +23,7 @@
#include "data/msc.h"
#include "data/reporter.h"
+#include "data/prerequisite_check.h"
#if defined(_MSC_VER)
// FIXME: to be removed once the Formatter has some implementation in a .cpp file
@@ -54,8 +55,15 @@
class ExportFormatter
{
public:
+ //! List of properties that must be satisfied before executing the export.
+ typedef std::vector<PrerequisiteCheck> PreconditionList;
+
+ //! Returns a list of preconditions for this format.
+ virtual PreconditionList get_preconditions(MscPtr msc) const = 0;
+
//! export MSC document
- virtual int save_msc(std::ostream& stream, const std::wstring &name, const std::vector<MscPtr>& msc) = 0;
+ virtual int save_msc(std::ostream& stream, const std::wstring &name,
+ const MscPtr& selected_msc, const std::vector<MscPtr>& msc = std::vector<MscPtr>()) = 0;
};
typedef boost::shared_ptr<ExportFormatter> ExportFormatterPtr;
Added: trunk/src/data/prerequisite_check.h
===================================================================
--- trunk/src/data/prerequisite_check.h (rev 0)
+++ trunk/src/data/prerequisite_check.h 2009-07-28 08:21:28 UTC (rev 268)
@@ -0,0 +1,43 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2009 Petr Gotthard <pet...@ce...>
+ *
+ * $Id$
+ */
+
+#ifndef _PREQUISITE_CHECK_H
+#define _PREQUISITE_CHECK_H
+
+#include <string>
+
+struct PrerequisiteCheck
+{
+ enum Priority
+ {
+ PP_REQUIRED, //! error if not satisfied
+ PP_RECOMMENDED, //! warning if not satisfied
+ PP_DISREGARDED //! may not be satisfied
+ };
+
+ PrerequisiteCheck(const std::wstring& name, Priority prio)
+ : property_name(name), priority(prio)
+ { }
+
+ std::wstring property_name;
+ Priority priority;
+};
+
+#endif /* _PREQUISITE_CHECK_H */
+
+// $Id$
Property changes on: trunk/src/data/prerequisite_check.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: trunk/tests/checker_test.cpp
===================================================================
--- trunk/tests/checker_test.cpp 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/tests/checker_test.cpp 2009-07-28 08:21:28 UTC (rev 268)
@@ -150,9 +150,7 @@
else
std::cout << "OK: " << argv[3] << " violated " << argv[2] << ", should be violated" << std::endl;
- std::vector<MscPtr> results;
- results.push_back(result);
- z120.save_msc(std::cout, L"counter_example", results);
+ z120.save_msc(std::cout, L"counter_example", result);
}
}
catch(...)
Modified: trunk/tests/engmann_test.cpp
===================================================================
--- trunk/tests/engmann_test.cpp 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/tests/engmann_test.cpp 2009-07-28 08:21:28 UTC (rev 268)
@@ -33,8 +33,12 @@
StreamReportPrinter printer(std::wcerr);
engmann.set_printer(&printer);
- std::vector<MscPtr> msc;
- msc.push_back(engmann.load_msc(argv[1]));
+ MscPtr msc = engmann.load_msc(argv[1]);
+ if(msc == NULL)
+ {
+ std::cerr << "ERROR: Syntax error in " << argv[1] << std::endl;
+ return 1;
+ }
Z120 z120;
z120.save_msc(std::cout, TOWSTRING(argv[1]), msc);
Modified: trunk/tests/z120_test.cpp
===================================================================
--- trunk/tests/z120_test.cpp 2009-07-27 21:29:18 UTC (rev 267)
+++ trunk/tests/z120_test.cpp 2009-07-28 08:21:28 UTC (rev 268)
@@ -53,10 +53,8 @@
StreamReportPrinter printer(std::wcerr);
z120.set_printer(&printer);
- std::vector<MscPtr> msc;
- MscPtr my_msc = z120.load_msc(argv[1]);
-
- if(my_msc == NULL)
+ MscPtr msc = z120.load_msc(argv[1]);
+ if(msc == NULL)
{
std::cerr << "ERROR: Syntax error in " << argv[1] << std::endl;
return 1;
@@ -65,7 +63,6 @@
char *path = strdup(argv[1]);
char *filename = extract_filename(path);
- msc.push_back(my_msc);
z120.save_msc(std::cout, TOWSTRING(filename), msc);
free(path);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <va...@us...> - 2009-07-28 22:06:59
|
Revision: 270
http://scstudio.svn.sourceforge.net/scstudio/?rev=270&view=rev
Author: vacek
Date: 2009-07-28 22:06:49 +0000 (Tue, 28 Jul 2009)
Log Message:
-----------
DiVinE export initial commit.
Modified Paths:
--------------
trunk/src/check/boundedness/universal_boundedness_checker.h
trunk/src/data/CMakeLists.txt
trunk/tests/local_choice_checker_test.cpp
Added Paths:
-----------
trunk/src/data/modelchecking/
trunk/src/data/modelchecking/CMakeLists.txt
trunk/src/data/modelchecking/divine.cpp
trunk/src/data/modelchecking/divine.h
trunk/src/data/modelchecking/export.h
trunk/src/data/modelchecking/module.cpp
Modified: trunk/src/check/boundedness/universal_boundedness_checker.h
===================================================================
--- trunk/src/check/boundedness/universal_boundedness_checker.h 2009-07-28 09:00:46 UTC (rev 269)
+++ trunk/src/check/boundedness/universal_boundedness_checker.h 2009-07-28 22:06:49 UTC (rev 270)
@@ -142,7 +142,7 @@
*/
// note: DLL in Windows cannot return pointers to static data
virtual std::wstring get_property_name() const
- { return L"Universally Bounded"; }
+ { return L"Universal Boundedness"; }
virtual PreconditionList get_preconditions(MscPtr msc) const;
Modified: trunk/src/data/CMakeLists.txt
===================================================================
--- trunk/src/data/CMakeLists.txt 2009-07-28 09:00:46 UTC (rev 269)
+++ trunk/src/data/CMakeLists.txt 2009-07-28 22:06:49 UTC (rev 270)
@@ -36,6 +36,7 @@
# build import-export formatters
ADD_SUBDIRECTORY(engmann)
ADD_SUBDIRECTORY(Z120)
+ADD_SUBDIRECTORY(modelchecking)
INSTALL(FILES
msc.h
Added: trunk/src/data/modelchecking/CMakeLists.txt
===================================================================
--- trunk/src/data/modelchecking/CMakeLists.txt (rev 0)
+++ trunk/src/data/modelchecking/CMakeLists.txt 2009-07-28 22:06:49 UTC (rev 270)
@@ -0,0 +1,15 @@
+ADD_LIBRARY(scmodelchecking SHARED
+ export.h
+ module.cpp
+ divine.h
+ divine.cpp
+)
+
+TARGET_LINK_LIBRARIES(scmodelchecking
+ scmsc
+)
+
+INSTALL(TARGETS scmodelchecking
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
Added: trunk/src/data/modelchecking/divine.cpp
===================================================================
--- trunk/src/data/modelchecking/divine.cpp (rev 0)
+++ trunk/src/data/modelchecking/divine.cpp 2009-07-28 22:06:49 UTC (rev 270)
@@ -0,0 +1,55 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2009 Petr Gotthard <pet...@ce...>
+ *
+ * $Id$
+ */
+
+#include <string>
+#include <iostream>
+#include <fstream>
+#include <string.h>
+
+#include "data/modelchecking/divine.h"
+#include "data/msc.h"
+
+ExportFormatter::PreconditionList Divine::get_preconditions(MscPtr msc) const
+{
+ ExportFormatter::PreconditionList result;
+
+ result.push_back(PrerequisiteCheck(L"Universal Boundedness", PrerequisiteCheck::PP_REQUIRED));
+ result.push_back(PrerequisiteCheck(L"Local Choice", PrerequisiteCheck::PP_REQUIRED));
+
+ return result;
+}
+
+int Divine::save_msc(std::ostream& stream, const std::wstring &name,
+ const MscPtr& selected_msc, const std::vector<MscPtr>& msc)
+{
+ BMscPtr bmsc;
+ bmsc = boost::dynamic_pointer_cast<BMsc>(selected_msc);
+ if(bmsc)
+ {
+ process_bmsc(stream, bmsc, 0);
+ }
+ return 0;
+}
+
+void Divine::process_bmsc(std::ostream &stream, const BMscPtr &bmsc, unsigned node_number)
+{
+}
+
+
+
+// $Id$
Property changes on: trunk/src/data/modelchecking/divine.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/src/data/modelchecking/divine.h
===================================================================
--- trunk/src/data/modelchecking/divine.h (rev 0)
+++ trunk/src/data/modelchecking/divine.h 2009-07-28 22:06:49 UTC (rev 270)
@@ -0,0 +1,49 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2008-2009 Petr Gotthard <pet...@ce...>
+ *
+ * $Id$
+ */
+
+#ifndef _DIVINE_H
+#define _DIVINE_H
+
+#include "data/formatter.h"
+#include "data/modelchecking/export.h"
+
+class SCMODELCHECKING_EXPORT Divine: public Formatter, public ExportFormatter
+{
+public:
+ //! file extension used to distinguish this format
+ // note: DLL in Windows cannot return pointers to static data
+ virtual std::string get_extension() const
+ { return "dve"; }
+ //! human readable description of this format
+ virtual std::string get_description() const
+ { return "DiVinE format"; }
+
+ //! Returns a list of preconditions for this format.
+ virtual PreconditionList get_preconditions(MscPtr msc) const;
+
+ //! import MSC document
+ virtual int save_msc(std::ostream& stream, const std::wstring &name,
+ const MscPtr& selected_msc, const std::vector<MscPtr>& msc = std::vector<MscPtr>());
+
+protected:
+ void process_bmsc(std::ostream& stream, const BMscPtr& bmsc, unsigned node_number);
+};
+
+#endif /* _DIVINE_H */
+
+// $Id$
Property changes on: trunk/src/data/modelchecking/divine.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/src/data/modelchecking/export.h
===================================================================
--- trunk/src/data/modelchecking/export.h (rev 0)
+++ trunk/src/data/modelchecking/export.h 2009-07-28 22:06:49 UTC (rev 270)
@@ -0,0 +1,37 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2008 Petr Gotthard <pet...@ce...>
+ *
+ * $Id$
+ */
+
+#ifndef _MODELCHECKING_EXPORT_H
+#define _MODELCHECKING_EXPORT_H
+
+#if defined(_MSC_VER)
+#pragma warning(disable: 4251)
+
+#if defined(scmodelchecking_EXPORTS)
+#define SCMODELCHECKING_EXPORT __declspec(dllexport)
+#else
+#define SCMODELCHECKING_EXPORT __declspec(dllimport)
+#endif
+
+#else
+#define SCMODELCHECKING_EXPORT
+#endif
+
+#endif /* _MODELCHECKING_EXPORT_H */
+
+// $Id$
Property changes on: trunk/src/data/modelchecking/export.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/src/data/modelchecking/module.cpp
===================================================================
--- trunk/src/data/modelchecking/module.cpp (rev 0)
+++ trunk/src/data/modelchecking/module.cpp 2009-07-28 22:06:49 UTC (rev 270)
@@ -0,0 +1,33 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2009 Petr Gotthard <pet...@ce...>
+ *
+ * $Id$
+ */
+
+#include "data/modelchecking/divine.h"
+
+// module initialization function
+// note: the Visio add-on searches for a function of this name
+extern "C" SCMODELCHECKING_EXPORT
+Formatter** init_formatters()
+{
+ Formatter **result = new Formatter* [2];
+ result[0] = new Divine();
+ result[1] = NULL;
+
+ return result;
+}
+
+// $Id$
Property changes on: trunk/src/data/modelchecking/module.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: trunk/tests/local_choice_checker_test.cpp
===================================================================
--- trunk/tests/local_choice_checker_test.cpp 2009-07-28 09:00:46 UTC (rev 269)
+++ trunk/tests/local_choice_checker_test.cpp 2009-07-28 22:06:49 UTC (rev 270)
@@ -171,6 +171,8 @@
bmsc1->add_instance(i1);
InstancePtr i2(new Instance(L"p2"));
bmsc1->add_instance(i2);
+ InstancePtr i3(new Instance(L"p3"));
+ bmsc1->add_instance(i3);
EventAreaPtr a1(new StrictOrderArea());
i1->add_area(a1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2009-09-08 14:26:23
|
Revision: 283
http://scstudio.svn.sourceforge.net/scstudio/?rev=283&view=rev
Author: madzin
Date: 2009-09-08 14:26:13 +0000 (Tue, 08 Sep 2009)
Log Message:
-----------
Fix error reporting. Add test for parser
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/src/data/Z120/Context.h
trunk/src/data/Z120/Z120.g
trunk/tests/z120_test02.mpr
Added Paths:
-----------
trunk/tests/z120_test03.mpr
trunk/tests/z120_test04.mpr
trunk/tests/z120_test05.mpr
trunk/tests/z120_test06.mpr
trunk/tests/z120_test07.mpr
trunk/tests/z120_test08.mpr
trunk/tests/z120_test09.mpr
trunk/tests/z120_test10.mpr
trunk/tests/z120_test11.mpr
trunk/tests/z120_test12.mpr
trunk/tests/z120_test13.mpr
trunk/tests/z120_test14.mpr
trunk/tests/z120_test15.mpr
trunk/tests/z120_test16.mpr
trunk/tests/z120_test17.mpr
trunk/tests/z120_test18.mpr
trunk/tests/z120_test19.mpr
trunk/tests/z120_test20.mpr
trunk/tests/z120_test21.mpr
trunk/tests/z120_test22.mpr
trunk/tests/z120_test23.mpr
trunk/tests/z120_test24.mpr
trunk/tests/z120_test25.mpr
trunk/tests/z120_test26.mpr
trunk/tests/z120_test27.mpr
trunk/tests/z120_test28.mpr
trunk/tests/z120_test29.mpr
trunk/tests/z120_test30.mpr
trunk/tests/z120_test31.mpr
trunk/tests/z120_test32.mpr
trunk/tests/z120_test33.mpr
trunk/tests/z120_test34.mpr
trunk/tests/z120_test35.mpr
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2009-09-08 08:56:39 UTC (rev 282)
+++ trunk/src/data/Z120/Context.cpp 2009-09-08 14:26:13 UTC (rev 283)
@@ -66,6 +66,7 @@
std::set<std::string> order_events; //set of name of events which takes place after keywords 'before', 'after'
EventPtr current_event; //event which was currently created
std::string event_name; //name of event
+ int not_create_event;
/*
* HMsc
@@ -116,6 +117,7 @@
context->future_events.clear();
context->named_events.clear();
context->current_event = NULL;
+ context->not_create_event = 0;
context->start_node = NULL;
context->end_node = std::make_pair("", context->end_node.second); //replaice context->end_node.second with NULL
@@ -146,12 +148,12 @@
Msc* my_msc = NULL;
if(context->nonpointed.size() > 1)
{
- context->z->print_report(RS_ERROR, L"Warning 02: There are more unreferenced MSC\n"); //warning
+ context->z->print_report(RS_WARNING, L"Warning 02: There are more unreferenced MSC\n");
}
if(context->nonpointed.size() < 1 && context->mscs.size() > 0)
{
- context->z->print_report(RS_ERROR, L"Error 03: There is no MSC without reference \n");
- exit(3);
+ context->z->print_report(RS_ERROR, L"Error 03: There is no MSC without reference\n");
+ return NULL;
}
if(context->mscs.size() > 0){
my_msc = context->mscs.find(*(context->nonpointed.begin()))->second.get();
@@ -192,34 +194,39 @@
void check_collections_fun(struct Context* context)
{
if(!context->coregion_area_opened.empty())
- context->z->print_report(RS_ERROR, stringize() << "Warning 04: Instance " << TOWSTRING(context->element_name) << "does not have finished some coregion\n");
+ context->z->print_report(RS_WARNING, stringize() << "Warning 04: Instance " << TOWSTRING(context->element_name) << "does not have finished some coregion\n");
if(!context->messages.empty()){
- context->z->print_report(RS_ERROR, L"Error 05: There is complete message with only one event\n");
- exit(5);
+ context->z->print_report(RS_WARNING, L"Warning 05: There is complete message with only one event\n");
}
if(!context->future_events.empty()){
- context->z->print_report(RS_ERROR, L"Error 06: There is dependency on nonexisted event\n");
- exit(6);
+ context->z->print_report(RS_WARNING, L"Warning 06: There is dependency on nonexisted event\n");
}
if(!context->order_events.empty()){
- context->z->print_report(RS_ERROR, L"Error 07: There is reference to nonexisted event\n");
- exit(7);
+ context->z->print_report(RS_WARNING, L"Warning 07: There is reference to nonexisted event\n");
}
if(!context->future_connections.empty()){
- context->z->print_report(RS_ERROR, L"Error 08: There is reference to nonexisted node\n");
- exit(8);
+ context->z->print_report(RS_WARNING, L"Warning 08: There is reference to nonexisted node\n");
}
}
void check_references_fun(struct Context* context)
{
if(!context->future_reference.empty()){
- context->z->print_report(RS_ERROR, L"Error 09: There is references to nonexisted MSC\n");
- exit(9);
+ context->z->print_report(RS_WARNING, L"Warning 09: There is reference to nonexisted MSC\n");
+ std::map<std::string, std::set<ReferenceNodePtr> >::iterator map_it;
+ std::set<ReferenceNodePtr>::iterator ref_it;
+
+ for(map_it=context->future_reference.begin(); map_it!=context->future_reference.end(); ++map_it){
+ BMscPtr bmsc = new BMsc(TOWSTRING(map_it->first));
+
+ for(ref_it=map_it->second.begin(); ref_it!=map_it->second.end(); ++ref_it){
+ (*ref_it)->set_msc(bmsc);
+ }
+ }
}
}
@@ -268,6 +275,12 @@
*/
void incomplete_message_fun(struct Context* context, char* msg_identifications, enum msg_kind kind)
{
+
+ //event has been created before (variable not_create_event will be changed from grammar call (set_not_create_event)
+ if(context->not_create_event == 1){
+ return ;
+ }
+
std::string msg_identification(msg_identifications);
std::string msg_name;
size_t pos = msg_identification.rfind(',');
@@ -336,6 +349,12 @@
* Add name to order_events
*/
void add_order_event_fun(struct Context* context, char* name){
+
+ //event has been created before (variable not_create_event will be changed from grammar call (set_not_create_event)
+ if(context->not_create_event == 1){
+ return ;
+ }
+
context->order_events.insert(name);
}
@@ -345,7 +364,12 @@
void new_instance_fun(struct Context* context)
{
InstancePtr instance(new Instance(TOWSTRING(context->element_name)));
- context->instances.insert(std::make_pair(context->element_name, instance));
+ if(context->instances.find(context->element_name) != context->instances.end()){
+ context->z->print_report(RS_WARNING, stringize() << L"Warning 16: Instance with the same name (" << TOWSTRING(context->element_name) << ") has been created\n");
+ }
+ else{
+ context->instances.insert(std::make_pair(context->element_name, instance));
+ }
context->myBmsc->add_instance(instance);
}
@@ -369,8 +393,7 @@
}
else
{
- context->z->print_report(RS_ERROR, stringize() << "Error 10: Instance " << TOWSTRING(context->element_name) << " has already had open some coregion\n");
- exit(10);
+ context->z->print_report(RS_WARNING, stringize() << "Warning 10: Instance " << TOWSTRING(context->element_name) << " has already had open some coregion\n");
}
}
@@ -387,8 +410,7 @@
}
else
{
- context->z->print_report(RS_ERROR, stringize() << "Error 11: Instance " << TOWSTRING(context->element_name) << " does not have open any coregion\n"); //check
- exit(11);
+ context->z->print_report(RS_WARNING, stringize() << "Warning 11: Instance " << TOWSTRING(context->element_name) << " does not have open any coregion\n"); //check
}
}
@@ -397,6 +419,11 @@
*/
void message_fun(struct Context* context, char* msg_identifications, enum msg_kind kind)
{
+
+ //event has been created before (variable not_create_event will be changed from grammar call (set_not_create_event)
+ if(context->not_create_event == 1){
+ return ;
+ }
//message identification
std::string msg_identification(msg_identifications);
std::string msg_name;
@@ -483,6 +510,12 @@
* predecessors: kind = after
*/
void add_relation_fun(struct Context* context, enum relation_kind kind){
+
+ //event has been created before (variable not_create_event will be changed from grammar call (set_not_create_event)
+ if(context->not_create_event == 1){
+ return ;
+ }
+
std::set<std::string>::iterator it;
std::map<std::string, CoregionEventPtr>::iterator named_event_it;
CoregionEventPtr event = boost::dynamic_pointer_cast<CoregionEvent>(context->current_event);
@@ -526,9 +559,20 @@
void set_event_name_fun(struct Context* context, char* name)
{
- context->event_name = name;
+ if(context->named_events.find(name) == context->named_events.end()){
+ context->event_name = name;
+ }
+ else{
+ context->not_create_event = 1;
+ context->z->print_report(RS_WARNING, stringize() << L"Warning 17: Event with the same name (" << TOWSTRING(name) << ") has been created\n");
+ }
}
+void set_not_create_event(struct Context* context)
+{
+ context->not_create_event = 0;
+}
+
/*
* FUNCTIONS FOR HMSC
*/
@@ -566,8 +610,7 @@
}
else
{
- context->z->print_report(RS_ERROR, L"Error 14: There is node which is successor of end node\n");
- exit(14);
+ context->z->print_report(RS_WARNING, L"Warning 14: There is node which is successor of end node\n");
}
}
@@ -649,8 +692,8 @@
}
else
{
- context->z->print_report(RS_ERROR, stringize() << "Error 15: The node " << TOWSTRING(context->element_name) << " has already been existing\n");
- exit(15);
+ context->z->print_report(RS_WARNING, stringize() << "Warning 15: The node " << TOWSTRING(context->element_name) << " has been created\n");
+ context->connect_name.clear();
}
}
@@ -671,8 +714,8 @@
}
else
{
- context->z->print_report(RS_ERROR, stringize() << "Error 15: The node " << TOWSTRING(context->element_name) << " has already been existing\n");
- exit(15);
+ context->z->print_report(RS_WARNING, stringize() << "Warning 15: The node " << TOWSTRING(context->element_name) << " has been created\n");
+ context->connect_name.clear();
}
context->node_type = 0;
}
@@ -694,8 +737,8 @@
}
else
{
- context->z->print_report(RS_ERROR, stringize() << "Error 15: The node " << TOWSTRING(context->element_name) << " has already been existing\n");
- exit(15);
+ context->z->print_report(RS_WARNING, stringize() << "Warning 15: The node " << TOWSTRING(context->element_name) << " has been created\n");
+ context->connect_name.clear();
}
context->node_type = 0;
}
Modified: trunk/src/data/Z120/Context.h
===================================================================
--- trunk/src/data/Z120/Context.h 2009-09-08 08:56:39 UTC (rev 282)
+++ trunk/src/data/Z120/Context.h 2009-09-08 14:26:13 UTC (rev 283)
@@ -78,6 +78,8 @@
void set_event_name_fun(struct Context* context, char* name);
+void set_not_create_event(struct Context* context);
+
//HMsc
void new_hmsc_fun(struct Context* context);
Modified: trunk/src/data/Z120/Z120.g
===================================================================
--- trunk/src/data/Z120/Z120.g 2009-09-08 08:56:39 UTC (rev 282)
+++ trunk/src/data/Z120/Z120.g 2009-09-08 14:26:13 UTC (rev 283)
@@ -393,6 +393,10 @@
add_relation_fun(context, after);
})? end
('time' time_dest_list end)?
+
+ {
+ set_not_create_event(context);
+ }
;
order_dest_list:
Modified: trunk/tests/z120_test02.mpr
===================================================================
--- trunk/tests/z120_test02.mpr 2009-09-08 08:56:39 UTC (rev 282)
+++ trunk/tests/z120_test02.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -18,3 +18,4 @@
L9: (ACTION3B) seq (L10);
L10: end;
endmsc;
+
Added: trunk/tests/z120_test03.mpr
===================================================================
--- trunk/tests/z120_test03.mpr (rev 0)
+++ trunk/tests/z120_test03.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,40 @@
+/*****************************************************
+Simple test of bmsc (event driven notification)
+
+Anticipated result:
+
+mscdocument z120_test03;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+in A,0 from found;
+out jedna,1 to B;
+concurrent;
+label e0; out B1,2 to B;
+label e1; out B,3 to lost;
+endconcurrent;
+endinstance;
+B: instance;
+in jedna,1 from A;
+in B1,2 from A;
+endinstance;
+endmsc;
+
+******************************************************/
+
+mscdocument bbb;
+msc pok2;
+A: instance;
+B: instance;
+A: in A,1 from found;
+A: out jedna,2 to B;
+B: in jedna,2 from A;
+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_test04.mpr
===================================================================
--- trunk/tests/z120_test04.mpr (rev 0)
+++ trunk/tests/z120_test04.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,30 @@
+/*************************************************
+Simple test of HMSC
+
+Anticipated result:
+
+Warning 09: There is reference to nonexisted MSC
+
+mscdocument z120_test04;
+msc Stranka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference NAME connect L2;
+L2: reference NAME1 connect L3;
+L3: final;
+endmsc;
+msc NAME;
+endmsc;
+msc NAME1;
+endmsc;
+
+**************************************************/
+
+msc Stranka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference NAME connect L2;
+L2: reference NAME1 connect L3;
+L3: final;
+endmsc;
+
Added: trunk/tests/z120_test05.mpr
===================================================================
--- trunk/tests/z120_test05.mpr (rev 0)
+++ trunk/tests/z120_test05.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,34 @@
+/***********************************************
+Simple test of bMSC (event driven notification)
+
+Anticipated result:
+
+mscdocument z120_test05;
+msc pok2;
+inst p1;
+inst p2;
+p1: instance;
+out a,0 to p2;
+in a,1 from p2;
+endinstance;
+p2: instance;
+in a,0 from p1;
+out a,1 to p1;
+endinstance;
+endmsc;
+
+***********************************************/
+
+msc pok2;
+p1: instance;
+p2: instance;
+
+p1: out a to p2;
+p2: in a from p1;
+
+p2: out a to p1;
+p1: in a from p2;
+
+p1: endinstance;
+p2: endinstance;
+endmsc;
Added: trunk/tests/z120_test06.mpr
===================================================================
--- trunk/tests/z120_test06.mpr (rev 0)
+++ trunk/tests/z120_test06.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,31 @@
+/*********************************************
+Simple bMSC (event driven notification)
+
+Anticipated result:
+
+mscdocument z120_test06;
+msc Strnka1;
+inst I1;
+inst I2;
+I1: instance;
+out M1,0 to I2;
+out M1,1 to I2;
+endinstance;
+I2: instance;
+in M1,0 from I1;
+in M1,1 from I1;
+endinstance;
+endmsc;
+
+*********************************************/
+
+msc Strnka1;
+I1: instance;
+I1: out M1 to I2;
+I1: out M1 to I2;
+I1: endinstance;
+I2: instance;
+I2: in M1 from I1;
+I2: in M1 from I1;
+I2: endinstance;
+endmsc;
Added: trunk/tests/z120_test07.mpr
===================================================================
--- trunk/tests/z120_test07.mpr (rev 0)
+++ trunk/tests/z120_test07.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,34 @@
+/************************************************
+Simple example of bMSC (instance driven notification)
+
+Anticipated result:
+
+mscdocument z120_test07;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+out M1,0 to B;
+out M2,1 to B;
+endinstance;
+B: instance;
+in M1,0 from A;
+in M2,1 from A;
+endinstance;
+endmsc;
+
+************************************************/
+
+msc pok2;
+inst A;
+inst B;
+A: instance;
+ out M1,0 to B;
+ out M2,1 to B;
+ endinstance;
+
+B: instance;
+ in M1,0 from A;
+ in M2,1 from A;
+ endinstance;
+endmsc;
Added: trunk/tests/z120_test08.mpr
===================================================================
--- trunk/tests/z120_test08.mpr (rev 0)
+++ trunk/tests/z120_test08.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,38 @@
+/***********************************************
+Example of bMsc with coregion (instance driven notification)
+
+Anticipated result:
+
+mscdocument z120_test08;
+msc Stranka1;
+inst NAME1;
+inst NAME2;
+NAME1: instance;
+concurrent;
+label e0; out b,0 to NAME2 before e1;
+label e1; in a,1 from NAME2;
+endconcurrent;
+endinstance;
+NAME2: instance;
+out a,1 to NAME1;
+in b,0 from NAME1;
+endinstance;
+endmsc;
+
+***********************************************/
+
+msc Stranka1;
+inst NAME1;
+inst NAME2;
+NAME1: instance;
+concurrent;
+label e1; out b,1 to NAME2 before e0;
+label e0; in a,0 from NAME2;
+endconcurrent;
+endinstance;
+NAME2: instance;
+out a,0 to NAME1;
+in b,1 from NAME1;
+endinstance;
+endmsc;
+
Added: trunk/tests/z120_test09.mpr
===================================================================
--- trunk/tests/z120_test09.mpr (rev 0)
+++ trunk/tests/z120_test09.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,28 @@
+/*************************************************
+Exampe of bMsc where are 2 instances with the same name.
+
+Anticipated result:
+
+mscdocument z120_test09;
+msc Stranka1;
+inst NAME;
+inst NAME;
+NAME: instance;
+endinstance;
+NAME: instance;
+endinstance;
+endmsc;
+
+
+*************************************************/
+
+mscdocument Vykres1;
+msc Stranka1;
+inst NAME;
+inst NAME;
+NAME: instance;
+endinstance;
+NAME: instance;
+endinstance;
+endmsc;
+
Added: trunk/tests/z120_test10.mpr
===================================================================
--- trunk/tests/z120_test10.mpr (rev 0)
+++ trunk/tests/z120_test10.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,38 @@
+/***************************************************
+Example of bMSC with mesages with the same name.
+
+Anticipated result:
+
+mscdocument z120_test10;
+msc Stranka1;
+inst W;
+inst Q;
+W: instance;
+out a,0 to Q;
+out a,1 to Q;
+out a,2 to Q;
+endinstance;
+Q: instance;
+in a,0 from W;
+in a,1 from W;
+in a,2 from W;
+endinstance;
+endmsc;
+
+***************************************************/
+
+msc Stranka1;
+inst W;
+inst Q;
+W: instance;
+out a to Q;
+out a to Q;
+out a to Q;
+endinstance;
+Q: instance;
+in a from W;
+in a from W;
+in a from W;
+endinstance;
+endmsc;
+
Added: trunk/tests/z120_test11.mpr
===================================================================
--- trunk/tests/z120_test11.mpr (rev 0)
+++ trunk/tests/z120_test11.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,54 @@
+/*************************************************
+Example of bMSC with coregion (used '_' sign)
+
+Anticipated result:
+
+mscdocument z120_test11;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; in request_a,3 from PC before e1;
+label e2; in request_b,4 from PC;
+label e1; out result,5 to PC;
+endconcurrent;
+endinstance;
+endmsc;
+
+*************************************************/
+
+mscdocument Vkres1;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; in request_a,3 from PC before e1;
+label e2; in request_b,4 from PC;
+label e1; out result,5 to PC;
+endconcurrent;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test12.mpr
===================================================================
--- trunk/tests/z120_test12.mpr (rev 0)
+++ trunk/tests/z120_test12.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,70 @@
+/*************************************************
+Example of bMSC with two coretions on instances
+
+Anticipated result:
+
+mscdocument z120_test12;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e1; out ano,1 to B;
+label e2; in nie,2 from B;
+endconcurrent;
+concurrent;
+label e3; out micron,3 to B;
+label e4; out rad,4 to lost;
+endconcurrent;
+in dan,5 from B;
+in track,6 from B;
+endinstance;
+B: instance;
+concurrent;
+label e5; in ano,1 from A;
+label e6; out nie,2 to A;
+label e7; in ano,0 from A;
+endconcurrent;
+in micron,3 from A;
+concurrent;
+label e8; out dan,5 to A;
+endconcurrent;
+out track,6 to A;
+in rad,7 from found;
+endinstance;
+endmsc;
+
+*************************************************/
+
+mscdocument test11.vsd;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e1; out ano,1 to B;
+label e2; in nie,2 from B;
+endconcurrent;
+concurrent;
+label e3; out micron,3 to B;
+label e4; out rad,4 to lost;
+endconcurrent;
+in dan,5 from B;
+in track,6 from B;
+endinstance;
+B: instance;
+concurrent;
+label e5; in ano,1 from A;
+label e6; out nie,2 to A;
+label e7; in ano,0 from A;
+endconcurrent;
+in micron,3 from A;
+concurrent;
+label e8; out dan,5 to A;
+endconcurrent;
+out track,6 to A;
+in rad,7 from found;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test13.mpr
===================================================================
--- trunk/tests/z120_test13.mpr (rev 0)
+++ trunk/tests/z120_test13.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,54 @@
+/************************************************
+Example of bMSC with before, after relation between messages.
+
+Anticipated result:
+
+mscdocument z120_test13;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; out result,5 to PC before e1;
+label e2; in request_b,4 from PC;
+label e1; in request_a,3 from PC;
+endconcurrent;
+endinstance;
+endmsc;
+
+************************************************/
+
+mscdocument Vkres1;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; in request_a,3 from PC after e1;
+label e2; in request_b,4 from PC;
+label e1; out result,5 to PC;
+endconcurrent;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test14.mpr
===================================================================
--- trunk/tests/z120_test14.mpr (rev 0)
+++ trunk/tests/z120_test14.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,63 @@
+/***********************************************
+Example of bMSC
+
+Anticipated result:
+
+mscdocument z120_test14;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e1; in nie,1 from B;
+endconcurrent;
+concurrent;
+label e2; out micron,2 to B;
+endconcurrent;
+in dan,3 from B;
+in track,4 from B;
+endinstance;
+B: instance;
+concurrent;
+label e3; out nie,1 to A;
+label e4; in ano,0 from A;
+endconcurrent;
+in micron,2 from A;
+concurrent;
+label e5; out dan,3 to A;
+endconcurrent;
+out track,4 to A;
+in rad,5 from found;
+endinstance;
+endmsc;
+
+***********************************************/
+mscdocument test11.vsd;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e2; in nie,2 from B;
+endconcurrent;
+concurrent;
+label e3; out micron,3 to B;
+endconcurrent;
+in dan,5 from B;
+in track,6 from B;
+endinstance;
+B: instance;
+concurrent;
+label e6; out nie,2 to A;
+label e7; in ano,0 from A;
+endconcurrent;
+in micron,3 from A;
+concurrent;
+label e8; out dan,5 to A;
+endconcurrent;
+out track,6 to A;
+in rad,7 from found;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test15.mpr
===================================================================
--- trunk/tests/z120_test15.mpr (rev 0)
+++ trunk/tests/z120_test15.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,58 @@
+/***********************************************
+Example of bMSC
+
+Anticipated result:
+
+mscdocument z120_test15;
+msc Strnka1;
+inst client;
+inst server;
+client: instance;
+concurrent;
+label e0; out no,0 to server;
+label e1; in know,1 from server;
+endconcurrent;
+out yes,2 to lost;
+concurrent;
+label e2; in tric,3 from server;
+endconcurrent;
+in tric,4 from found;
+endinstance;
+server: instance;
+in no,0 from client;
+concurrent;
+label e3; out know,1 to client;
+endconcurrent;
+concurrent;
+label e4; out tric,3 to client;
+endconcurrent;
+endinstance;
+endmsc;
+
+***********************************************/
+
+mscdocument Vkres2;
+msc Strnka1;
+inst client;
+inst server;
+client: instance;
+concurrent;
+label e0; out no,0 to server;
+label e1; in know,1 from server;
+endconcurrent;
+out yes,2 to lost;
+concurrent;
+label e2; in tric,3 from server;
+endconcurrent;
+in tric,4 from found;
+endinstance;
+server: instance;
+in no,0 from client;
+concurrent;
+label e3; out know,1 to client;
+endconcurrent;
+concurrent;
+label e4; out tric,3 to client;
+endconcurrent;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test16.mpr
===================================================================
--- trunk/tests/z120_test16.mpr (rev 0)
+++ trunk/tests/z120_test16.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,90 @@
+/***********************************************
+Example of HMSC with references to bMSC.
+
+Anticipated result:
+
+mscdocument z120_test16;
+msc Strnka1;
+initial connect L0;
+L0: reference bmsc1 connect L1;
+L1: condition true connect L2, L3;
+L2: reference bmsc2 connect L4;
+L3: reference bmsc3 connect L4;
+L4: final;
+endmsc;
+msc bmsc1;
+inst A;
+inst B;
+A: instance;
+out yes,0 to B;
+endinstance;
+B: instance;
+in yes,0 from A;
+endinstance;
+endmsc;
+msc bmsc2;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+endinstance;
+B: instance;
+out no,0 to A;
+endinstance;
+endmsc;
+msc bmsc3;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+out ok,1 to B;
+endinstance;
+B: instance;
+out no,0 to A;
+in ok,1 from A;
+endinstance;
+endmsc;
+
+***********************************************/
+
+mscdocument Vkres1;
+msc Strnka1;
+initial connect L0;
+L0: reference bmsc1 connect L1;
+L1: condition true connect L2, L3;
+L2: reference bmsc2 connect L4;
+L3: reference bmsc3 connect L4;
+L4: final;
+endmsc;
+msc bmsc1;
+inst A;
+inst B;
+A: instance;
+out yes,0 to B;
+endinstance;
+B: instance;
+in yes,0 from A;
+endinstance;
+endmsc;
+msc bmsc2;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+endinstance;
+B: instance;
+out no,0 to A;
+endinstance;
+endmsc;
+msc bmsc3;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+out ok,1 to B;
+endinstance;
+B: instance;
+out no,0 to A;
+in ok,1 from A;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test17.mpr
===================================================================
--- trunk/tests/z120_test17.mpr (rev 0)
+++ trunk/tests/z120_test17.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,90 @@
+/*************************************************
+Example of HMSC with references to bMSC (unordered bMSC definitions)
+
+Anticipated result:
+
+mscdocument z120_test17;
+msc Strnka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference bmsc2 connect L3;
+L2: reference bmsc1 connect L3;
+L3: reference bmsc3 connect L4;
+L4: final;
+endmsc;
+msc bmsc2;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+endinstance;
+B: instance;
+out no,0 to A;
+endinstance;
+endmsc;
+msc bmsc1;
+inst A;
+inst B;
+A: instance;
+out yes,0 to B;
+endinstance;
+B: instance;
+in yes,0 from A;
+endinstance;
+endmsc;
+msc bmsc3;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+out ok,1 to B;
+endinstance;
+B: instance;
+out no,0 to A;
+in ok,1 from A;
+endinstance;
+endmsc;
+
+*************************************************/
+
+mscdocument Vkres1;
+msc Strnka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference bmsc2 connect L3;
+L2: reference bmsc1 connect L3;
+L3: reference bmsc3 connect L4;
+L4: final;
+endmsc;
+msc bmsc1;
+inst A;
+inst B;
+A: instance;
+out yes,0 to B;
+endinstance;
+B: instance;
+in yes,0 from A;
+endinstance;
+endmsc;
+msc bmsc2;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+endinstance;
+B: instance;
+out no,0 to A;
+endinstance;
+endmsc;
+msc bmsc3;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+out ok,1 to B;
+endinstance;
+B: instance;
+out no,0 to A;
+in ok,1 from A;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test18.mpr
===================================================================
--- trunk/tests/z120_test18.mpr (rev 0)
+++ trunk/tests/z120_test18.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,44 @@
+mscdocument Vkres1;
+
+msc bmsc3;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+out ok,1 to B;
+endinstance;
+B: instance;
+out no,0 to A;
+in ok,1 from A;
+endinstance;
+endmsc;
+
+msc Strnka1;
+initial connect L0;
+L0: reference bmsc1 connect L2;
+L1: reference bmsc2 connect L0, L2;
+L2: final;
+endmsc;
+
+msc bmsc1;
+inst A;
+inst B;
+A: instance;
+out yes,0 to B;
+endinstance;
+B: instance;
+in yes,0 from A;
+endinstance;
+endmsc;
+
+msc bmsc2;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+endinstance;
+B: instance;
+out no,0 to A;
+endinstance;
+endmsc;
+
Added: trunk/tests/z120_test19.mpr
===================================================================
--- trunk/tests/z120_test19.mpr (rev 0)
+++ trunk/tests/z120_test19.mpr 2009-09-08 14:26:13 UTC (rev 283)
@@ -0,0 +1,90 @@
+/******************************************************
+Example of HMSC with references to bMSC (HMSC is defined at the end of the file)
+
+Anticipated result:
+
+mscdocument z120_test19;
+msc Strnka1;
+initial connect L0;
+L0: reference bmsc1 connect L1;
+L1: condition true connect L2, L3;
+L2: reference bmsc2 connect L4;
+L3: reference bmsc3 connect L4;
+L4: final;
+endmsc;
+msc bmsc1;
+inst A;
+inst B;
+A: inst...
[truncated message content] |
|
From: <koc...@us...> - 2009-09-08 14:35:24
|
Revision: 284
http://scstudio.svn.sourceforge.net/scstudio/?rev=284&view=rev
Author: kocianon
Date: 2009-09-08 14:35:12 +0000 (Tue, 08 Sep 2009)
Log Message:
-----------
fixing constrain_check, segmentation fault - missing TimeRelationRefNode duplicator
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/src/check/time/CMakeLists.txt
trunk/src/check/time/constrain_check.cpp
trunk/src/check/time/constrain_check.h
trunk/tests/CMakeLists.txt
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2009-09-08 14:26:13 UTC (rev 283)
+++ trunk/CMakeLists.txt 2009-09-08 14:35:12 UTC (rev 284)
@@ -37,5 +37,6 @@
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
+
# $Id$
Modified: trunk/src/check/time/CMakeLists.txt
===================================================================
--- trunk/src/check/time/CMakeLists.txt 2009-09-08 14:26:13 UTC (rev 283)
+++ trunk/src/check/time/CMakeLists.txt 2009-09-08 14:35:12 UTC (rev 284)
@@ -1,4 +1,7 @@
+ADD_DEFINITIONS("-g -Wall -pedantic -ansi")
+
ADD_LIBRARY(sctime SHARED
+ export.h
time_consistency.cpp
time_consistency.h
bmsc_tightening.h
@@ -6,6 +9,9 @@
hmsc_all_paths.h
hmsc_tighten.h
hmsc_tighten.cpp
+ time_pseudocode.h
+ constrain_check.h
+ constrain_check.cpp
)
TARGET_LINK_LIBRARIES(sctime
Modified: trunk/src/check/time/constrain_check.cpp
===================================================================
--- trunk/src/check/time/constrain_check.cpp 2009-09-08 14:26:13 UTC (rev 283)
+++ trunk/src/check/time/constrain_check.cpp 2009-09-08 14:35:12 UTC (rev 284)
@@ -1,8 +1,18 @@
-#include "hmsc_constrain_check.h"
+#include "constrain_check.h"
+#include "data/dfs_bmsc_graph_traverser.h"
+HMscTimeConstrainCheckerPtr HMscTimeConstrainChecker::m_instance;
+
+HMscTimeConstrainChecker::HMscTimeConstrainChecker(
+ const std::string& top,
+ const std::string& bottom):
+ m_top_constrains(top),m_bottom_constrains(bottom)
+{}
+
+
void HMscTimeConstrainChecker::check_active_set(
- ReferenceNode* n
- , TimeRelationRefNodePtrSet constrain_set
+ ReferenceNode* n,
+ TimeRelationRefNodePtrSet constrain_set
)
{
TimeRelationRefNodePtrSet::iterator it;
@@ -11,21 +21,21 @@
{
TimeRelationRefNodePtr constrain = *it;
- TimeRelationRefNodePtrSet::iterator found_constain;
+ TimeRelationRefNodePtrSet::iterator found_constrain;
- found_constrain=active_constrain.find(constrain);
-
- if(found_constrain==active_constrains.end())
+ found_constrain=m_active_constrains.find(constrain);
+
+ if(found_constrain==m_active_constrains.end())
{
if(constrain->get_ref_node_b()==n)
- throw ConstrainException();
+ throw constrain.get();
- active_constrains.insert(constrain);
+ m_active_constrains.insert(constrain);
}
else
{
if(constrain->get_ref_node_b()==n)
- active_constrains.erase(found_constrain);
+ m_active_constrains.erase(found_constrain);
}
@@ -39,19 +49,19 @@
//TOP
constrain_set = n->get_time_relation_top();
- add_active_constains_top(n);
+ add_active_constrains_top(n);
check_active_set(n,constrain_set);
//BOTTOM
constrain_set = n->get_time_relation_bottom();
- add_active_constains_bottom(n);
+ add_active_constrains_bottom(n);
check_active_set(n,constrain_set);
if(dynamic_cast<EndNode*>(n))
- if(active_constains.size()!=0)
- throw ConstrainException();
+ if(m_active_constrains.size()!=0)
+ throw m_active_constrains;
}
void HMscTimeConstrainChecker::on_gray_node_found(ReferenceNode* n)
@@ -59,12 +69,12 @@
TimeRelationRefNodePtrSet constrains_set;
constrains_set = get_active_constrains_top(n);
- if(constrains_set!=active_constrains)
- throw ConstrainsExcetion();
+ if(constrains_set!=m_active_constrains)
+ throw constrains_set;
constrains_set = get_active_constrains_bottom(n);
- if(constrains_set!=active_constrains)
- throw ConstrainsExcetion();
+ if(constrains_set!=m_active_constrains)
+ throw constrains_set;
}
void HMscTimeConstrainChecker::on_black_node_found(ReferenceNode* n)
@@ -72,11 +82,47 @@
TimeRelationRefNodePtrSet constrains_set;
constrains_set = get_active_constrains_top(n);
- if(constrains_set!=active_constrains)
- throw ConstrainsExcetion();
+ if(constrains_set!=m_active_constrains)
+ throw constrains_set;
constrains_set = get_active_constrains_bottom(n);
- if(constrains_set!=active_constrains)
- throw ConstrainsExcetion();
+ if(constrains_set!=m_active_constrains)
+ throw constrains_set;
+}
+
+HMscPtr HMscTimeConstrainChecker::check(HMscPtr hmsc, ChannelMapperPtr chm)
+{
+ HMscPtr p;
+ DFSBMscGraphTraverser traverser;
+ traverser.add_white_node_found_listener(this);
+ traverser.add_gray_node_found_listener(this);
+ traverser.add_black_node_found_listener(this);
+ try
+ {
+ traverser.traverse(hmsc);
+ }
+ catch (TimeRelationRefNode* relation)
+ {
+ p = process_path(traverser.get_reached_elements());
+ mark_time_relation(relation);
+ traverser.cleanup_traversing_attributes();
+ }
+ catch (TimeRelationRefNodePtrSet relations)
+ {
+ p = process_path(traverser.get_reached_elements());
+ mark_time_relation(relations);
+ traverser.cleanup_traversing_attributes();
+ }
+
+ return p;
+
}
+
+Checker::PreconditionList HMscTimeConstrainChecker::get_preconditions(MscPtr msc) const
+{
+ Checker::PreconditionList result;
+ // no preconditions
+ return result;
+}
+
Modified: trunk/src/check/time/constrain_check.h
===================================================================
--- trunk/src/check/time/constrain_check.h 2009-09-08 14:26:13 UTC (rev 283)
+++ trunk/src/check/time/constrain_check.h 2009-09-08 14:35:12 UTC (rev 284)
@@ -11,9 +11,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * Copyright (c) 2008 Jindra Babica <ba...@ma...>
*
- * $Id: deadlock_checker.h 243 2009-05-03 19:05:14Z gotthardp $
+ *
+ *
*/
#include <string>
@@ -21,15 +21,15 @@
#include <set>
#include <exception>
+#include "check/time/export.h"
#include "data/checker.h"
#include "data/msc.h"
-#include "data/dfs_bmsc_graph_traverser.h"
-#include "data/dfsb_hmsc_traverser.h"
+#include "check/pseudocode/msc_duplicators.h"
class HMscTimeConstrainChecker;
typedef boost::shared_ptr<HMscTimeConstrainChecker> HMscTimeConstrainCheckerPtr;
-
+/*
class ConstrainException:public std::exception
{
@@ -39,9 +39,10 @@
return "Inconsistent constrain path found";
}
};
+*/
-class SCTIME_EXPORT HMscTimeConstrainChecker
- : public Checker
+class SCTIME_EXPORT HMscTimeConstrainChecker:
+ public Checker
, public HMscChecker
, public WhiteRefNodeFoundListener
, public GrayRefNodeFoundListener
@@ -50,27 +51,25 @@
private:
std::string m_top_constrains;
std::string m_bottom_constrains;
- std::stack<ReferenceNode*> to_be_clean;
+ std::stack<MscElement*> to_be_clean;
// active constrains on the path
- std::set<TimeRelationRefNode> m_active_constrains;
+ std::set<TimeRelationRefNodePtr> m_active_constrains;
+ HMscPathDuplicator m_duplicator;
//////////// attribute handler
// ADD
- add_active_constrains(
- ReferenceNode* n
- , std::string w
- )
+ void add_active_constrains(MscElement* n, std::string w)
{
n->set_attribute<TimeRelationRefNodePtrSet>(w,m_active_constrains);
to_be_clean.push(n);
}
- add_active_constrains_top(ReferenceNode* n)
+ void add_active_constrains_top(MscElement* n)
{
add_active_constrains(n,m_top_constrains);
}
- add_active_constrains_bottom(ReferenceNode* n)
+ void add_active_constrains_bottom(MscElement* n)
{
add_active_constrains(n,m_bottom_constrains);
}
@@ -81,10 +80,11 @@
, std::string w
)
{
- if(!n->is_attribute_set<TimeRelationRefNodePtrSet>(w))
- return NULL;
+ TimeRelationRefNodePtrSet empty;
+ if(!(n->is_attribute_set(w)))
+ return empty;
else
- return n->get_attribute<TimeRelationRefNodePtrSet>(w,NULL);
+ return n->get_attribute<TimeRelationRefNodePtrSet>(w,empty);
}
TimeRelationRefNodePtrSet get_active_constrains_top(ReferenceNode * n)
@@ -105,19 +105,18 @@
/**
* Common instance.
*/
- static HMscTimeConstrainPtr m_instance;
+ static HMscTimeConstrainCheckerPtr m_instance;
HMscPtr create_counter_example(const MscElementPListList& path);
public:
- HMscTimeConstrainChecker()
- {
- m_top_constrains = "top_active_constrains";
- m_bottom_constrains = "bottom_active_constrains";
- }
+ HMscTimeConstrainChecker(
+ const std::string& top="top constrain set",
+ const std::string& bottom="bottom constrain set"
+ );
- ~HMscTimeContrainChecker()
+ ~HMscTimeConstrainChecker()
{
cleanup_attributes();
}
@@ -131,7 +130,7 @@
return L"Time constrain checker";
}
- PreconditionList get_preconditions(MscPtr msc) const;
+ virtual Checker::PreconditionList get_preconditions(MscPtr msc) const;
/**
* Checks whether hmsc satisfy deadlock free property.
@@ -144,6 +143,34 @@
void on_black_node_found(ReferenceNode*);
+ HMscPtr process_path(const MscElementPListList& path)
+ {
+ HMscPtr p;
+ p = m_duplicator.duplicate_path(path);
+
+ MscElementPListList::const_iterator h;
+ for(h=path.begin();h!=path.end();h++)
+ {
+ MscElement* last = (*h).back();
+ m_duplicator.get_copy(last)->set_marked(true);
+ }
+
+ return p;
+
+ }
+
+ void mark_time_relation(const TimeRelationRefNodePtrSet& relations)
+ {
+ TimeRelationRefNodePtrSet::iterator it;
+ for(it=relations.begin();it!=relations.end();it++)
+ mark_time_relation(it->get());
+ }
+
+ void mark_time_relation(TimeRelationRefNode* relation)
+ {
+ m_duplicator.get_copy(relation)->set_marked(true);
+ }
+
/**
* Cleans up no more needed attributes.
*/
@@ -152,9 +179,9 @@
{
while(!to_be_clean.empty())
{
- ReferenceNode* n = to_be_clean.top();
- n->remove_attribute(m_top_constrains);
- n->remove_attribute(m_bottom_constrains);
+ MscElement* n = to_be_clean.top();
+ n->remove_attribute<TimeRelationRefNodePtrSet>(m_top_constrains);
+ n->remove_attribute<TimeRelationRefNodePtrSet>(m_bottom_constrains);
to_be_clean.pop();
}
}
@@ -175,4 +202,3 @@
}
};
-// $Id: deadlock_checker.h 243 2009-05-03 19:05:14Z gotthardp $
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2009-09-08 14:26:13 UTC (rev 283)
+++ trunk/tests/CMakeLists.txt 2009-09-08 14:35:12 UTC (rev 284)
@@ -1,5 +1,7 @@
ENABLE_TESTING()
+ADD_DEFINITIONS("-g -Wall -pedantic -ansi")
+
ADD_EXECUTABLE(universal_boundedness_checker_test
universal_boundedness_checker_test.cpp
)
@@ -186,7 +188,16 @@
scpseudocode
)
+ADD_EXECUTABLE(constrain_check_test
+ constrain_check_test.cpp
+)
+TARGET_LINK_LIBRARIES(constrain_check_test
+ scmsc
+ sctime
+ scpseudocode
+)
+
#
#ADD_EXECUTABLE(max_tightener_test
# max_tightener_test.cpp
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <got...@us...> - 2009-09-08 19:37:19
|
Revision: 286
http://scstudio.svn.sourceforge.net/scstudio/?rev=286&view=rev
Author: gotthardp
Date: 2009-09-08 19:37:09 +0000 (Tue, 08 Sep 2009)
Log Message:
-----------
Fix file properties. Use -Wall only with gcc.
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/src/check/time/CMakeLists.txt
trunk/src/check/time/constrain_check.h
trunk/tests/CMakeLists.txt
Property Changed:
----------------
trunk/src/check/time/constrain_check.cpp
trunk/src/check/time/constrain_check.h
trunk/src/check/time/time_pseudocode.h
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2009-09-08 14:57:24 UTC (rev 285)
+++ trunk/CMakeLists.txt 2009-09-08 19:37:09 UTC (rev 286)
@@ -19,6 +19,11 @@
ADD_DEFINITIONS(-DHOST_IS_BIG_ENDIAN)
ENDIF(BIG_ENDIAN)
+# Enforce strict ANSI C/C++ compliancy checking
+IF(CMAKE_COMPILER_IS_GNUCXX)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -ansi -Wall -Woverloaded-virtual -Wno-unused-function")
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+
FIND_PACKAGE(Boost REQUIRED)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
Modified: trunk/src/check/time/CMakeLists.txt
===================================================================
--- trunk/src/check/time/CMakeLists.txt 2009-09-08 14:57:24 UTC (rev 285)
+++ trunk/src/check/time/CMakeLists.txt 2009-09-08 19:37:09 UTC (rev 286)
@@ -1,5 +1,3 @@
-ADD_DEFINITIONS("-g -Wall -pedantic -ansi")
-
ADD_LIBRARY(sctime SHARED
export.h
time_consistency.cpp
Property changes on: trunk/src/check/time/constrain_check.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: trunk/src/check/time/constrain_check.h
===================================================================
--- trunk/src/check/time/constrain_check.h 2009-09-08 14:57:24 UTC (rev 285)
+++ trunk/src/check/time/constrain_check.h 2009-09-08 19:37:09 UTC (rev 286)
@@ -161,7 +161,7 @@
void mark_time_relation(const TimeRelationRefNodePtrSet& relations)
{
- TimeRelationRefNodePtrSet::iterator it;
+ TimeRelationRefNodePtrSet::const_iterator it;
for(it=relations.begin();it!=relations.end();it++)
mark_time_relation(it->get());
}
Property changes on: trunk/src/check/time/constrain_check.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Property changes on: trunk/src/check/time/time_pseudocode.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2009-09-08 14:57:24 UTC (rev 285)
+++ trunk/tests/CMakeLists.txt 2009-09-08 19:37:09 UTC (rev 286)
@@ -1,7 +1,5 @@
ENABLE_TESTING()
-ADD_DEFINITIONS("-g -Wall -pedantic -ansi")
-
ADD_EXECUTABLE(universal_boundedness_checker_test
universal_boundedness_checker_test.cpp
)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2009-09-09 10:22:43
|
Revision: 291
http://scstudio.svn.sourceforge.net/scstudio/?rev=291&view=rev
Author: madzin
Date: 2009-09-09 10:22:33 +0000 (Wed, 09 Sep 2009)
Log Message:
-----------
Z120_test move to subdirectiory.
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/tests/CMakeLists.txt
Added Paths:
-----------
trunk/tests/z120_test/
trunk/tests/z120_test/CMakeLists.txt
trunk/tests/z120_test/z120_test.cpp
trunk/tests/z120_test/z120_test00.mpr
trunk/tests/z120_test/z120_test01.mpr
trunk/tests/z120_test/z120_test02.mpr
trunk/tests/z120_test/z120_test03.mpr
trunk/tests/z120_test/z120_test04.mpr
trunk/tests/z120_test/z120_test05.mpr
trunk/tests/z120_test/z120_test06.mpr
trunk/tests/z120_test/z120_test07.mpr
trunk/tests/z120_test/z120_test08.mpr
trunk/tests/z120_test/z120_test09.mpr
trunk/tests/z120_test/z120_test10.mpr
trunk/tests/z120_test/z120_test11.mpr
trunk/tests/z120_test/z120_test12.mpr
trunk/tests/z120_test/z120_test13.mpr
trunk/tests/z120_test/z120_test14.mpr
trunk/tests/z120_test/z120_test15.mpr
trunk/tests/z120_test/z120_test16.mpr
trunk/tests/z120_test/z120_test17.mpr
trunk/tests/z120_test/z120_test18.mpr
trunk/tests/z120_test/z120_test19.mpr
trunk/tests/z120_test/z120_test20.mpr
trunk/tests/z120_test/z120_test21.mpr
trunk/tests/z120_test/z120_test22.mpr
trunk/tests/z120_test/z120_test23.mpr
trunk/tests/z120_test/z120_test24.mpr
trunk/tests/z120_test/z120_test25.mpr
trunk/tests/z120_test/z120_test26.mpr
trunk/tests/z120_test/z120_test27.mpr
trunk/tests/z120_test/z120_test28.mpr
trunk/tests/z120_test/z120_test29.mpr
trunk/tests/z120_test/z120_test30.mpr
trunk/tests/z120_test/z120_test31.mpr
trunk/tests/z120_test/z120_test32.mpr
trunk/tests/z120_test/z120_test33.mpr
trunk/tests/z120_test/z120_test34.mpr
trunk/tests/z120_test/z120_test35.mpr
trunk/tests/z120_test/z120_test36.mpr
trunk/tests/z120_test/z120_test37.mpr
Removed Paths:
-------------
trunk/tests/z120_test.cpp
trunk/tests/z120_test00.mpr
trunk/tests/z120_test01.mpr
trunk/tests/z120_test02.mpr
trunk/tests/z120_test03.mpr
trunk/tests/z120_test04.mpr
trunk/tests/z120_test05.mpr
trunk/tests/z120_test06.mpr
trunk/tests/z120_test07.mpr
trunk/tests/z120_test08.mpr
trunk/tests/z120_test09.mpr
trunk/tests/z120_test10.mpr
trunk/tests/z120_test11.mpr
trunk/tests/z120_test12.mpr
trunk/tests/z120_test13.mpr
trunk/tests/z120_test14.mpr
trunk/tests/z120_test15.mpr
trunk/tests/z120_test16.mpr
trunk/tests/z120_test17.mpr
trunk/tests/z120_test18.mpr
trunk/tests/z120_test19.mpr
trunk/tests/z120_test20.mpr
trunk/tests/z120_test21.mpr
trunk/tests/z120_test22.mpr
trunk/tests/z120_test23.mpr
trunk/tests/z120_test24.mpr
trunk/tests/z120_test25.mpr
trunk/tests/z120_test26.mpr
trunk/tests/z120_test27.mpr
trunk/tests/z120_test28.mpr
trunk/tests/z120_test29.mpr
trunk/tests/z120_test30.mpr
trunk/tests/z120_test31.mpr
trunk/tests/z120_test32.mpr
trunk/tests/z120_test33.mpr
trunk/tests/z120_test34.mpr
trunk/tests/z120_test35.mpr
trunk/tests/z120_test36.mpr
trunk/tests/z120_test37.mpr
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2009-09-09 09:12:57 UTC (rev 290)
+++ trunk/src/data/Z120/Context.cpp 2009-09-09 10:22:33 UTC (rev 291)
@@ -146,6 +146,8 @@
struct s_Msc* get_total_msc_fun(struct Context* context)
{
Msc* my_msc = NULL;
+
+printf("asdfasdfa %d", context->nonpointed.size());
if(context->nonpointed.size() > 1)
{
context->z->print_report(RS_WARNING, L"Warning 02: There are more unreferenced MSC\n");
@@ -165,7 +167,23 @@
}
return static_cast<s_Msc*> (my_msc);
}
+/*
+struct s_Msc** get_total_msc_fun(struct context)
+ if(mscs.size > 0)
+ i = 0;
+ s_Msc** result = new s_Msc* [mscs.size+1];
+ for x in mscs
+ my_msc = *x;
+ if my_msc != NULL;
+ intrusive_ptr_add_ref(my_msc)
+ result[i++] = my_msc;
+
+ result[i] = NULL;
+//zo zaciatku tam dat nonpointed a potom ostatne.
+}
+*/
+
/*
* Memory initialization.
*/
@@ -232,6 +250,10 @@
void msc_was_read_fun(struct Context* context)
{
+ if(context->mscs.find(context->msc_name) != context->mscs.end()){
+ context->z->print_report(RS_WARNING, stringize() << "Warning 17: Two mscs have the same name (" << TOWSTRING(context->msc_name) << ")\n");
+// return ;
+ }
context->mscs.insert(std::make_pair(context->msc_name, get_msc_fun(context)));
std::map<std::string, std::set<ReferenceNodePtr> >::iterator future_ref_it;
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2009-09-09 09:12:57 UTC (rev 290)
+++ trunk/tests/CMakeLists.txt 2009-09-09 10:22:33 UTC (rev 291)
@@ -81,59 +81,9 @@
IF(ANTLR_FOUND)
ADD_DEFINITIONS(-DHAVE_ANTLR)
-ADD_EXECUTABLE(z120_test
- z120_test.cpp
-)
-TARGET_LINK_LIBRARIES(z120_test
- scZ120
-)
-SET(Z120_SEQUENCE 0)
-MACRO(ADD_Z120_TEST FILE SATISFIED)
- ADD_TEST("z120_test-${Z120_SEQUENCE}"
- ${EXECUTABLE_OUTPUT_PATH}/z120_test ${FILE} ${SATISFIED})
- MATH(EXPR Z120_SEQUENCE ${Z120_SEQUENCE}+1)
-ENDMACRO(ADD_Z120_TEST)
+ADD_SUBDIRECTORY(z120_test)
-ADD_Z120_TEST(z120_test00.mpr 1)
-ADD_Z120_TEST(z120_test01.mpr 1)
-ADD_Z120_TEST(z120_test02.mpr 1)
-ADD_Z120_TEST(z120_test03.mpr 1)
-ADD_Z120_TEST(z120_test04.mpr 1)
-ADD_Z120_TEST(z120_test05.mpr 1)
-ADD_Z120_TEST(z120_test06.mpr 1)
-ADD_Z120_TEST(z120_test07.mpr 1)
-ADD_Z120_TEST(z120_test08.mpr 1)
-ADD_Z120_TEST(z120_test09.mpr 1)
-ADD_Z120_TEST(z120_test10.mpr 1)
-ADD_Z120_TEST(z120_test11.mpr 1)
-ADD_Z120_TEST(z120_test12.mpr 1)
-ADD_Z120_TEST(z120_test13.mpr 1)
-ADD_Z120_TEST(z120_test14.mpr 1)
-ADD_Z120_TEST(z120_test15.mpr 1)
-ADD_Z120_TEST(z120_test16.mpr 1)
-ADD_Z120_TEST(z120_test17.mpr 1)
-ADD_Z120_TEST(z120_test18.mpr 1)
-ADD_Z120_TEST(z120_test19.mpr 1)
-ADD_Z120_TEST(z120_test20.mpr 1)
-ADD_Z120_TEST(z120_test21.mpr 1)
-ADD_Z120_TEST(z120_test22.mpr 1)
-ADD_Z120_TEST(z120_test23.mpr 1)
-ADD_Z120_TEST(z120_test24.mpr 1)
-ADD_Z120_TEST(z120_test25.mpr 1)
-ADD_Z120_TEST(z120_test26.mpr 1)
-ADD_Z120_TEST(z120_test27.mpr 1)
-ADD_Z120_TEST(z120_test28.mpr 1)
-ADD_Z120_TEST(z120_test29.mpr 1)
-ADD_Z120_TEST(z120_test30.mpr 1)
-ADD_Z120_TEST(z120_test31.mpr 1)
-ADD_Z120_TEST(z120_test32.mpr 1)
-ADD_Z120_TEST(z120_test33.mpr 1)
-ADD_Z120_TEST(z120_test34.mpr 1)
-ADD_Z120_TEST(z120_test35.mpr 1)
-ADD_Z120_TEST(z120_test36.mpr 1)
-ADD_Z120_TEST(z120_test37.mpr 1)
-
ADD_EXECUTABLE(checker_test
checker_test.cpp
)
Copied: trunk/tests/z120_test/CMakeLists.txt (from rev 290, trunk/tests/CMakeLists.txt)
===================================================================
--- trunk/tests/z120_test/CMakeLists.txt (rev 0)
+++ trunk/tests/z120_test/CMakeLists.txt 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,54 @@
+ADD_EXECUTABLE(z120_test
+ z120_test.cpp
+)
+TARGET_LINK_LIBRARIES(z120_test
+ scZ120
+)
+
+SET(Z120_SEQUENCE 0)
+MACRO(ADD_Z120_TEST FILE SATISFIED)
+ ADD_TEST("z120_test-${Z120_SEQUENCE}"
+ ${EXECUTABLE_OUTPUT_PATH}/z120_test ${FILE} ${SATISFIED})
+ MATH(EXPR Z120_SEQUENCE ${Z120_SEQUENCE}+1)
+ENDMACRO(ADD_Z120_TEST)
+
+ADD_Z120_TEST(z120_test00.mpr 1)
+ADD_Z120_TEST(z120_test01.mpr 1)
+ADD_Z120_TEST(z120_test02.mpr 1)
+ADD_Z120_TEST(z120_test03.mpr 1)
+ADD_Z120_TEST(z120_test04.mpr 1)
+ADD_Z120_TEST(z120_test05.mpr 1)
+ADD_Z120_TEST(z120_test06.mpr 1)
+ADD_Z120_TEST(z120_test07.mpr 1)
+ADD_Z120_TEST(z120_test08.mpr 1)
+ADD_Z120_TEST(z120_test09.mpr 1)
+ADD_Z120_TEST(z120_test10.mpr 1)
+ADD_Z120_TEST(z120_test11.mpr 1)
+ADD_Z120_TEST(z120_test12.mpr 1)
+ADD_Z120_TEST(z120_test13.mpr 1)
+ADD_Z120_TEST(z120_test14.mpr 1)
+ADD_Z120_TEST(z120_test15.mpr 1)
+ADD_Z120_TEST(z120_test16.mpr 1)
+ADD_Z120_TEST(z120_test17.mpr 1)
+ADD_Z120_TEST(z120_test18.mpr 1)
+ADD_Z120_TEST(z120_test19.mpr 1)
+ADD_Z120_TEST(z120_test20.mpr 1)
+ADD_Z120_TEST(z120_test21.mpr 1)
+ADD_Z120_TEST(z120_test22.mpr 1)
+ADD_Z120_TEST(z120_test23.mpr 1)
+ADD_Z120_TEST(z120_test24.mpr 1)
+ADD_Z120_TEST(z120_test25.mpr 1)
+ADD_Z120_TEST(z120_test26.mpr 1)
+ADD_Z120_TEST(z120_test27.mpr 1)
+ADD_Z120_TEST(z120_test28.mpr 1)
+ADD_Z120_TEST(z120_test29.mpr 1)
+ADD_Z120_TEST(z120_test30.mpr 1)
+ADD_Z120_TEST(z120_test31.mpr 0)
+ADD_Z120_TEST(z120_test32.mpr 1)
+ADD_Z120_TEST(z120_test33.mpr 1)
+ADD_Z120_TEST(z120_test34.mpr 1)
+ADD_Z120_TEST(z120_test35.mpr 1)
+ADD_Z120_TEST(z120_test36.mpr 1)
+ADD_Z120_TEST(z120_test37.mpr 1)
+
+# $Id$
Property changes on: trunk/tests/z120_test/CMakeLists.txt
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/tests/z120_test/z120_test.cpp (from rev 290, trunk/tests/z120_test.cpp)
===================================================================
--- trunk/tests/z120_test/z120_test.cpp (rev 0)
+++ trunk/tests/z120_test/z120_test.cpp 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,100 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2009 Petr Gotthard <pet...@ce...>
+ *
+ * $Id$
+ */
+
+#include <string.h>
+#include <iostream>
+
+#include "data/Z120/z120.h"
+
+char* extract_filename(char* filename)
+{
+ char *last_name = filename;
+ char *last_dot = NULL;
+
+ for(char *pos = filename; *pos != '\0'; pos++)
+ {
+ if(*pos == '.')
+ last_dot = pos;
+ else if(*pos == '\\' || *pos == '/')
+ last_name = pos+1;
+ }
+
+ if(last_dot != NULL)
+ *last_dot = '\0'; // strip the extension
+
+ return last_name;
+}
+
+int main(int argc, char** argv)
+{
+ if(argc < 3)
+ {
+ std::cerr << "Usage: " << argv[0] << " <filename> <satisfied>" << std::endl;
+ return 1;
+ }
+
+ Z120 z120;
+
+ StreamReportPrinter printer(std::wcerr);
+ z120.set_printer(&printer);
+
+ int errors = 0;
+
+ char *endptr;
+ int satisfied = strtol(argv[2], &endptr, 10);
+ if(*argv[2] == '\0' || *endptr != '\0')
+ {
+ std::cerr << "ERROR: Not a boolean value: " << argv[2] << std::endl;
+ return 1;
+ }
+
+ MscPtr msc = z120.load_msc(argv[1]);
+ if(msc != NULL)
+ {
+ if(satisfied)
+ std::cout << "OK: " << argv[1] << " is correct, should be correct" << std::endl;
+ else
+ {
+ std::cerr << "ERROR: " << argv[1] << " is correct, should NOT be correct" << std::endl;
+ errors = 1;
+ }
+
+ char *path = strdup(argv[1]);
+ char *filename = extract_filename(path);
+
+ std::cout << std::endl;
+
+ z120.save_msc(std::cout, TOWSTRING(filename), msc);
+
+ free(path);
+ }
+ else
+ {
+ if(satisfied)
+ {
+ std::cerr << "ERROR: Syntax error in " << argv[1] << ", should NOT be erroneous" << std::endl;
+ errors = 1;
+ }
+ else
+ std::cout << "OK: Syntax error in " << argv[1] << ", should be erroneous" << std::endl;
+ }
+
+ return errors;
+}
+
+// $Id$
Property changes on: trunk/tests/z120_test/z120_test.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/tests/z120_test/z120_test00.mpr (from rev 290, trunk/tests/z120_test00.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test00.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test00.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,16 @@
+msc pok2;
+A: instance;
+B: instance;
+A: in A,1 from found;
+A: out jedna,2 to B;
+B: in jedna,2 from A;
+A: concurrent;
+A: out B1,3 to B;
+B: in B1,3 from A;
+A: out B,4 to lost;
+A: endconcurrent;
+A: in jedna,4 from B;
+B: out jedna,4 to A;
+A: endinstance;
+B: endinstance;
+endmsc;
Copied: trunk/tests/z120_test/z120_test01.mpr (from rev 290, trunk/tests/z120_test01.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test01.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test01.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,45 @@
+/*
+ * Created by Telelogic SDL 4.4
+ * This test contains
+ * - Comments
+ * - Unterminated instance
+ * - Lost, found, loopback and overtaking messages
+ * - Messages of the same name
+ */
+mscdocument z120_test01;
+msc z120_test01;
+/*#SDTREF(MSC,-b 4,109)*/
+ONE: instance;
+/*#SDTREF(MSC,-b 4,110)*/
+TWO: instance;
+text
+/*#SDTREF(MSC,-b 4,108)*/
+'Comment';
+TWO: out
+/*#SDTREF(MSC,-b 4,111)*/
+LOOPBACK,1(parameter) to TWO;
+ONE: in
+/*#SDTREF(MSC,-b 4,114)*/
+LEFT,2(parameter) from found;
+TWO: out
+/*#SDTREF(MSC,-b 4,116)*/
+RIGHT,3(parameter) to lost;
+ONE: out
+/*#SDTREF(MSC,-b 4,119)*/
+NAME,4(parameter) to TWO;
+ONE: out
+/*#SDTREF(MSC,-b 4,121)*/
+NAME,5(parameter) to TWO;
+TWO: in
+/*#SDTREF(MSC,-b 4,122)*/
+NAME,5(parameter) from ONE;
+TWO: in
+/*#SDTREF(MSC,-b 4,120)*/
+NAME,4(parameter) from ONE;
+TWO: in
+/*#SDTREF(MSC,-b 4,112)*/
+LOOPBACK,1(parameter) from TWO;
+ONE: endinstance
+/*#SDTREF(MSC,-b 4,123)*/
+;
+endmsc;
Property changes on: trunk/tests/z120_test/z120_test01.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/tests/z120_test/z120_test02.mpr (from rev 290, trunk/tests/z120_test02.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test02.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test02.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,21 @@
+/*
+ * Created by Telelogic SDL 4.4
+ * This test contains
+ * - Comments
+ * - Conditions, references
+ */
+mscdocument z120_test02;
+msc z120_test02;
+expr L2;
+ L1: text 'Comment';
+ L2: connect seq (L3 alt L4);
+ L3: condition STATE1 seq (L5);
+ L4: condition STATE2 seq (L6);
+ L5: (ACTION1) seq (L7);
+ L6: (ACTION2) seq (L8 alt L9);
+ L7: end;
+ L8: (ACTION3A) seq (L2);
+ L9: (ACTION3B) seq (L10);
+ L10: end;
+endmsc;
+
Property changes on: trunk/tests/z120_test/z120_test02.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Added: svn:eol-style
+ native
Copied: trunk/tests/z120_test/z120_test03.mpr (from rev 290, trunk/tests/z120_test03.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test03.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test03.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,40 @@
+/*****************************************************
+Simple test of bmsc (event driven notification)
+
+Anticipated result:
+
+mscdocument z120_test03;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+in A,0 from found;
+out jedna,1 to B;
+concurrent;
+label e0; out B1,2 to B;
+label e1; out B,3 to lost;
+endconcurrent;
+endinstance;
+B: instance;
+in jedna,1 from A;
+in B1,2 from A;
+endinstance;
+endmsc;
+
+******************************************************/
+
+mscdocument bbb;
+msc pok2;
+A: instance;
+B: instance;
+A: in A,1 from found;
+A: out jedna,2 to B;
+B: in jedna,2 from A;
+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;
Property changes on: trunk/tests/z120_test/z120_test03.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test04.mpr (from rev 290, trunk/tests/z120_test04.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test04.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test04.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,30 @@
+/*************************************************
+Simple test of HMSC
+
+Anticipated result:
+
+Warning 09: There is reference to nonexisted MSC
+
+mscdocument z120_test04;
+msc Stranka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference NAME connect L2;
+L2: reference NAME1 connect L3;
+L3: final;
+endmsc;
+msc NAME;
+endmsc;
+msc NAME1;
+endmsc;
+
+**************************************************/
+
+msc Stranka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference NAME connect L2;
+L2: reference NAME1 connect L3;
+L3: final;
+endmsc;
+
Property changes on: trunk/tests/z120_test/z120_test04.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test05.mpr (from rev 290, trunk/tests/z120_test05.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test05.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test05.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,34 @@
+/***********************************************
+Simple test of bMSC (event driven notification)
+
+Anticipated result:
+
+mscdocument z120_test05;
+msc pok2;
+inst p1;
+inst p2;
+p1: instance;
+out a,0 to p2;
+in a,1 from p2;
+endinstance;
+p2: instance;
+in a,0 from p1;
+out a,1 to p1;
+endinstance;
+endmsc;
+
+***********************************************/
+
+msc pok2;
+p1: instance;
+p2: instance;
+
+p1: out a to p2;
+p2: in a from p1;
+
+p2: out a to p1;
+p1: in a from p2;
+
+p1: endinstance;
+p2: endinstance;
+endmsc;
Property changes on: trunk/tests/z120_test/z120_test05.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test06.mpr (from rev 290, trunk/tests/z120_test06.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test06.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test06.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,31 @@
+/*********************************************
+Simple bMSC (event driven notification)
+
+Anticipated result:
+
+mscdocument z120_test06;
+msc Strnka1;
+inst I1;
+inst I2;
+I1: instance;
+out M1,0 to I2;
+out M1,1 to I2;
+endinstance;
+I2: instance;
+in M1,0 from I1;
+in M1,1 from I1;
+endinstance;
+endmsc;
+
+*********************************************/
+
+msc Strnka1;
+I1: instance;
+I1: out M1 to I2;
+I1: out M1 to I2;
+I1: endinstance;
+I2: instance;
+I2: in M1 from I1;
+I2: in M1 from I1;
+I2: endinstance;
+endmsc;
Property changes on: trunk/tests/z120_test/z120_test06.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test07.mpr (from rev 290, trunk/tests/z120_test07.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test07.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test07.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,34 @@
+/************************************************
+Simple example of bMSC (instance driven notification)
+
+Anticipated result:
+
+mscdocument z120_test07;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+out M1,0 to B;
+out M2,1 to B;
+endinstance;
+B: instance;
+in M1,0 from A;
+in M2,1 from A;
+endinstance;
+endmsc;
+
+************************************************/
+
+msc pok2;
+inst A;
+inst B;
+A: instance;
+ out M1,0 to B;
+ out M2,1 to B;
+ endinstance;
+
+B: instance;
+ in M1,0 from A;
+ in M2,1 from A;
+ endinstance;
+endmsc;
Property changes on: trunk/tests/z120_test/z120_test07.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test08.mpr (from rev 290, trunk/tests/z120_test08.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test08.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test08.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,38 @@
+/***********************************************
+Example of bMsc with coregion (instance driven notification)
+
+Anticipated result:
+
+mscdocument z120_test08;
+msc Stranka1;
+inst NAME1;
+inst NAME2;
+NAME1: instance;
+concurrent;
+label e0; out b,0 to NAME2 before e1;
+label e1; in a,1 from NAME2;
+endconcurrent;
+endinstance;
+NAME2: instance;
+out a,1 to NAME1;
+in b,0 from NAME1;
+endinstance;
+endmsc;
+
+***********************************************/
+
+msc Stranka1;
+inst NAME1;
+inst NAME2;
+NAME1: instance;
+concurrent;
+label e1; out b,1 to NAME2 before e0;
+label e0; in a,0 from NAME2;
+endconcurrent;
+endinstance;
+NAME2: instance;
+out a,0 to NAME1;
+in b,1 from NAME1;
+endinstance;
+endmsc;
+
Property changes on: trunk/tests/z120_test/z120_test08.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test09.mpr (from rev 290, trunk/tests/z120_test09.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test09.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test09.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,28 @@
+/*************************************************
+Exampe of bMsc where are 2 instances with the same name.
+
+Anticipated result:
+
+mscdocument z120_test09;
+msc Stranka1;
+inst NAME;
+inst NAME;
+NAME: instance;
+endinstance;
+NAME: instance;
+endinstance;
+endmsc;
+
+
+*************************************************/
+
+mscdocument Vykres1;
+msc Stranka1;
+inst NAME;
+inst NAME;
+NAME: instance;
+endinstance;
+NAME: instance;
+endinstance;
+endmsc;
+
Property changes on: trunk/tests/z120_test/z120_test09.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test10.mpr (from rev 290, trunk/tests/z120_test10.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test10.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test10.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,38 @@
+/***************************************************
+Example of bMSC with mesages with the same name.
+
+Anticipated result:
+
+mscdocument z120_test10;
+msc Stranka1;
+inst W;
+inst Q;
+W: instance;
+out a,0 to Q;
+out a,1 to Q;
+out a,2 to Q;
+endinstance;
+Q: instance;
+in a,0 from W;
+in a,1 from W;
+in a,2 from W;
+endinstance;
+endmsc;
+
+***************************************************/
+
+msc Stranka1;
+inst W;
+inst Q;
+W: instance;
+out a to Q;
+out a to Q;
+out a to Q;
+endinstance;
+Q: instance;
+in a from W;
+in a from W;
+in a from W;
+endinstance;
+endmsc;
+
Property changes on: trunk/tests/z120_test/z120_test10.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test11.mpr (from rev 290, trunk/tests/z120_test11.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test11.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test11.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,54 @@
+/*************************************************
+Example of bMSC with coregion (used '_' sign)
+
+Anticipated result:
+
+mscdocument z120_test11;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; in request_a,3 from PC before e1;
+label e2; in request_b,4 from PC;
+label e1; out result,5 to PC;
+endconcurrent;
+endinstance;
+endmsc;
+
+*************************************************/
+
+mscdocument Vkres1;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; in request_a,3 from PC before e1;
+label e2; in request_b,4 from PC;
+label e1; out result,5 to PC;
+endconcurrent;
+endinstance;
+endmsc;
Property changes on: trunk/tests/z120_test/z120_test11.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test12.mpr (from rev 290, trunk/tests/z120_test12.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test12.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test12.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,70 @@
+/*************************************************
+Example of bMSC with two coretions on instances
+
+Anticipated result:
+
+mscdocument z120_test12;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e1; out ano,1 to B;
+label e2; in nie,2 from B;
+endconcurrent;
+concurrent;
+label e3; out micron,3 to B;
+label e4; out rad,4 to lost;
+endconcurrent;
+in dan,5 from B;
+in track,6 from B;
+endinstance;
+B: instance;
+concurrent;
+label e5; in ano,1 from A;
+label e6; out nie,2 to A;
+label e7; in ano,0 from A;
+endconcurrent;
+in micron,3 from A;
+concurrent;
+label e8; out dan,5 to A;
+endconcurrent;
+out track,6 to A;
+in rad,7 from found;
+endinstance;
+endmsc;
+
+*************************************************/
+
+mscdocument test11.vsd;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e1; out ano,1 to B;
+label e2; in nie,2 from B;
+endconcurrent;
+concurrent;
+label e3; out micron,3 to B;
+label e4; out rad,4 to lost;
+endconcurrent;
+in dan,5 from B;
+in track,6 from B;
+endinstance;
+B: instance;
+concurrent;
+label e5; in ano,1 from A;
+label e6; out nie,2 to A;
+label e7; in ano,0 from A;
+endconcurrent;
+in micron,3 from A;
+concurrent;
+label e8; out dan,5 to A;
+endconcurrent;
+out track,6 to A;
+in rad,7 from found;
+endinstance;
+endmsc;
Property changes on: trunk/tests/z120_test/z120_test12.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test13.mpr (from rev 290, trunk/tests/z120_test13.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test13.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test13.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,54 @@
+/************************************************
+Example of bMSC with before, after relation between messages.
+
+Anticipated result:
+
+mscdocument z120_test13;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; out result,5 to PC before e1;
+label e2; in request_b,4 from PC;
+label e1; in request_a,3 from PC;
+endconcurrent;
+endinstance;
+endmsc;
+
+************************************************/
+
+mscdocument Vkres1;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; in request_a,3 from PC after e1;
+label e2; in request_b,4 from PC;
+label e1; out result,5 to PC;
+endconcurrent;
+endinstance;
+endmsc;
Property changes on: trunk/tests/z120_test/z120_test13.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test14.mpr (from rev 290, trunk/tests/z120_test14.mpr)
===================================================================
--- trunk/tests/z120_test/z120_test14.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test14.mpr 2009-09-09 10:22:33 UTC (rev 291)
@@ -0,0 +1,63 @@
+/***********************************************
+Example of bMSC
+
+Anticipated result:
+
+mscdocument z120_test14;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e1; in nie,1 from B;
+endconcurrent;
+concurrent;
+label e2; out micron,2 to B;
+endconcurrent;
+in dan,3 from B;
+in track,4 from B;
+endinstance;
+B: instance;
+concurrent;
+label e3; out nie,1 to A;
+label e4; in ano,0 from A;
+endconcurrent;
+in micron,2 from A;
+concurrent;
+label e5; out dan,3 to A;
+endconcurrent;
+out track,4 to A;
+in rad,5 from found;
+endinstance;
+endmsc;
+
+***********************************************/
+mscdocument test11.vsd;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e2; in nie,2 from B;
+endconcurrent;
+concurrent;
+label e3; out micron,3 to B;
+endconcurrent;
+in dan,5 from B;
+in track,6 from B;
+endinstance;
+B: instance;
+concurrent;
+label e6; out nie,2 to A;
+label e7; in ano,0 from A;
+endconcurrent;
+in micron,3 from A;
+concurrent;
+label e8; out dan,5 to A;
+endconcurrent;
+out track,6 to A;
+in rad,7 from found;
+endinstance;
+endmsc;
Property changes on: trunk/tests/z120_test/z120_test14.mpr
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/tests/z120_test/z120_test15.mpr (from rev 290, trunk/tests/z120_test15....
[truncated message content] |
|
From: <got...@us...> - 2009-09-09 13:36:37
|
Revision: 294
http://scstudio.svn.sourceforge.net/scstudio/?rev=294&view=rev
Author: gotthardp
Date: 2009-09-09 13:36:30 +0000 (Wed, 09 Sep 2009)
Log Message:
-----------
New interface for MSC import formatter.
Modified Paths:
--------------
trunk/src/check/pseudocode/utils.h
trunk/src/data/engmann/engmann.cpp
trunk/src/data/engmann/engmann.h
trunk/src/data/formatter.h
trunk/tests/checker_test.cpp
trunk/tests/engmann_test.cpp
Modified: trunk/src/check/pseudocode/utils.h
===================================================================
--- trunk/src/check/pseudocode/utils.h 2009-09-09 13:01:17 UTC (rev 293)
+++ trunk/src/check/pseudocode/utils.h 2009-09-09 13:36:30 UTC (rev 294)
@@ -29,7 +29,7 @@
InstanceIdMarker(const std::string& instance_id_attribute="instance_id");
- void on_white_node_found(ReferenceNode* node);
+ virtual void on_white_node_found(ReferenceNode* node);
size_t get_instance_id(Instance* i);
@@ -102,7 +102,7 @@
void cleanup_attributes();
- void on_white_node_found(HMscNode* n);
+ virtual void on_white_node_found(HMscNode* n);
bool& get_mark(HMscNode* n);
};
Modified: trunk/src/data/engmann/engmann.cpp
===================================================================
--- trunk/src/data/engmann/engmann.cpp 2009-09-09 13:01:17 UTC (rev 293)
+++ trunk/src/data/engmann/engmann.cpp 2009-09-09 13:36:30 UTC (rev 294)
@@ -138,9 +138,9 @@
return pos->second;
}
-MscPtr Engmann::load_msc(const std::string &filename)
+std::vector<MscPtr> Engmann::load_msc(const std::string &filename)
{
- BMscPtr result = new BMsc();
+ std::vector<MscPtr> result;
InstanceAreaMap instances;
@@ -156,9 +156,10 @@
{
print_report(RS_ERROR,
stringize() << "Cannot open file '" << TOWSTRING(filename) << "'.");
- return NULL;
+ return result;
}
+ BMscPtr bmsc = new BMsc();
while(stream.good())
{
TToken token = get_token(stream);
@@ -170,7 +171,7 @@
{
if(wcscmp(token.text.c_str(), L"title") == 0)
{
- result->set_label(read_line(stream));
+ bmsc->set_label(read_line(stream));
}
else if(wcscmp(token.text.c_str(), L"node") == 0)
{
@@ -181,7 +182,7 @@
InstancePtr inst = new Instance(node_name.text);
inst->set_width(10);
inst->set_line_begin(MscPoint(current_x,5));
- result->add_instance(inst);
+ bmsc->add_instance(inst);
EventAreaPtr area = new StrictOrderArea();
inst->add_area(area);
@@ -242,6 +243,7 @@
inst->set_line_end(MscPoint(my_x,my_y+current_y));
}
+ result.push_back(bmsc);
return result;
}
Modified: trunk/src/data/engmann/engmann.h
===================================================================
--- trunk/src/data/engmann/engmann.h 2009-09-09 13:01:17 UTC (rev 293)
+++ trunk/src/data/engmann/engmann.h 2009-09-09 13:36:30 UTC (rev 294)
@@ -34,7 +34,7 @@
{ return "Engmann Message Chart"; }
//! import MSC document
- virtual MscPtr load_msc(const std::string &filename);
+ virtual std::vector<MscPtr> load_msc(const std::string &filename);
protected:
};
Modified: trunk/src/data/formatter.h
===================================================================
--- trunk/src/data/formatter.h 2009-09-09 13:01:17 UTC (rev 293)
+++ trunk/src/data/formatter.h 2009-09-09 13:36:30 UTC (rev 294)
@@ -49,7 +49,7 @@
virtual ~ImportFormatter() {}
//! import MSC document
- virtual MscPtr load_msc(const std::string &filename) = 0;
+ virtual std::vector<MscPtr> load_msc(const std::string &filename) = 0;
};
typedef boost::shared_ptr<ImportFormatter> ImportFormatterPtr;
Modified: trunk/tests/checker_test.cpp
===================================================================
--- trunk/tests/checker_test.cpp 2009-09-09 13:01:17 UTC (rev 293)
+++ trunk/tests/checker_test.cpp 2009-09-09 13:36:30 UTC (rev 294)
@@ -106,8 +106,8 @@
StreamReportPrinter printer(std::wcerr);
z120.set_printer(&printer);
- MscPtr msc = z120.load_msc(argv[3]);
- if(msc == NULL)
+ std::vector<MscPtr> msc = z120.load_msc(argv[3]);
+ if(msc.empty())
{
std::cerr << "ERROR: Cannot open " << argv[3] << std::endl;
LIBRARY_CLOSE(module);
@@ -127,7 +127,7 @@
try
{
- MscPtr result = run_check(init_checkers, argv[2], msc);
+ MscPtr result = run_check(init_checkers, argv[2], msc[0]);
if(result == NULL)
{
if(satisfied)
Modified: trunk/tests/engmann_test.cpp
===================================================================
--- trunk/tests/engmann_test.cpp 2009-09-09 13:01:17 UTC (rev 293)
+++ trunk/tests/engmann_test.cpp 2009-09-09 13:36:30 UTC (rev 294)
@@ -33,15 +33,15 @@
StreamReportPrinter printer(std::wcerr);
engmann.set_printer(&printer);
- MscPtr msc = engmann.load_msc(argv[1]);
- if(msc == NULL)
+ std::vector<MscPtr> msc = engmann.load_msc(argv[1]);
+ if(msc.empty())
{
std::cerr << "ERROR: Syntax error in " << argv[1] << std::endl;
return 1;
}
Z120 z120;
- z120.save_msc(std::cout, TOWSTRING(argv[1]), msc);
+ z120.save_msc(std::cout, TOWSTRING(argv[1]), msc[0]);
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2009-09-09 20:21:03
|
Revision: 298
http://scstudio.svn.sourceforge.net/scstudio/?rev=298&view=rev
Author: madzin
Date: 2009-09-09 20:20:52 +0000 (Wed, 09 Sep 2009)
Log Message:
-----------
Add new test and fix some errors
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/src/data/Z120/Context.h
trunk/src/data/Z120/Z120.g
trunk/src/data/Z120/z120.h
trunk/src/data/Z120/z120_load.cpp
trunk/tests/z120_test/z120_test.cpp
Added Paths:
-----------
trunk/tests/z120_test/z120_test38.mpr
trunk/tests/z120_test/z120_test39.mpr
trunk/tests/z120_test/z120_test40.mpr
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2009-09-09 14:17:15 UTC (rev 297)
+++ trunk/src/data/Z120/Context.cpp 2009-09-09 20:20:52 UTC (rev 298)
@@ -21,6 +21,9 @@
* see http://www.antlr.org
*/
+/*
+ * Maximal number of warning/error message is 19
+ */
#ifndef __ParserStruct__
#define __ParserStruct__
@@ -48,7 +51,7 @@
/*
* Textual file
*/
- std::map<std::string, MscPtr> mscs; //map of msc in the file
+ std::multimap<std::string, MscPtr> mscs; //map of msc in the file
std::set<std::string> nonpointed; //msc which is not refered
std::map<std::string, std::set<ReferenceNodePtr> > future_reference; //map of name of nodes on which was refered and does not exist
Z120* z;
@@ -67,6 +70,7 @@
EventPtr current_event; //event which was currently created
std::string event_name; //name of event
int not_create_event;
+ int no_message_label;
/*
* HMsc
@@ -118,6 +122,7 @@
context->named_events.clear();
context->current_event = NULL;
context->not_create_event = 0;
+ context->no_message_label = 0;
context->start_node = NULL;
context->end_node = std::make_pair("", context->end_node.second); //replaice context->end_node.second with NULL
@@ -143,11 +148,8 @@
return NULL;
}
-struct s_Msc* get_total_msc_fun(struct Context* context)
+struct s_Msc** get_total_msc_fun(struct Context* context)
{
- Msc* my_msc = NULL;
-
-printf("asdfasdfa %d", context->nonpointed.size());
if(context->nonpointed.size() > 1)
{
context->z->print_report(RS_WARNING, L"Warning 02: There are more unreferenced MSC\n");
@@ -157,33 +159,45 @@
context->z->print_report(RS_ERROR, L"Error 03: There is no MSC without reference\n");
return NULL;
}
+
+ s_Msc** result;
+
if(context->mscs.size() > 0){
- my_msc = context->mscs.find(*(context->nonpointed.begin()))->second.get();
- }
+ result = new s_Msc*[context->mscs.size()+1];
+ std::multimap<std::string, MscPtr>::iterator mscs_it;
+ std::set<std::string>::iterator nonpointed_it;
+
+ int position = 0;
+
+ while(context->nonpointed.size() != 0){
+ nonpointed_it = context->nonpointed.begin();
- if(my_msc != NULL)
- {
- intrusive_ptr_add_ref(my_msc);
- }
- return static_cast<s_Msc*> (my_msc);
-}
-/*
-struct s_Msc** get_total_msc_fun(struct context)
- if(mscs.size > 0)
- i = 0;
- s_Msc** result = new s_Msc* [mscs.size+1];
- for x in mscs
- my_msc = *x;
- if my_msc != NULL;
- intrusive_ptr_add_ref(my_msc)
- result[i++] = my_msc;
-
- result[i] = NULL;
-//zo zaciatku tam dat nonpointed a potom ostatne.
+ for(int i = context->mscs.count(*nonpointed_it); i > 0; i--){
+ mscs_it = context->mscs.find(*nonpointed_it);
+ Msc* my_msc = mscs_it->second.get();
+ if(my_msc != NULL){
+ intrusive_ptr_add_ref(my_msc);
+ result[position++] = my_msc;
+ }
+ context->mscs.erase(mscs_it);
+ }
+ context->nonpointed.erase(nonpointed_it);
+ }
+
+ for(mscs_it = context->mscs.begin(); mscs_it != context->mscs.end(); mscs_it++){
+ Msc* my_msc = mscs_it->second.get();
+ if(my_msc != NULL){
+ intrusive_ptr_add_ref(my_msc);
+ result[position++] = my_msc;
+ }
+ }
+ result[position] = NULL;
+ }
+ return result;
}
-*/
+
/*
* Memory initialization.
*/
@@ -251,8 +265,7 @@
void msc_was_read_fun(struct Context* context)
{
if(context->mscs.find(context->msc_name) != context->mscs.end()){
- context->z->print_report(RS_WARNING, stringize() << "Warning 17: Two mscs have the same name (" << TOWSTRING(context->msc_name) << ")\n");
-// return ;
+ context->z->print_report(RS_WARNING, stringize() << "Warning 18: Two mscs have the same name (" << TOWSTRING(context->msc_name) << ")\n");
}
context->mscs.insert(std::make_pair(context->msc_name, get_msc_fun(context)));
@@ -305,16 +318,24 @@
std::string msg_identification(msg_identifications);
std::string msg_name;
- size_t pos = msg_identification.rfind(',');
- if(pos != 0)
+ if(context->no_message_label == 1)
{
- msg_name = msg_identification.substr(0, pos);
+ msg_name = "";
+ context->no_message_label = 0;
}
else
{
- msg_name = msg_identification;
+ size_t pos = msg_identification.rfind(',');
+ if(pos != 0)
+ {
+ msg_name = msg_identification.substr(0, pos);
+ }
+ else
+ {
+ msg_name = msg_identification;
+ }
}
-
+
InstancePtr instance = context->instances.find(context->element_name)->second;
if (instance->get_last() == NULL ||
@@ -429,7 +450,8 @@
InstancePtr instance = context->instances.find(context->element_name)->second;
context->coregion_area_finished.insert(context->element_name);
context->coregion_area_opened.erase(context->element_name);
- }
+
+}
else
{
context->z->print_report(RS_WARNING, stringize() << "Warning 11: Instance " << TOWSTRING(context->element_name) << " does not have open any coregion\n"); //check
@@ -449,14 +471,23 @@
//message identification
std::string msg_identification(msg_identifications);
std::string msg_name;
- size_t pos = msg_identification.rfind(',');
- if(pos != 0)
+
+ if(context->no_message_label == 1)
{
- msg_name = msg_identification.substr(0, pos);
+ msg_name = "";
+ context->no_message_label = 0;
}
else
{
- msg_name = msg_identification;
+ size_t pos = msg_identification.rfind(',');
+ if(pos != 0)
+ {
+ msg_name = msg_identification.substr(0, pos);
+ }
+ else
+ {
+ msg_name = msg_identification;
+ }
}
InstancePtr instance = context->instances.find(context->element_name)->second;
@@ -595,6 +626,12 @@
context->not_create_event = 0;
}
+void missing_message_label(struct Context* context)
+{
+ context->no_message_label = 1;
+ context->z->print_report(RS_WARNING, stringize() << L"Warning 19: There is message without label on the " << TOWSTRING(context->element_name) << " instance\n");
+}
+
/*
* FUNCTIONS FOR HMSC
*/
Modified: trunk/src/data/Z120/Context.h
===================================================================
--- trunk/src/data/Z120/Context.h 2009-09-09 14:17:15 UTC (rev 297)
+++ trunk/src/data/Z120/Context.h 2009-09-09 20:20:52 UTC (rev 298)
@@ -41,7 +41,7 @@
void init(struct Context* context);
-struct s_Msc* get_total_msc_fun(struct Context* context);
+struct s_Msc** get_total_msc_fun(struct Context* context);
struct Context* new_context();
@@ -80,6 +80,8 @@
void set_not_create_event(struct Context* context);
+void missing_message_label(struct Context* context);
+
//HMsc
void new_hmsc_fun(struct Context* context);
Modified: trunk/src/data/Z120/Z120.g
===================================================================
--- trunk/src/data/Z120/Z120.g 2009-09-09 14:17:15 UTC (rev 297)
+++ trunk/src/data/Z120/Z120.g 2009-09-09 20:20:52 UTC (rev 298)
@@ -155,7 +155,7 @@
// ----- Message Sequence Chart Document
// non-standard: Z.120 doesn't define top-level nonterminal
-textual_msc_file [struct s_Z120* my_z120] returns [struct s_Msc* my_msc]:
+textual_msc_file [struct s_Z120* my_z120] returns [struct s_Msc** my_msc]:
{
context = new_context();
if(my_z120 != NULL)
@@ -489,7 +489,11 @@
;
msg_identification:
- NAME (',' NAME)? ('(' parameter_list ')')?
+ (NAME (',' NAME)? |
+ ',' NAME
+ {
+ missing_message_label(context);
+ }) ('(' parameter_list ')')?
;
output_address:
Modified: trunk/src/data/Z120/z120.h
===================================================================
--- trunk/src/data/Z120/z120.h 2009-09-09 14:17:15 UTC (rev 297)
+++ trunk/src/data/Z120/z120.h 2009-09-09 20:20:52 UTC (rev 298)
@@ -42,7 +42,7 @@
#ifdef HAVE_ANTLR
//! import MSC document
- virtual MscPtr load_msc(const std::string &filename);
+ virtual std::vector<MscPtr> load_msc(const std::string &filename);
#endif
//! Returns a list of preconditions for this format.
virtual PreconditionList get_preconditions(MscPtr msc) const;
Modified: trunk/src/data/Z120/z120_load.cpp
===================================================================
--- trunk/src/data/Z120/z120_load.cpp 2009-09-09 14:17:15 UTC (rev 297)
+++ trunk/src/data/Z120/z120_load.cpp 2009-09-09 20:20:52 UTC (rev 298)
@@ -21,35 +21,44 @@
#include "Z120Lexer.h"
#include "Z120Parser.h"
-MscPtr Z120::load_msc(const std::string &filename)
+std::vector<MscPtr> Z120::load_msc(const std::string &filename)
{
+ std::vector<MscPtr> result;
+
pANTLR3_INPUT_STREAM input =
antlr3AsciiFileStreamNew((pANTLR3_UINT8)filename.c_str());
if (input == NULL || input < 0)
{
print_report(RS_ERROR,
stringize() << "Cannot open file '" << TOWSTRING(filename) << "'.");
- return NULL;
+ return result;
}
pZ120Lexer lxr = Z120LexerNew(input);
if (lxr == NULL)
- return NULL;
+ return result;
pANTLR3_COMMON_TOKEN_STREAM tstream =
antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lxr));
if (tstream == NULL)
- return NULL;
+ return result;
pZ120Parser psr = Z120ParserNew(tstream);
if (psr == NULL)
- return NULL;
+ return result;
- Msc* my_msc = static_cast<Msc*>(psr->textual_msc_file(psr, static_cast<s_Z120*>(this)));
- MscPtr result = my_msc;
+ Msc** my_mscs = (Msc**)(psr->textual_msc_file(psr, static_cast<s_Z120*>(this)));
+
+ for(int i = 0; my_mscs[i] != NULL; i++)
+ {
+ MscPtr msc = my_mscs[i];
+ result.push_back(msc);
// my_msc is an extern "C" pointer to an object pointed by smart pointers
// the counter was increased in get_msc_fun() to avoid premature delete
- intrusive_ptr_release(my_msc);
+ intrusive_ptr_release(my_mscs[i]);
+ }
+
+ delete[] my_mscs;
psr->free(psr); psr = NULL;
tstream->free(tstream); tstream = NULL;
Modified: trunk/tests/z120_test/z120_test.cpp
===================================================================
--- trunk/tests/z120_test/z120_test.cpp 2009-09-09 14:17:15 UTC (rev 297)
+++ trunk/tests/z120_test/z120_test.cpp 2009-09-09 20:20:52 UTC (rev 298)
@@ -63,8 +63,9 @@
return 1;
}
- MscPtr msc = z120.load_msc(argv[1]);
- if(msc != NULL)
+ std::vector<MscPtr> msc = z120.load_msc(argv[1]);
+
+ if(!msc.empty())
{
if(satisfied)
std::cout << "OK: " << argv[1] << " is correct, should be correct" << std::endl;
@@ -79,7 +80,7 @@
std::cout << std::endl;
- z120.save_msc(std::cout, TOWSTRING(filename), msc);
+ z120.save_msc(std::cout, TOWSTRING(filename), msc[0], msc);
free(path);
}
Added: trunk/tests/z120_test/z120_test38.mpr
===================================================================
--- trunk/tests/z120_test/z120_test38.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test38.mpr 2009-09-09 20:20:52 UTC (rev 298)
@@ -0,0 +1,84 @@
+/***************************************************
+Example of document where two mscs have the same name (msc TWO)
+
+Anticipated result:
+
+Warning 18: Two mscs have the same name (Two)
+
+Warning 02: There are more unreferenced MSC
+
+
+mscdocument z120_test38;
+msc Stranka_1;
+initial connect L0;
+L0: reference One connect L1;
+L1: reference Two connect L2;
+L2: final;
+endmsc;
+msc Trick;
+inst NAME;
+inst NAME2;
+NAME: instance;
+out NAME,0 to NAME2;
+endinstance;
+NAME2: instance;
+in NAME,0 from NAME;
+endinstance;
+endmsc;
+msc Two;
+inst Second;
+inst First;
+Second: instance;
+out true,0 to First;
+endinstance;
+First: instance;
+in true,0 from Second;
+endinstance;
+endmsc;
+msc One;
+initial connect L0;
+L0: condition access connect L1;
+L1: final;
+endmsc;
+
+***************************************************/
+
+mscdocument Vykres2;
+
+msc Stranka_1;
+initial connect L0;
+L0: reference One connect L1;
+L1: reference Two connect L2;
+L2: final;
+endmsc;
+
+msc One;
+initial connect L0;
+L0: condition access connect L1;
+L1: final;
+endmsc;
+
+msc Trick;
+inst NAME;
+inst NAME2;
+NAME: instance;
+out NAME,0 to NAME2;
+endinstance;
+NAME2: instance;
+in NAME,0 from NAME;
+endinstance;
+endmsc;
+
+msc Two;
+inst Second;
+inst First;
+Second: instance;
+out true,0 to First;
+endinstance;
+First: instance;
+in true,0 from Second;
+endinstance;
+endmsc;
+
+msc Two;
+endmsc;
Added: trunk/tests/z120_test/z120_test39.mpr
===================================================================
--- trunk/tests/z120_test/z120_test39.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test39.mpr 2009-09-09 20:20:52 UTC (rev 298)
@@ -0,0 +1,28 @@
+/*************************************************
+Example of HMSC where the end node has defined successor.
+
+Anticipated result:
+
+Warning 20: The end node of HMSC has defined successor
+
+mscdocument z120_test39;
+msc Stranka_1;
+initial connect L0;
+L0: reference Trick connect L1;
+L1: final;
+endmsc;
+msc Trick;
+endmsc;
+
+
+*************************************************/
+
+msc Trick;
+endmsc;
+
+msc Stranka_1;
+initial connect L0;
+L0: reference Trick connect L1;
+L1: final connect L0;
+endmsc;
+
Added: trunk/tests/z120_test/z120_test40.mpr
===================================================================
--- trunk/tests/z120_test/z120_test40.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test40.mpr 2009-09-09 20:20:52 UTC (rev 298)
@@ -0,0 +1,62 @@
+/***********************************************
+Example of MSC where two MSC has the same name and one reference is to nondefined MSC.
+
+Anticipated result:
+
+Warning 18: Two mscs have the same name (Stranka_1)
+
+Warning 09: There is reference to nonexisted MSC
+
+
+mscdocument z120_test40;
+msc Stranka_1;
+initial connect L0;
+L0: reference One connect L1;
+L1: reference Two connect L2;
+L2: final;
+endmsc;
+msc One;
+initial connect L0;
+L0: condition access connect L1;
+L1: final;
+endmsc;
+msc Two;
+inst Second;
+inst First;
+Second: instance;
+out true,0 to First;
+endinstance;
+First: instance;
+in true,0 from Second;
+endinstance;
+endmsc;
+
+***********************************************/
+
+mscdocument Vykres2;
+msc Two;
+inst Second;
+inst First;
+Second: instance;
+out true,0 to First;
+endinstance;
+First: instance;
+in true,0 from Second;
+endinstance;
+endmsc;
+msc Stranka_1;
+initial connect L0;
+L0: reference One connect L1;
+L1: reference Two connect L2;
+L2: final;
+endmsc;
+msc One;
+initial connect L0;
+L0: condition access connect L1;
+L1: final;
+endmsc;
+msc Stranka_1;
+initial connect L0;
+L0: reference Trick connect L1;
+L1: final;
+endmsc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <koc...@us...> - 2009-09-10 09:52:23
|
Revision: 299
http://scstudio.svn.sourceforge.net/scstudio/?rev=299&view=rev
Author: kocianon
Date: 2009-09-10 09:52:12 +0000 (Thu, 10 Sep 2009)
Log Message:
-----------
constrain checker
Modified Paths:
--------------
trunk/src/check/pseudocode/msc_duplicators.cpp
trunk/src/check/pseudocode/msc_duplicators.h
trunk/src/check/time/constrain_check.h
trunk/src/data/msc.h
trunk/tests/CMakeLists.txt
Added Paths:
-----------
trunk/tests/constrain_check_test.cpp
Modified: trunk/src/check/pseudocode/msc_duplicators.cpp
===================================================================
--- trunk/src/check/pseudocode/msc_duplicators.cpp 2009-09-09 20:20:52 UTC (rev 298)
+++ trunk/src/check/pseudocode/msc_duplicators.cpp 2009-09-10 09:52:12 UTC (rev 299)
@@ -123,12 +123,12 @@
EventsCreatorListener::EventsCreatorListener(BMscDuplicator* duplicator, DFSAreaTraverser* traverser, BMsc* bmsc):
m_duplicator(duplicator),
- m_traverser(traverser),
- m_bmsc(bmsc),
m_last_instance(NULL),
+ m_last_new_instance(NULL),
m_last_area(NULL),
- m_last_new_instance(NULL),
- m_last_new_area(NULL)
+ m_last_new_area(NULL),
+ m_bmsc(bmsc),
+ m_traverser(traverser)
{
}
@@ -369,14 +369,14 @@
void GraphCreatorListener::on_white_node_found(ConditionNode* n)
{
- PredecessorNode* predecessor = get_predecessor();
+// PredecessorNode* predecessor = get_predecessor();
HMscNodePtr new_node = new ConditionNode(n);
process_new_node(n,new_node);
}
void GraphCreatorListener::on_white_node_found(ConnectionNode* n)
{
- PredecessorNode* predecessor = get_predecessor();
+// PredecessorNode* predecessor = get_predecessor();
HMscNodePtr new_node = new ConnectionNode(n);
process_new_node(n,new_node);
}
@@ -553,6 +553,8 @@
{
}
+//////////////////////////////////////////////////////////////////
+
HMscPtr HMscPathDuplicator::duplicate_path(const MscElementPListList& path)
{
HMscPtr root;
@@ -603,7 +605,7 @@
NodeRelationPtr new_rel;
- if(ref_node = dynamic_cast<ReferenceNode*>(*e))
+ if((ref_node = dynamic_cast<ReferenceNode*>(*e)))
{
ReferenceNode* new_ref = new ReferenceNode(ref_node);
new_ref->set_msc(ref_node->get_msc());
@@ -611,8 +613,10 @@
new_rel = new_ref->add_predecessor(new_pred);
new_pred = new_ref;
set_copy(ref_node,new_ref);
+ // copy time relations
+ process_time_relations(ref_node);
}
- else if(cond_node = dynamic_cast<ConditionNode*>(*e))
+ else if((cond_node = dynamic_cast<ConditionNode*>(*e)))
{
ConditionNode* new_cond = new ConditionNode(cond_node);
new_hmsc->add_node(new_cond);
@@ -620,7 +624,7 @@
new_pred = new_cond;
set_copy(cond_node,new_cond);
}
- else if(conn_node = dynamic_cast<ConnectionNode*>(*e))
+ else if((conn_node = dynamic_cast<ConnectionNode*>(*e)))
{
ConnectionNode* new_conn = new ConnectionNode(conn_node);
new_hmsc->add_node(new_conn);
@@ -628,7 +632,7 @@
new_pred = new_conn;
set_copy(conn_node,new_conn);
}
- else if(end_node = dynamic_cast<EndNode*>(*e))
+ else if((end_node = dynamic_cast<EndNode*>(*e)))
{
EndNode* new_end = new EndNode(end_node);
new_rel = new_end->add_predecessor(new_pred);
@@ -649,6 +653,59 @@
return root;
}
+
+void HMscPathDuplicator::process_time_relations(
+ ReferenceNode* ref_node
+ ,TimeRelationRefNodePtrSet time_relations
+ ,bool bottom
+ )
+{
+ TimeRelationRefNodePtrSet::iterator it;
+
+ //processing top
+ for(it=time_relations.begin();it!=time_relations.end();it++)
+ {
+ TimeRelationRefNodePtr relation = *it;
+ TimeRelationRefNodePtr relation_copy;
+
+ relation_copy = (TimeRelationRefNode*) get_copy(relation.get());
+
+ ReferenceNode* new_ref = (ReferenceNode*) get_copy(ref_node);
+
+// relation_copy= dynamic_cast<TimeRelationRefNode>(get_copy((*it).get());
+ // copy doesnt exist -> create
+ if(!relation_copy.get())
+ {
+ relation_copy = TimeRelationRefNode::create((*it).get());
+ set_copy(relation.get(),relation_copy.get());
+ }
+ //connecting: ref_node -> relation
+ if(bottom)
+ new_ref->add_time_relation_bottom(relation_copy);
+ else
+ new_ref->add_time_relation_top(relation_copy);
+
+ // connecting: relation -> ref_node
+ ReferenceNode* a = (*it)->get_ref_node_a();
+ if(ref_node==a)
+ relation_copy->set_ref_node_a(new_ref);
+ else
+ relation_copy->set_ref_node_b(new_ref);
+ }
+}
+
+void HMscPathDuplicator::process_time_relations(ReferenceNode* ref_node)
+{
+
+ TimeRelationRefNodePtrSet time_relations;
+ time_relations = ref_node->get_time_relation_top();
+ process_time_relations(ref_node,time_relations,false);
+
+ time_relations = ref_node->get_time_relation_bottom();
+ process_time_relations(ref_node,time_relations,true);
+
+}
+
HMscPathDuplicator::~HMscPathDuplicator()
{
}
@@ -701,7 +758,7 @@
NodeRelationPtr new_rel;
- if(ref_node = dynamic_cast<ReferenceNode*>(*e))
+ if((ref_node = dynamic_cast<ReferenceNode*>(*e)))
{
ReferenceNode* new_ref;
if(new_elem)
@@ -717,7 +774,7 @@
new_pred = new_ref;
set_copy(ref_node,new_ref,persist_original);
}
- else if(cond_node = dynamic_cast<ConditionNode*>(*e))
+ else if((cond_node = dynamic_cast<ConditionNode*>(*e)))
{
ConditionNode* new_cond;
if(new_elem)
@@ -733,7 +790,7 @@
new_pred = new_cond;
set_copy(cond_node,new_cond,persist_original);
}
- else if(conn_node = dynamic_cast<ConnectionNode*>(*e))
+ else if((conn_node = dynamic_cast<ConnectionNode*>(*e)))
{
ConnectionNode* new_conn;
if(new_elem)
@@ -748,7 +805,7 @@
new_pred = new_conn;
set_copy(conn_node,new_conn,persist_original);
}
- else if(end_node = dynamic_cast<EndNode*>(*e))
+ else if((end_node = dynamic_cast<EndNode*>(*e)))
{
EndNode* new_end = new EndNode(end_node);
new_rel = new_end->add_predecessor(new_pred);
Modified: trunk/src/check/pseudocode/msc_duplicators.h
===================================================================
--- trunk/src/check/pseudocode/msc_duplicators.h 2009-09-09 20:20:52 UTC (rev 298)
+++ trunk/src/check/pseudocode/msc_duplicators.h 2009-09-10 09:52:12 UTC (rev 299)
@@ -249,6 +249,9 @@
*/
class SCPSEUDOCODE_EXPORT HMscPathDuplicator:public Duplicator
{
+private:
+ void process_time_relations(ReferenceNode* ref_node);
+ void process_time_relations(ReferenceNode*,TimeRelationRefNodePtrSet,bool);
public:
~HMscPathDuplicator();
Modified: trunk/src/check/time/constrain_check.h
===================================================================
--- trunk/src/check/time/constrain_check.h 2009-09-09 20:20:52 UTC (rev 298)
+++ trunk/src/check/time/constrain_check.h 2009-09-10 09:52:12 UTC (rev 299)
@@ -168,7 +168,17 @@
void mark_time_relation(TimeRelationRefNode* relation)
{
- m_duplicator.get_copy(relation)->set_marked(true);
+ TimeRelationRefNode* copy;
+ copy = (TimeRelationRefNode*)m_duplicator.get_copy(relation);
+// if(!copy)
+// {
+// std::cerr << "marking: error" << std::endl;
+// }
+// else
+// {
+// std::cerr << "marking: ok" << std::endl;
+ copy->set_marked(true);
+// }
}
/**
Modified: trunk/src/data/msc.h
===================================================================
--- trunk/src/data/msc.h 2009-09-09 20:20:52 UTC (rev 298)
+++ trunk/src/data/msc.h 2009-09-10 09:52:12 UTC (rev 299)
@@ -2337,8 +2337,15 @@
public:
- TimeRelationRefNode(ReferenceNode* a,ReferenceNode* b,MscTimeIntervalSet<double> set,TimeRelationRefNode* original=NULL):
- TimeRelation(set,original),m_node_origin(a),m_node(b)
+ TimeRelationRefNode(
+ ReferenceNode* a
+ ,ReferenceNode* b
+ ,MscTimeIntervalSet<double> set
+ ,TimeRelationRefNode* original=NULL
+ )
+ :TimeRelation(set,original)
+ ,m_node_origin(a)
+ ,m_node(b)
{
}
@@ -2353,11 +2360,27 @@
return m_node;
}
+ void set_ref_node_a(ReferenceNode* a)
+ {
+ m_node_origin = a;
+ }
+
+ void set_ref_node_b(ReferenceNode* b)
+ {
+ m_node = b;
+ }
+
~TimeRelationRefNode()
{
}
- static TimeRelationRefNodePtr create(bool bottom_a,ReferenceNode* a,
- ReferenceNode* b,bool bottom_b,MscTimeIntervalSetD set)
+
+ static TimeRelationRefNodePtr create(
+ bool bottom_a
+ ,ReferenceNode* a
+ ,ReferenceNode* b
+ ,bool bottom_b
+ ,MscTimeIntervalSetD set
+ )
{
TimeRelationRefNodePtr new_relation = new TimeRelationRefNode(a,b,set);
if(bottom_a)
@@ -2372,7 +2395,15 @@
return new_relation;
}
+
+ static TimeRelationRefNodePtr create(TimeRelationRefNode* relation)
+ {
+ TimeRelationRefNodePtr new_relation;
+ new_relation = new TimeRelationRefNode(NULL,NULL,relation->get_interval_set(),relation);
+ return new_relation;
+ }
+
};
#endif
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2009-09-09 20:20:52 UTC (rev 298)
+++ trunk/tests/CMakeLists.txt 2009-09-10 09:52:12 UTC (rev 299)
@@ -179,16 +179,16 @@
scpseudocode
)
-#ADD_EXECUTABLE(constrain_check_test
-# constrain_check_test.cpp
-#)
-#
-#TARGET_LINK_LIBRARIES(constrain_check_test
-# scmsc
-# sctime
-# scpseudocode
-#)
+ADD_EXECUTABLE(constrain_check_test
+ constrain_check_test.cpp
+)
+TARGET_LINK_LIBRARIES(constrain_check_test
+ scmsc
+ sctime
+ scpseudocode
+)
+
#
#ADD_EXECUTABLE(max_tightener_test
# max_tightener_test.cpp
Added: trunk/tests/constrain_check_test.cpp
===================================================================
--- trunk/tests/constrain_check_test.cpp (rev 0)
+++ trunk/tests/constrain_check_test.cpp 2009-09-10 09:52:12 UTC (rev 299)
@@ -0,0 +1,74 @@
+#include "check/time/constrain_check.h"
+
+int main()
+{
+ BMscPtr bmsc(new BMsc(L"BMsc"));
+ InstancePtr instance1(new Instance(L"1"));
+ InstancePtr instance2(new Instance(L"2"));
+
+ bmsc->add_instance(instance1);
+ bmsc->add_instance(instance2);
+
+ StrictOrderAreaPtr strict1(new StrictOrderArea());
+ StrictOrderAreaPtr strict2(new StrictOrderArea());
+
+ instance1->add_area(strict1);
+ instance2->add_area(strict2);
+
+ EventPtr e1 = strict1->add_event();
+ EventPtr e2 = strict2->add_event();
+
+ CompleteMessagePtr m1 = new CompleteMessage(L"hi");
+ m1->glue_events(e1, e2);
+
+ HMscPtr hmsc1(new HMsc(L"HMsc1"));
+
+ StartNodePtr start1 = new StartNode();
+ hmsc1->set_start(start1);
+
+ ReferenceNodePtr r1_1(new ReferenceNode());
+ ReferenceNodePtr r1_2(new ReferenceNode());
+ ReferenceNodePtr r1_3(new ReferenceNode());
+
+ EndNodePtr end1(new EndNode());
+
+ hmsc1->add_node(r1_1);
+ hmsc1->add_node(r1_2);
+ hmsc1->add_node(r1_3);
+ hmsc1->add_node(end1);
+
+ start1->add_successor(r1_1.get());
+ r1_1->add_successor(r1_2.get());
+// r1_1->add_successor(r1_2.get());
+// r1_2->add_successor(r1_2.get());
+// r1_2->add_successor(end1.get());
+ r1_2->add_successor(r1_3.get());
+// r1_3->add_successor(r1_2.get());
+ r1_3->add_successor(end1.get());
+
+ r1_1->set_msc(bmsc);
+ r1_2->set_msc(bmsc);
+ r1_3->set_msc(bmsc);
+
+ MscTimeIntervalSetD inter;
+ TimeRelationRefNodePtr node_relation_1 = TimeRelationRefNode::create(true,r1_1.get(),r1_2.get(),false,inter);
+ TimeRelationRefNodePtr node_relation_2 = TimeRelationRefNode::create(true,r1_2.get(),r1_3.get(),false,inter);
+ TimeRelationRefNodePtr node_relation_3 = TimeRelationRefNode::create(true,r1_1.get(),r1_3.get(),false,inter);
+
+ HMscTimeConstrainChecker constrain_checker;
+ ChannelMapperPtr chm;
+ HMscPtr result = constrain_checker.check(hmsc1,chm);
+ int ret;
+ if(result.get())
+ {
+ std::cerr << "Chyba v omezenich" << std::endl;
+ ret=1;
+ }
+ else
+ {
+ std::cerr << "OK sdfs" << std::endl;
+ ret = 0;
+ }
+ return ret;
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2009-09-10 09:52:41
|
Revision: 300
http://scstudio.svn.sourceforge.net/scstudio/?rev=300&view=rev
Author: madzin
Date: 2009-09-10 09:52:26 +0000 (Thu, 10 Sep 2009)
Log Message:
-----------
Increase automatical tests with results
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/tests/z120_test/CMakeLists.txt
trunk/tests/z120_test/z120_test03.mpr
trunk/tests/z120_test/z120_test04.mpr
trunk/tests/z120_test/z120_test05.mpr
trunk/tests/z120_test/z120_test06.mpr
trunk/tests/z120_test/z120_test07.mpr
trunk/tests/z120_test/z120_test08.mpr
trunk/tests/z120_test/z120_test09.mpr
trunk/tests/z120_test/z120_test10.mpr
trunk/tests/z120_test/z120_test11.mpr
trunk/tests/z120_test/z120_test12.mpr
trunk/tests/z120_test/z120_test13.mpr
trunk/tests/z120_test/z120_test14.mpr
trunk/tests/z120_test/z120_test15.mpr
trunk/tests/z120_test/z120_test16.mpr
trunk/tests/z120_test/z120_test17.mpr
trunk/tests/z120_test/z120_test18.mpr
trunk/tests/z120_test/z120_test19.mpr
trunk/tests/z120_test/z120_test20.mpr
trunk/tests/z120_test/z120_test21.mpr
trunk/tests/z120_test/z120_test22.mpr
trunk/tests/z120_test/z120_test23.mpr
trunk/tests/z120_test/z120_test24.mpr
trunk/tests/z120_test/z120_test26.mpr
trunk/tests/z120_test/z120_test27.mpr
trunk/tests/z120_test/z120_test28.mpr
trunk/tests/z120_test/z120_test29.mpr
trunk/tests/z120_test/z120_test30.mpr
trunk/tests/z120_test/z120_test31.mpr
trunk/tests/z120_test/z120_test32.mpr
trunk/tests/z120_test/z120_test33.mpr
trunk/tests/z120_test/z120_test34.mpr
trunk/tests/z120_test/z120_test35.mpr
trunk/tests/z120_test/z120_test37.mpr
trunk/tests/z120_test/z120_test38.mpr
trunk/tests/z120_test/z120_test39.mpr
trunk/tests/z120_test/z120_test40.mpr
Added Paths:
-----------
trunk/tests/z120_test/z120_diff.py
trunk/tests/z120_test/z120_test00.mpr.result
trunk/tests/z120_test/z120_test01.mpr.result
trunk/tests/z120_test/z120_test02.mpr.result
trunk/tests/z120_test/z120_test03.mpr.result
trunk/tests/z120_test/z120_test04.mpr.result
trunk/tests/z120_test/z120_test05.mpr.result
trunk/tests/z120_test/z120_test06.mpr.result
trunk/tests/z120_test/z120_test07.mpr.result
trunk/tests/z120_test/z120_test08.mpr.result
trunk/tests/z120_test/z120_test09.mpr.result
trunk/tests/z120_test/z120_test10.mpr.result
trunk/tests/z120_test/z120_test11.mpr.result
trunk/tests/z120_test/z120_test12.mpr.result
trunk/tests/z120_test/z120_test13.mpr.result
trunk/tests/z120_test/z120_test14.mpr.result
trunk/tests/z120_test/z120_test15.mpr.result
trunk/tests/z120_test/z120_test16.mpr.result
trunk/tests/z120_test/z120_test17.mpr.result
trunk/tests/z120_test/z120_test18.mpr.result
trunk/tests/z120_test/z120_test19.mpr.result
trunk/tests/z120_test/z120_test20.mpr.result
trunk/tests/z120_test/z120_test21.mpr.result
trunk/tests/z120_test/z120_test22.mpr.result
trunk/tests/z120_test/z120_test23.mpr.result
trunk/tests/z120_test/z120_test24.mpr.result
trunk/tests/z120_test/z120_test25.mpr.result
trunk/tests/z120_test/z120_test26.mpr.result
trunk/tests/z120_test/z120_test27.mpr.result
trunk/tests/z120_test/z120_test28.mpr.result
trunk/tests/z120_test/z120_test29.mpr.result
trunk/tests/z120_test/z120_test30.mpr.result
trunk/tests/z120_test/z120_test31.mpr.result
trunk/tests/z120_test/z120_test32.mpr.result
trunk/tests/z120_test/z120_test33.mpr.result
trunk/tests/z120_test/z120_test34.mpr.result
trunk/tests/z120_test/z120_test35.mpr.result
trunk/tests/z120_test/z120_test36.mpr.result
trunk/tests/z120_test/z120_test37.mpr.result
trunk/tests/z120_test/z120_test38.mpr.result
trunk/tests/z120_test/z120_test39.mpr.result
trunk/tests/z120_test/z120_test40.mpr.result
trunk/tests/z120_test/z120_test41.mpr
trunk/tests/z120_test/z120_test41.mpr.result
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/src/data/Z120/Context.cpp 2009-09-10 09:52:26 UTC (rev 300)
@@ -157,7 +157,6 @@
if(context->nonpointed.size() < 1 && context->mscs.size() > 0)
{
context->z->print_report(RS_ERROR, L"Error 03: There is no MSC without reference\n");
- return NULL;
}
s_Msc** result;
@@ -192,8 +191,8 @@
}
}
result[position] = NULL;
+//printf("pocet msc %d\n", position -1);
}
-
return result;
}
Modified: trunk/tests/z120_test/CMakeLists.txt
===================================================================
--- trunk/tests/z120_test/CMakeLists.txt 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/CMakeLists.txt 2009-09-10 09:52:26 UTC (rev 300)
@@ -8,7 +8,7 @@
SET(Z120_SEQUENCE 0)
MACRO(ADD_Z120_TEST FILE SATISFIED)
ADD_TEST("z120_test-${Z120_SEQUENCE}"
- ${EXECUTABLE_OUTPUT_PATH}/z120_test ${FILE} ${SATISFIED})
+ ${EXECUTABLE_OUTPUT_PATH}/z120_diff.py ${FILE} ${SATISFIED})
MATH(EXPR Z120_SEQUENCE ${Z120_SEQUENCE}+1)
ENDMACRO(ADD_Z120_TEST)
@@ -43,12 +43,16 @@
ADD_Z120_TEST(z120_test28.mpr 1)
ADD_Z120_TEST(z120_test29.mpr 1)
ADD_Z120_TEST(z120_test30.mpr 1)
-ADD_Z120_TEST(z120_test31.mpr 0)
+ADD_Z120_TEST(z120_test31.mpr 1)
ADD_Z120_TEST(z120_test32.mpr 1)
ADD_Z120_TEST(z120_test33.mpr 1)
ADD_Z120_TEST(z120_test34.mpr 1)
ADD_Z120_TEST(z120_test35.mpr 1)
ADD_Z120_TEST(z120_test36.mpr 1)
ADD_Z120_TEST(z120_test37.mpr 1)
+ADD_Z120_TEST(z120_test38.mpr 1)
+ADD_Z120_TEST(z120_test39.mpr 1)
+ADD_Z120_TEST(z120_test40.mpr 1)
+ADD_Z120_TEST(z120_test41.mpr 1)
# $Id$
Added: trunk/tests/z120_test/z120_diff.py
===================================================================
--- trunk/tests/z120_test/z120_diff.py (rev 0)
+++ trunk/tests/z120_test/z120_diff.py 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+import subprocess
+import difflib
+import sys
+
+p = subprocess.Popen(["./z120_test" , sys.argv[1], sys.argv[2]], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+
+f = open(sys.argv[1] + ".result", "r+")
+
+result = difflib.unified_diff(f.readlines(), p.stderr.readlines()+ p.stdout.readlines())
+
+error = False
+for line in result:
+ print line
+ error = True
+
+sys.exit(error)
+
+
+
+#diff = ndiff(
Property changes on: trunk/tests/z120_test/z120_diff.py
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/tests/z120_test/z120_test00.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test00.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test00.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,21 @@
+OK: z120_test00.mpr is correct, should be correct
+
+mscdocument z120_test00;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+in A,0 from found;
+out jedna,1 to B;
+concurrent;
+label e0; out B1,2 to B;
+label e1; out B,3 to lost;
+endconcurrent;
+in jedna,4 from B;
+endinstance;
+B: instance;
+in jedna,1 from A;
+in B1,2 from A;
+out jedna,4 to A;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test01.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test01.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test01.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,27 @@
+Warning: The file is breaking the ITU-T Z120 standard
+Warning: The file is breaking the ITU-T Z120 standard
+Warning: The file is breaking the ITU-T Z120 standard
+Warning: The file is breaking the ITU-T Z120 standard
+Warning: The file is breaking the ITU-T Z120 standard
+Warning: The file is breaking the ITU-T Z120 standard
+Warning: The file is breaking the ITU-T Z120 standard
+Warning: The file is breaking the ITU-T Z120 standard
+OK: z120_test01.mpr is correct, should be correct
+
+mscdocument z120_test01;
+msc z120_test01;
+inst ONE;
+inst TWO;
+ONE: instance;
+in LEFT,0 from found;
+out NAME,1 to TWO;
+out NAME,2 to TWO;
+endinstance;
+TWO: instance;
+out LOOPBACK,3 to TWO;
+out RIGHT,4 to lost;
+in NAME,2 from ONE;
+in NAME,1 from ONE;
+in LOOPBACK,3 from TWO;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test02.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test02.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test02.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,26 @@
+Warning: The file is breaking the ITU-T Z120 standard
+Warning 09: There is reference to nonexisted MSC
+
+OK: z120_test02.mpr is correct, should be correct
+
+mscdocument z120_test02;
+msc z120_test02;
+initial connect L0;
+L0: connect L1, L2;
+L1: condition STATE1 connect L3;
+L2: condition STATE2 connect L4;
+L3: reference ACTION1 connect L5;
+L4: reference ACTION2 connect L6, L7;
+L5: final;
+L6: reference ACTION3A connect L0;
+L7: reference ACTION3B connect L8;
+L8: final;
+endmsc;
+msc ACTION1;
+endmsc;
+msc ACTION2;
+endmsc;
+msc ACTION3A;
+endmsc;
+msc ACTION3B;
+endmsc;
Modified: trunk/tests/z120_test/z120_test03.mpr
===================================================================
--- trunk/tests/z120_test/z120_test03.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test03.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,26 +1,6 @@
/*****************************************************
Simple test of bmsc (event driven notification)
-Anticipated result:
-
-mscdocument z120_test03;
-msc pok2;
-inst A;
-inst B;
-A: instance;
-in A,0 from found;
-out jedna,1 to B;
-concurrent;
-label e0; out B1,2 to B;
-label e1; out B,3 to lost;
-endconcurrent;
-endinstance;
-B: instance;
-in jedna,1 from A;
-in B1,2 from A;
-endinstance;
-endmsc;
-
******************************************************/
mscdocument bbb;
Added: trunk/tests/z120_test/z120_test03.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test03.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test03.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,19 @@
+OK: z120_test03.mpr is correct, should be correct
+
+mscdocument z120_test03;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+in A,0 from found;
+out jedna,1 to B;
+concurrent;
+label e0; out B1,2 to B;
+label e1; out B,3 to lost;
+endconcurrent;
+endinstance;
+B: instance;
+in jedna,1 from A;
+in B1,2 from A;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test04.mpr
===================================================================
--- trunk/tests/z120_test/z120_test04.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test04.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,23 +1,5 @@
/*************************************************
Simple test of HMSC
-
-Anticipated result:
-
-Warning 09: There is reference to nonexisted MSC
-
-mscdocument z120_test04;
-msc Stranka1;
-initial connect L0;
-L0: connect L1, L2;
-L1: reference NAME connect L2;
-L2: reference NAME1 connect L3;
-L3: final;
-endmsc;
-msc NAME;
-endmsc;
-msc NAME1;
-endmsc;
-
**************************************************/
msc Stranka1;
Added: trunk/tests/z120_test/z120_test04.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test04.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test04.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,16 @@
+Warning 09: There is reference to nonexisted MSC
+
+OK: z120_test04.mpr is correct, should be correct
+
+mscdocument z120_test04;
+msc Stranka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference NAME connect L2;
+L2: reference NAME1 connect L3;
+L3: final;
+endmsc;
+msc NAME;
+endmsc;
+msc NAME1;
+endmsc;
Modified: trunk/tests/z120_test/z120_test05.mpr
===================================================================
--- trunk/tests/z120_test/z120_test05.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test05.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,22 +1,5 @@
/***********************************************
Simple test of bMSC (event driven notification)
-
-Anticipated result:
-
-mscdocument z120_test05;
-msc pok2;
-inst p1;
-inst p2;
-p1: instance;
-out a,0 to p2;
-in a,1 from p2;
-endinstance;
-p2: instance;
-in a,0 from p1;
-out a,1 to p1;
-endinstance;
-endmsc;
-
***********************************************/
msc pok2;
Added: trunk/tests/z120_test/z120_test05.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test05.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test05.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,15 @@
+OK: z120_test05.mpr is correct, should be correct
+
+mscdocument z120_test05;
+msc pok2;
+inst p1;
+inst p2;
+p1: instance;
+out a,0 to p2;
+in a,1 from p2;
+endinstance;
+p2: instance;
+in a,0 from p1;
+out a,1 to p1;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test06.mpr
===================================================================
--- trunk/tests/z120_test/z120_test06.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test06.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,22 +1,5 @@
/*********************************************
Simple bMSC (event driven notification)
-
-Anticipated result:
-
-mscdocument z120_test06;
-msc Strnka1;
-inst I1;
-inst I2;
-I1: instance;
-out M1,0 to I2;
-out M1,1 to I2;
-endinstance;
-I2: instance;
-in M1,0 from I1;
-in M1,1 from I1;
-endinstance;
-endmsc;
-
*********************************************/
msc Strnka1;
Added: trunk/tests/z120_test/z120_test06.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test06.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test06.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,15 @@
+OK: z120_test06.mpr is correct, should be correct
+
+mscdocument z120_test06;
+msc Strnka1;
+inst I1;
+inst I2;
+I1: instance;
+out M1,0 to I2;
+out M1,1 to I2;
+endinstance;
+I2: instance;
+in M1,0 from I1;
+in M1,1 from I1;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test07.mpr
===================================================================
--- trunk/tests/z120_test/z120_test07.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test07.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,22 +1,5 @@
/************************************************
Simple example of bMSC (instance driven notification)
-
-Anticipated result:
-
-mscdocument z120_test07;
-msc pok2;
-inst A;
-inst B;
-A: instance;
-out M1,0 to B;
-out M2,1 to B;
-endinstance;
-B: instance;
-in M1,0 from A;
-in M2,1 from A;
-endinstance;
-endmsc;
-
************************************************/
msc pok2;
Added: trunk/tests/z120_test/z120_test07.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test07.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test07.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,15 @@
+OK: z120_test07.mpr is correct, should be correct
+
+mscdocument z120_test07;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+out M1,0 to B;
+out M2,1 to B;
+endinstance;
+B: instance;
+in M1,0 from A;
+in M2,1 from A;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test08.mpr
===================================================================
--- trunk/tests/z120_test/z120_test08.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test08.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,24 +1,5 @@
/***********************************************
Example of bMsc with coregion (instance driven notification)
-
-Anticipated result:
-
-mscdocument z120_test08;
-msc Stranka1;
-inst NAME1;
-inst NAME2;
-NAME1: instance;
-concurrent;
-label e0; out b,0 to NAME2 before e1;
-label e1; in a,1 from NAME2;
-endconcurrent;
-endinstance;
-NAME2: instance;
-out a,1 to NAME1;
-in b,0 from NAME1;
-endinstance;
-endmsc;
-
***********************************************/
msc Stranka1;
Added: trunk/tests/z120_test/z120_test08.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test08.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test08.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,17 @@
+OK: z120_test08.mpr is correct, should be correct
+
+mscdocument z120_test08;
+msc Stranka1;
+inst NAME1;
+inst NAME2;
+NAME1: instance;
+concurrent;
+label e0; out b,0 to NAME2 before e1;
+label e1; in a,1 from NAME2;
+endconcurrent;
+endinstance;
+NAME2: instance;
+out a,1 to NAME1;
+in b,0 from NAME1;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test09.mpr
===================================================================
--- trunk/tests/z120_test/z120_test09.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test09.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,19 +1,5 @@
/*************************************************
Exampe of bMsc where are 2 instances with the same name.
-
-Anticipated result:
-
-mscdocument z120_test09;
-msc Stranka1;
-inst NAME;
-inst NAME;
-NAME: instance;
-endinstance;
-NAME: instance;
-endinstance;
-endmsc;
-
-
*************************************************/
mscdocument Vykres1;
Added: trunk/tests/z120_test/z120_test09.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test09.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test09.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,13 @@
+Warning 16: Instance with the same name (NAME) has been created
+
+OK: z120_test09.mpr is correct, should be correct
+
+mscdocument z120_test09;
+msc Stranka1;
+inst NAME;
+inst NAME;
+NAME: instance;
+endinstance;
+NAME: instance;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test10.mpr
===================================================================
--- trunk/tests/z120_test/z120_test10.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test10.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,24 +1,5 @@
/***************************************************
Example of bMSC with mesages with the same name.
-
-Anticipated result:
-
-mscdocument z120_test10;
-msc Stranka1;
-inst W;
-inst Q;
-W: instance;
-out a,0 to Q;
-out a,1 to Q;
-out a,2 to Q;
-endinstance;
-Q: instance;
-in a,0 from W;
-in a,1 from W;
-in a,2 from W;
-endinstance;
-endmsc;
-
***************************************************/
msc Stranka1;
Added: trunk/tests/z120_test/z120_test10.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test10.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test10.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,17 @@
+OK: z120_test10.mpr is correct, should be correct
+
+mscdocument z120_test10;
+msc Stranka1;
+inst W;
+inst Q;
+W: instance;
+out a,0 to Q;
+out a,1 to Q;
+out a,2 to Q;
+endinstance;
+Q: instance;
+in a,0 from W;
+in a,1 from W;
+in a,2 from W;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test11.mpr
===================================================================
--- trunk/tests/z120_test/z120_test11.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test11.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,32 +1,5 @@
/*************************************************
Example of bMSC with coregion (used '_' sign)
-
-Anticipated result:
-
-mscdocument z120_test11;
-msc Strnka1;
-inst PC;
-inst Server;
-PC: instance;
-out SYN,0 to Server;
-in SYNACK,1 from Server;
-out ACK,2 to Server;
-out request_a,3 to Server;
-out request_b,4 to Server;
-in result,5 from Server;
-endinstance;
-Server: instance;
-in SYN,0 from PC;
-out SYNACK,1 to PC;
-in ACK,2 from PC;
-concurrent;
-label e0; in request_a,3 from PC before e1;
-label e2; in request_b,4 from PC;
-label e1; out result,5 to PC;
-endconcurrent;
-endinstance;
-endmsc;
-
*************************************************/
mscdocument Vkres1;
Added: trunk/tests/z120_test/z120_test11.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test11.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test11.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,25 @@
+OK: z120_test11.mpr is correct, should be correct
+
+mscdocument z120_test11;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; in request_a,3 from PC before e1;
+label e2; in request_b,4 from PC;
+label e1; out result,5 to PC;
+endconcurrent;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test12.mpr
===================================================================
--- trunk/tests/z120_test/z120_test12.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test12.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,40 +1,5 @@
/*************************************************
Example of bMSC with two coretions on instances
-
-Anticipated result:
-
-mscdocument z120_test12;
-msc Strnka1;
-inst A;
-inst B;
-A: instance;
-concurrent;
-label e0; out ano,0 to B;
-label e1; out ano,1 to B;
-label e2; in nie,2 from B;
-endconcurrent;
-concurrent;
-label e3; out micron,3 to B;
-label e4; out rad,4 to lost;
-endconcurrent;
-in dan,5 from B;
-in track,6 from B;
-endinstance;
-B: instance;
-concurrent;
-label e5; in ano,1 from A;
-label e6; out nie,2 to A;
-label e7; in ano,0 from A;
-endconcurrent;
-in micron,3 from A;
-concurrent;
-label e8; out dan,5 to A;
-endconcurrent;
-out track,6 to A;
-in rad,7 from found;
-endinstance;
-endmsc;
-
*************************************************/
mscdocument test11.vsd;
Added: trunk/tests/z120_test/z120_test12.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test12.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test12.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,33 @@
+OK: z120_test12.mpr is correct, should be correct
+
+mscdocument z120_test12;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e1; out ano,1 to B;
+label e2; in nie,2 from B;
+endconcurrent;
+concurrent;
+label e3; out micron,3 to B;
+label e4; out rad,4 to lost;
+endconcurrent;
+in dan,5 from B;
+in track,6 from B;
+endinstance;
+B: instance;
+concurrent;
+label e5; in ano,1 from A;
+label e6; out nie,2 to A;
+label e7; in ano,0 from A;
+endconcurrent;
+in micron,3 from A;
+concurrent;
+label e8; out dan,5 to A;
+endconcurrent;
+out track,6 to A;
+in rad,7 from found;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test13.mpr
===================================================================
--- trunk/tests/z120_test/z120_test13.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test13.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,32 +1,5 @@
/************************************************
Example of bMSC with before, after relation between messages.
-
-Anticipated result:
-
-mscdocument z120_test13;
-msc Strnka1;
-inst PC;
-inst Server;
-PC: instance;
-out SYN,0 to Server;
-in SYNACK,1 from Server;
-out ACK,2 to Server;
-out request_a,3 to Server;
-out request_b,4 to Server;
-in result,5 from Server;
-endinstance;
-Server: instance;
-in SYN,0 from PC;
-out SYNACK,1 to PC;
-in ACK,2 from PC;
-concurrent;
-label e0; out result,5 to PC before e1;
-label e2; in request_b,4 from PC;
-label e1; in request_a,3 from PC;
-endconcurrent;
-endinstance;
-endmsc;
-
************************************************/
mscdocument Vkres1;
Added: trunk/tests/z120_test/z120_test13.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test13.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test13.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,25 @@
+OK: z120_test13.mpr is correct, should be correct
+
+mscdocument z120_test13;
+msc Strnka1;
+inst PC;
+inst Server;
+PC: instance;
+out SYN,0 to Server;
+in SYNACK,1 from Server;
+out ACK,2 to Server;
+out request_a,3 to Server;
+out request_b,4 to Server;
+in result,5 from Server;
+endinstance;
+Server: instance;
+in SYN,0 from PC;
+out SYNACK,1 to PC;
+in ACK,2 from PC;
+concurrent;
+label e0; out result,5 to PC before e1;
+label e2; in request_b,4 from PC;
+label e1; in request_a,3 from PC;
+endconcurrent;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test14.mpr
===================================================================
--- trunk/tests/z120_test/z120_test14.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test14.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,37 +1,5 @@
/***********************************************
Example of bMSC
-
-Anticipated result:
-
-mscdocument z120_test14;
-msc Strnka1;
-inst A;
-inst B;
-A: instance;
-concurrent;
-label e0; out ano,0 to B;
-label e1; in nie,1 from B;
-endconcurrent;
-concurrent;
-label e2; out micron,2 to B;
-endconcurrent;
-in dan,3 from B;
-in track,4 from B;
-endinstance;
-B: instance;
-concurrent;
-label e3; out nie,1 to A;
-label e4; in ano,0 from A;
-endconcurrent;
-in micron,2 from A;
-concurrent;
-label e5; out dan,3 to A;
-endconcurrent;
-out track,4 to A;
-in rad,5 from found;
-endinstance;
-endmsc;
-
***********************************************/
mscdocument test11.vsd;
msc Strnka1;
Added: trunk/tests/z120_test/z120_test14.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test14.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test14.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,30 @@
+OK: z120_test14.mpr is correct, should be correct
+
+mscdocument z120_test14;
+msc Strnka1;
+inst A;
+inst B;
+A: instance;
+concurrent;
+label e0; out ano,0 to B;
+label e1; in nie,1 from B;
+endconcurrent;
+concurrent;
+label e2; out micron,2 to B;
+endconcurrent;
+in dan,3 from B;
+in track,4 from B;
+endinstance;
+B: instance;
+concurrent;
+label e3; out nie,1 to A;
+label e4; in ano,0 from A;
+endconcurrent;
+in micron,2 from A;
+concurrent;
+label e5; out dan,3 to A;
+endconcurrent;
+out track,4 to A;
+in rad,5 from found;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test15.mpr
===================================================================
--- trunk/tests/z120_test/z120_test15.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test15.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,34 +1,5 @@
/***********************************************
Example of bMSC
-
-Anticipated result:
-
-mscdocument z120_test15;
-msc Strnka1;
-inst client;
-inst server;
-client: instance;
-concurrent;
-label e0; out no,0 to server;
-label e1; in know,1 from server;
-endconcurrent;
-out yes,2 to lost;
-concurrent;
-label e2; in tric,3 from server;
-endconcurrent;
-in tric,4 from found;
-endinstance;
-server: instance;
-in no,0 from client;
-concurrent;
-label e3; out know,1 to client;
-endconcurrent;
-concurrent;
-label e4; out tric,3 to client;
-endconcurrent;
-endinstance;
-endmsc;
-
***********************************************/
mscdocument Vkres2;
Added: trunk/tests/z120_test/z120_test15.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test15.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test15.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,27 @@
+OK: z120_test15.mpr is correct, should be correct
+
+mscdocument z120_test15;
+msc Strnka1;
+inst client;
+inst server;
+client: instance;
+concurrent;
+label e0; out no,0 to server;
+label e1; in know,1 from server;
+endconcurrent;
+out yes,2 to lost;
+concurrent;
+label e2; in tric,3 from server;
+endconcurrent;
+in tric,4 from found;
+endinstance;
+server: instance;
+in no,0 from client;
+concurrent;
+label e3; out know,1 to client;
+endconcurrent;
+concurrent;
+label e4; out tric,3 to client;
+endconcurrent;
+endinstance;
+endmsc;
Modified: trunk/tests/z120_test/z120_test16.mpr
===================================================================
--- trunk/tests/z120_test/z120_test16.mpr 2009-09-10 09:52:12 UTC (rev 299)
+++ trunk/tests/z120_test/z120_test16.mpr 2009-09-10 09:52:26 UTC (rev 300)
@@ -1,50 +1,5 @@
/***********************************************
Example of HMSC with references to bMSC.
-
-Anticipated result:
-
-mscdocument z120_test16;
-msc Strnka1;
-initial connect L0;
-L0: reference bmsc1 connect L1;
-L1: condition true connect L2, L3;
-L2: reference bmsc2 connect L4;
-L3: reference bmsc3 connect L4;
-L4: final;
-endmsc;
-msc bmsc1;
-inst A;
-inst B;
-A: instance;
-out yes,0 to B;
-endinstance;
-B: instance;
-in yes,0 from A;
-endinstance;
-endmsc;
-msc bmsc2;
-inst A;
-inst B;
-A: instance;
-in no,0 from B;
-endinstance;
-B: instance;
-out no,0 to A;
-endinstance;
-endmsc;
-msc bmsc3;
-inst A;
-inst B;
-A: instance;
-in no,0 from B;
-out ok,1 to B;
-endinstance;
-B: instance;
-out no,0 to A;
-in ok,1 from A;
-endinstance;
-endmsc;
-
***********************************************/
mscdocument Vkres1;
Added: trunk/tests/z120_test/z120_test16.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test16.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test16.mpr.result 2009-09-10 09:52:26 UTC (rev 300)
@@ -0,0 +1,43 @@
+OK: z120_test16.mpr is correct, should be correct
+
+mscdocument z120_test16;
+msc Strnka1;
+initial connect ...
[truncated message content] |
|
From: <koc...@us...> - 2009-09-11 08:14:06
|
Revision: 309
http://scstudio.svn.sourceforge.net/scstudio/?rev=309&view=rev
Author: kocianon
Date: 2009-09-11 08:13:58 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
fixing some gcc warnings, constrain check fix - EndNode problem, adding IsEndignNode class to search for stright EndNode successor
Modified Paths:
--------------
trunk/src/check/liveness/deadlock_checker.cpp
trunk/src/check/pseudocode/utils.h
trunk/src/check/time/constrain_check.cpp
trunk/src/check/time/time_consistency.cpp
trunk/src/data/Z120/z120_save.cpp
trunk/src/data/time.cpp
trunk/src/data/time.h
trunk/tests/interval_string.cpp
Modified: trunk/src/check/liveness/deadlock_checker.cpp
===================================================================
--- trunk/src/check/liveness/deadlock_checker.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/check/liveness/deadlock_checker.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -70,7 +70,8 @@
m_depths.push(m_current_depth);
}
//set deadlock free attribute
- bool& deadlock_free = get_deadlock_free(node);
+// bool& deadlock_free = get_deadlock_free(node);
+ get_deadlock_free(node);
if (dynamic_cast<EndNode*>(node))
{
mark_deadlock_free(node);
@@ -98,7 +99,8 @@
if (!m_depths.empty())
{
//depth of node is surely set (in on_white_node_found())
- size_t node_depth = get_depth(node);
+// size_t node_depth = get_depth(node);
+ get_depth(node);
size_t top_reference_depth = m_depths.top();
//there is some ReferenceNode on path from node to previous white HMscNode
if (top_reference_depth >= m_current_depth)
Modified: trunk/src/check/pseudocode/utils.h
===================================================================
--- trunk/src/check/pseudocode/utils.h 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/check/pseudocode/utils.h 2009-09-11 08:13:58 UTC (rev 309)
@@ -2,11 +2,12 @@
#define _UTILS_H
#include <string>
-
+#include <stack>
#include "data/dfs_events_traverser.h"
#include "data/dfs_bmsc_graph_traverser.h"
#include "data/dfsb_hmsc_traverser.h"
#include "check/pseudocode/export.h"
+#include "data/node_finder.h"
typedef std::map<std::wstring,size_t> StringSizeTMap;
@@ -129,6 +130,38 @@
};
+/*
+ * \brief Check whether the HMscNode is ending node
+ * (one of the straight successors is End node)
+ * due to connection node theather
+ *
+ */
+
+class IsEndingNode
+{
+private:
+
+public:
+ IsEndingNode()
+ {
+ }
+ static EndNode* check(HMscNode* node)
+ {
+ EndNode* end;
+ //isnt it EndNode itself?
+ if((end=dynamic_cast<EndNode*>(node)))
+ return end;
+
+ HMscNodePListPtr succs = NodeFinder::successors(node,"IsEndingNode");
+ HMscNodePList::iterator it;
+ for(it=succs->begin();it!=succs->end();it++)
+ if((end=dynamic_cast<EndNode*>(*it)))
+ return end;
+ return end;
+
+ }
+};
+
#endif /* _UTILS_H */
// $Id$
Modified: trunk/src/check/time/constrain_check.cpp
===================================================================
--- trunk/src/check/time/constrain_check.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/check/time/constrain_check.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -1,5 +1,6 @@
#include "constrain_check.h"
#include "data/dfs_bmsc_graph_traverser.h"
+#include "check/pseudocode/utils.h"
HMscTimeConstrainCheckerPtr HMscTimeConstrainChecker::m_instance;
@@ -59,8 +60,7 @@
check_active_set(n,constrain_set);
- if(dynamic_cast<EndNode*>(n))
- if(m_active_constrains.size()!=0)
+ if(m_active_constrains.size()!=0 && IsEndingNode::check(n))
throw m_active_constrains;
}
@@ -72,9 +72,6 @@
if(constrains_set!=m_active_constrains)
throw constrains_set;
- constrains_set = get_active_constrains_bottom(n);
- if(constrains_set!=m_active_constrains)
- throw constrains_set;
}
void HMscTimeConstrainChecker::on_black_node_found(ReferenceNode* n)
@@ -85,9 +82,6 @@
if(constrains_set!=m_active_constrains)
throw constrains_set;
- constrains_set = get_active_constrains_bottom(n);
- if(constrains_set!=m_active_constrains)
- throw constrains_set;
}
Modified: trunk/src/check/time/time_consistency.cpp
===================================================================
--- trunk/src/check/time/time_consistency.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/check/time/time_consistency.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -50,7 +50,7 @@
int new_j;
int new_i;
DEBUG_(i,j);
- if(matrix.size1()==i+1 && matrix.size1()== j+1)
+ if((matrix.size1()==(unsigned)(i+1)) && (matrix.size1()==(unsigned)(j+1)))
{
IntervalMatrix tmp = tightener->tight(matrix);
for(unsigned g=0;g<matrix.size1();g++)
@@ -62,7 +62,7 @@
else
{
std::list<MscTimeIntervalD> interval_list;
- if(j+1==matrix.size1())
+ if((unsigned)(j+1)==matrix.size1())
{
new_i = i+1;
new_j = new_i;
Modified: trunk/src/data/Z120/z120_save.cpp
===================================================================
--- trunk/src/data/Z120/z120_save.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/data/Z120/z120_save.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -50,8 +50,8 @@
{
char stripped;
- if(*pos >= 'A' && *pos <= 'Z' || *pos >= 'a' && *pos <= 'z'
- || *pos >= '0' && *pos <= '9'
+ if((*pos >= 'A' && *pos <= 'Z') || (*pos >= 'a' && *pos <= 'z')
+ || (*pos >= '0' && *pos <= '9')
|| *pos == '_' || *pos == '.')
{
// print valid characters
Modified: trunk/src/data/time.cpp
===================================================================
--- trunk/src/data/time.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/data/time.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -53,7 +53,8 @@
template <>
MscIntervalCouple<double>::MscIntervalCouple(const std::string& number, \
const bool& closed):
-m_value(0),m_closed(closed)
+ m_closed(closed)
+ ,m_value(0)
{
const char* pos = number.c_str();
m_value = atof(pos);
@@ -62,7 +63,8 @@
template <>
MscIntervalCouple<DecScaled>::MscIntervalCouple(const std::string &number, \
const bool& closed):
-m_value(0),m_closed(closed)
+ m_closed(closed)
+ ,m_value(0)
{
DecScaled tmp(number);
m_value = tmp;
Modified: trunk/src/data/time.h
===================================================================
--- trunk/src/data/time.h 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/src/data/time.h 2009-09-11 08:13:58 UTC (rev 309)
@@ -286,7 +286,9 @@
MscIntervalCouple(const std::string&,const bool&);
- MscIntervalCouple(const bool& b,const T& d): m_closed(b),m_value(d)
+ MscIntervalCouple(const bool& b,const T& d):
+ m_closed(b)
+ ,m_value(d)
{
}
Modified: trunk/tests/interval_string.cpp
===================================================================
--- trunk/tests/interval_string.cpp 2009-09-11 08:00:44 UTC (rev 308)
+++ trunk/tests/interval_string.cpp 2009-09-11 08:13:58 UTC (rev 309)
@@ -48,5 +48,6 @@
MscTimeInterval<DecScaled> d("[10]");
std::cerr << d << std::endl;
+// MscTimeInterval<DecScaled> c(std::string("405"));
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2009-09-11 11:50:20
|
Revision: 315
http://scstudio.svn.sourceforge.net/scstudio/?rev=315&view=rev
Author: madzin
Date: 2009-09-11 11:50:12 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
Fix a few errors.
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/src/data/Z120/Context.h
trunk/src/data/Z120/Z120.g
trunk/src/data/Z120/z120_load.cpp
trunk/tests/z120_test/z120_test01.mpr.result
trunk/tests/z120_test/z120_test39.mpr.result
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2009-09-11 11:05:10 UTC (rev 314)
+++ trunk/src/data/Z120/Context.cpp 2009-09-11 11:50:12 UTC (rev 315)
@@ -22,7 +22,7 @@
*/
/*
- * Maximal number of warning/error message is 19
+ * Maximal number of warning/error message is 22
*/
#ifndef __ParserStruct__
@@ -69,8 +69,9 @@
std::set<std::string> order_events; //set of name of events which takes place after keywords 'before', 'after'
EventPtr current_event; //event which was currently created
std::string event_name; //name of event
- int not_create_event;
- int no_message_label;
+ int not_create_event; //flag for event in case msc has two labeled event with the same name
+ int no_message_label; //flag for message which does not have label
+ int open_instance; //counter of open instances
/*
* HMsc
@@ -123,6 +124,7 @@
context->current_event = NULL;
context->not_create_event = 0;
context->no_message_label = 0;
+ context->open_instance = 0;
context->start_node = NULL;
context->end_node = std::make_pair("", context->end_node.second); //replaice context->end_node.second with NULL
@@ -154,12 +156,30 @@
{
context->z->print_report(RS_WARNING, L"Warning 02: There are more unreferenced MSC\n");
}
+
if(context->nonpointed.size() < 1 && context->mscs.size() > 0)
{
context->z->print_report(RS_ERROR, L"Error 03: There is no MSC without reference\n");
}
+
+ if(context->open_instance > 0)
+ {
+ if(context->open_instance == 1)
+ {
+ context->z->print_report(RS_WARNING, stringize() << "Warning 20: Msc has not finished " << context->open_instance << " instance\n");
+ }
+ else
+ {
+ context->z->print_report(RS_WARNING, stringize() << "Warning 20: Msc has not finished " << context->open_instance << " instances\n");
+ }
+ }
- s_Msc** result;
+ if(context->open_instance < 0)
+ {
+ context->z->print_report(RS_WARNING, L"Warning 21: Some instance has been finished more times\n");
+ }
+
+ s_Msc** result = NULL;
if(context->mscs.size() > 0){
result = new s_Msc*[context->mscs.size()+1];
@@ -189,14 +209,12 @@
intrusive_ptr_add_ref(my_msc);
result[position++] = my_msc;
}
- }
+ }
result[position] = NULL;
-//printf("pocet msc %d\n", position -1);
}
return result;
}
-
/*
* Memory initialization.
*/
@@ -266,8 +284,9 @@
if(context->mscs.find(context->msc_name) != context->mscs.end()){
context->z->print_report(RS_WARNING, stringize() << "Warning 18: Two mscs have the same name (" << TOWSTRING(context->msc_name) << ")\n");
}
+
context->mscs.insert(std::make_pair(context->msc_name, get_msc_fun(context)));
-
+
std::map<std::string, std::set<ReferenceNodePtr> >::iterator future_ref_it;
future_ref_it = context->future_reference.find(context->msc_name);
@@ -290,7 +309,7 @@
/*
* Bug report from grammar
*/
-void bug_report(struct Context* context, char* report){
+void bug_report_fun(struct Context* context, char* report){
context->z->print_report(RS_ERROR, TOWSTRING(report));
}
@@ -413,6 +432,7 @@
context->instances.insert(std::make_pair(context->element_name, instance));
}
context->myBmsc->add_instance(instance);
+ context->open_instance++;
}
/*
@@ -620,17 +640,21 @@
}
}
-void set_not_create_event(struct Context* context)
+void set_not_create_event_fun(struct Context* context)
{
- context->not_create_event = 0;
+ context->not_create_event = 0;
}
-void missing_message_label(struct Context* context)
+void missing_message_label_fun(struct Context* context)
{
- context->no_message_label = 1;
- context->z->print_report(RS_WARNING, stringize() << L"Warning 19: There is message without label on the " << TOWSTRING(context->element_name) << " instance\n");
+ context->no_message_label = 1;
+ context->z->print_report(RS_WARNING, stringize() << L"Warning 19: There is message without label on the " << TOWSTRING(context->element_name) << " instance\n");
}
+void end_instance_fun(struct Context* context){
+ context->open_instance--;
+}
+
/*
* FUNCTIONS FOR HMSC
*/
@@ -659,17 +683,17 @@
*/
void new_end_node_fun(struct Context* context)
{
- if (context->connect_name.size() == 0)
- {
+// if (context->connect_name.size() == 0)
+// {
EndNodePtr node = new EndNode();
context->myHmsc->add_node(node);
context->end_node = std::make_pair(context->element_name, node);
create_future_connections_fun(context, node.get());
- }
- else
- {
- context->z->print_report(RS_WARNING, L"Warning 14: There is node which is successor of end node\n");
- }
+// }
+// else
+// {
+// context->z->print_report(RS_WARNING, L"Warning 14: There is node which is successor of end node\n");
+// }
}
/*
Modified: trunk/src/data/Z120/Context.h
===================================================================
--- trunk/src/data/Z120/Context.h 2009-09-11 11:05:10 UTC (rev 314)
+++ trunk/src/data/Z120/Context.h 2009-09-11 11:50:12 UTC (rev 315)
@@ -55,7 +55,7 @@
void msc_was_read_fun(struct Context* context);
-void bug_report(struct Context* context, char* report);
+void bug_report_fun(struct Context* context, char* report);
//BMsc
void new_bmsc_fun(struct Context* context);
@@ -78,10 +78,12 @@
void set_event_name_fun(struct Context* context, char* name);
-void set_not_create_event(struct Context* context);
+void set_not_create_event_fun(struct Context* context);
-void missing_message_label(struct Context* context);
+void missing_message_label_fun(struct Context* context);
+void end_instance_fun(struct Context* context);
+
//HMsc
void new_hmsc_fun(struct Context* context);
Modified: trunk/src/data/Z120/Z120.g
===================================================================
--- trunk/src/data/Z120/Z120.g 2009-09-11 11:05:10 UTC (rev 314)
+++ trunk/src/data/Z120/Z120.g 2009-09-11 11:50:12 UTC (rev 315)
@@ -112,7 +112,7 @@
;
non_par_non_escape:
-Character_String | NAME {bug_report(context, "Warning: The file is breaking the ITU-T Z120 standard");}
+Character_String | NAME {bug_report_fun(context, "Warning: The file is breaking the ITU-T Z120 standard");}
//('a'..'z' | 'A'..'Z' | '0'..'9'| '?' | '%' | '+' | '-' | '!' | '/' | '*' | '"' | '=' | '@' | '&' | '#' | '.' | '_' | '\'')+ { bug_report(context, "The file is breaking the Z120 standard");}
@@ -395,7 +395,7 @@
('time' time_dest_list end)?
{
- set_not_create_event(context);
+ set_not_create_event_fun(context);
}
;
@@ -422,7 +422,7 @@
| shared_msc_reference
| shared_inline_expr
| instance_head_statement { new_instance_fun(context); }
- | instance_end_statement
+ | instance_end_statement { end_instance_fun(context); }
| stop
;
@@ -492,7 +492,7 @@
(NAME (',' NAME)? |
',' NAME
{
- missing_message_label(context);
+ missing_message_label_fun(context);
}) ('(' parameter_list ')')?
;
@@ -1372,8 +1372,11 @@
{
set_node_name_fun(context, (char*) $NAME.text->chars);
}
- ':' 'final' end
+ ':' 'final' (connection_list
{
+ bug_report_fun(context, "Warinig 14: HMSC has defined a successor for end node\n");
+ })? end
+ {
new_end_node_fun(context);
}
;
@@ -1409,7 +1412,7 @@
new_condition_node_fun(context);
break;
default:
- bug_report(context, "Internal Error 16: There is no node to create\n");
+ bug_report_fun(context, "Internal Error 16: There is no node to create\n");
}
}
@@ -1434,7 +1437,7 @@
start {new_start_node_fun(context);}
(node_expression
- | (NAME ':' {bug_report(context, "Warning: The file is breaking the ITU-T Z120 standard");})?
+ | (NAME ':' {bug_report_fun(context, "Warning: The file is breaking the ITU-T Z120 standard");})?
text_definition)* // add NAME ':' out of standart Z120_1999
;
@@ -1461,7 +1464,7 @@
new_condition_node_fun(context);
break;
default:
- bug_report(context, "Internal Error 16: There is no node to create\n");
+ bug_report_fun(context, "Internal Error 16: There is no node to create\n");
}
}
| 'end'
Modified: trunk/src/data/Z120/z120_load.cpp
===================================================================
--- trunk/src/data/Z120/z120_load.cpp 2009-09-11 11:05:10 UTC (rev 314)
+++ trunk/src/data/Z120/z120_load.cpp 2009-09-11 11:50:12 UTC (rev 315)
@@ -46,9 +46,15 @@
pZ120Parser psr = Z120ParserNew(tstream);
if (psr == NULL)
return result;
-
+
Msc** my_mscs = (Msc**)(psr->textual_msc_file(psr, static_cast<s_Z120*>(this)));
+ if (my_mscs == NULL)
+ {
+ print_report(RS_ERROR, stringize() << "Error 22: Syntax error ");
+ return result;
+ }
+
for(int i = 0; my_mscs[i] != NULL; i++)
{
MscPtr msc = my_mscs[i];
Modified: trunk/tests/z120_test/z120_test01.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test01.mpr.result 2009-09-11 11:05:10 UTC (rev 314)
+++ trunk/tests/z120_test/z120_test01.mpr.result 2009-09-11 11:50:12 UTC (rev 315)
@@ -6,6 +6,8 @@
Warning: The file is breaking the ITU-T Z120 standard
Warning: The file is breaking the ITU-T Z120 standard
Warning: The file is breaking the ITU-T Z120 standard
+Warning 20: Msc has not finished 1 instance
+
OK: z120_test01.mpr is correct, should be correct
mscdocument z120_test01;
Modified: trunk/tests/z120_test/z120_test39.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test39.mpr.result 2009-09-11 11:05:10 UTC (rev 314)
+++ trunk/tests/z120_test/z120_test39.mpr.result 2009-09-11 11:50:12 UTC (rev 315)
@@ -1,5 +1,7 @@
-Warning 20: The end node of HMSC has defined successor
+Warinig 14: HMSC has defined a successor for end node
+OK: z120_test39.mpr is correct, should be correct
+
mscdocument z120_test39;
msc Stranka_1;
initial connect L0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2009-09-11 13:44:13
|
Revision: 319
http://scstudio.svn.sourceforge.net/scstudio/?rev=319&view=rev
Author: madzin
Date: 2009-09-11 13:44:07 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
Add new tests
Modified Paths:
--------------
trunk/src/data/Z120/Z120.g
trunk/tests/z120_test/CMakeLists.txt
trunk/tests/z120_test/z120_diff.py
Added Paths:
-----------
trunk/tests/z120_test/z120_test42.mpr
trunk/tests/z120_test/z120_test42.mpr.result
trunk/tests/z120_test/z120_test43.mpr
trunk/tests/z120_test/z120_test44.mpr
trunk/tests/z120_test/z120_test45.mpr
trunk/tests/z120_test/z120_test46.mpr
trunk/tests/z120_test/z120_test47.mpr
trunk/tests/z120_test/z120_test47.mpr.result
trunk/tests/z120_test/z120_test48.mpr
trunk/tests/z120_test/z120_test49.mpr
trunk/tests/z120_test/z120_test49.mpr.result
trunk/tests/z120_test/z120_test50.mpr
Modified: trunk/src/data/Z120/Z120.g
===================================================================
--- trunk/src/data/Z120/Z120.g 2009-09-11 13:30:32 UTC (rev 318)
+++ trunk/src/data/Z120/Z120.g 2009-09-11 13:44:07 UTC (rev 319)
@@ -29,6 +29,14 @@
backtrack = true;
}
+//@rulecatch {
+// pANTLR3_EXCEPTION exe = EXCEPTION;
+// if(NULL != exe) {
+// bug_report_fun(context, "Part of the file has not been read correctly\n");
+// }
+//}
+
+
@header{
#include "data/Z120/Context.h"
}
Modified: trunk/tests/z120_test/CMakeLists.txt
===================================================================
--- trunk/tests/z120_test/CMakeLists.txt 2009-09-11 13:30:32 UTC (rev 318)
+++ trunk/tests/z120_test/CMakeLists.txt 2009-09-11 13:44:07 UTC (rev 319)
@@ -54,5 +54,14 @@
ADD_Z120_TEST(z120_test39.mpr 1)
ADD_Z120_TEST(z120_test40.mpr 1)
ADD_Z120_TEST(z120_test41.mpr 1)
+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_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)
# $Id$
Modified: trunk/tests/z120_test/z120_diff.py
===================================================================
--- trunk/tests/z120_test/z120_diff.py 2009-09-11 13:30:32 UTC (rev 318)
+++ trunk/tests/z120_test/z120_diff.py 2009-09-11 13:44:07 UTC (rev 319)
@@ -5,17 +5,19 @@
p = subprocess.Popen(["./z120_test" , sys.argv[1], sys.argv[2]], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-f = open(sys.argv[1] + ".result", "r+")
+if int(sys.argv[2]) == 0:
+ exit = p.wait()
+ sys.exit(exit)
-result = difflib.unified_diff(f.readlines(), p.stderr.readlines()+ p.stdout.readlines())
+else:
+ f = open(sys.argv[1] + ".result", "r+")
-error = False
-for line in result:
- print line
- error = True
+ result = difflib.unified_diff(f.readlines(), p.stderr.readlines()+ p.stdout.readlines())
-sys.exit(error)
+ error = False
+ for line in result:
+ print line,
+ error = True
+ sys.exit(error)
-
-#diff = ndiff(
Added: trunk/tests/z120_test/z120_test42.mpr
===================================================================
--- trunk/tests/z120_test/z120_test42.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test42.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,47 @@
+/*************************************************************
+Example of MSC where HMSC has non-available node (L1).
+BMsc3 won't be created due to instance A not start (A: instance;)
+*************************************************************/
+
+mscdocument Vkres1;
+
+msc bmsc3;
+inst A;
+inst B;
+in no,0 from B;
+out ok,1 to B;
+endinstance;
+B: instance;
+out no,0 to A;
+in ok,1 from A;
+endinstance;
+endmsc;
+
+msc Strnka1;
+initial connect L0;
+L0: reference bmsc1 connect L2;
+L1: reference bmsc2 connect L0, L2;
+L2: final;
+endmsc;
+
+msc bmsc1;
+inst A;
+inst B;
+out yes,0 to B;
+endinstance;
+B: instance;
+in yes,0 from A;
+endinstance;
+endmsc;
+
+msc bmsc2;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+endinstance;
+B: instance;
+out no,0 to A;
+endinstance;
+endmsc;
+
Added: trunk/tests/z120_test/z120_test42.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test42.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test42.mpr.result 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,28 @@
+z120_test42.mpr(11) : error 3 : , at offset 0
+ near [Index: 22 (Start: 152711996-Stop: 152711997) ='in', type<58> Line: 11 LinePos:0]
+ : cannot match to any predicted input...
+z120_test42.mpr(30) : error 3 : , at offset 0
+ near [Index: 144 (Start: 152712273-Stop: 152712275) ='out', type<57> Line: 30 LinePos:0]
+ : cannot match to any predicted input...
+Warning 09: There is reference to nonexisted MSC
+
+OK: z120_test42.mpr is correct, should be correct
+
+mscdocument z120_test42;
+msc Strnka1;
+initial connect L0;
+L0: reference bmsc1 connect L1;
+L1: final;
+endmsc;
+msc bmsc2;
+inst A;
+inst B;
+A: instance;
+in no,0 from B;
+endinstance;
+B: instance;
+out no,0 to A;
+endinstance;
+endmsc;
+msc bmsc1;
+endmsc;
Added: trunk/tests/z120_test/z120_test43.mpr
===================================================================
--- trunk/tests/z120_test/z120_test43.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test43.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,3 @@
+/********************************************
+Test with empty file
+********************************************/
Added: trunk/tests/z120_test/z120_test44.mpr
===================================================================
--- trunk/tests/z120_test/z120_test44.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test44.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,19 @@
+/*****************************************************
+Simple test of bmsc (event driven notification)
+
+******************************************************/
+
+mscdocument bbb;
+A: instance;
+B: instance;
+A: in A,1 from found;
+A: out jedna,2 to B;
+B: in jedna,2 from A;
+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_test45.mpr
===================================================================
--- trunk/tests/z120_test/z120_test45.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test45.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,19 @@
+/*****************************************************
+Simple test of bmsc (event driven notification)
+Missing one part of complete message
+******************************************************/
+
+mscdocument bbb;
+msc pok2;
+A: instance;
+B: instance;
+A: in A,1 from found;
+B: in jedna,2 from A;
+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_test46.mpr
===================================================================
--- trunk/tests/z120_test/z120_test46.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test46.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,16 @@
+/***********************************************
+Simple test of bMSC (event driven notification)
+***********************************************/
+
+p1: instance;
+p2: instance;
+
+p1: out a to p2;
+p2: in a from p1;
+
+p2: out a to p1;
+p1: in a from p2;
+
+p1: endinstance;
+p2: endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test47.mpr
===================================================================
--- trunk/tests/z120_test/z120_test47.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test47.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,21 @@
+/*************************************************
+Example of bMsc where one event in coregion is labeled the other not.
+*************************************************/
+
+mscdocument z120_test46;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+in A,0 from found;
+out jedna,1 to B;
+concurrent;
+out B1,2 to B;
+label e1; out B,3 to lost;
+endconcurrent;
+endinstance;
+B: instance;
+in jedna,1 from A;
+in B1,2 from A;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test47.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test47.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test47.mpr.result 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,19 @@
+OK: z120_test47.mpr is correct, should be correct
+
+mscdocument z120_test47;
+msc pok2;
+inst A;
+inst B;
+A: instance;
+in A,0 from found;
+out jedna,1 to B;
+concurrent;
+label e0; out B1,2 to B;
+label e1; out B,3 to lost;
+endconcurrent;
+endinstance;
+B: instance;
+in jedna,1 from A;
+in B1,2 from A;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test48.mpr
===================================================================
--- trunk/tests/z120_test/z120_test48.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test48.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,12 @@
+/*************************************************
+Simple test of HMSC
+**************************************************/
+
+msc Stranka1;
+connect L0;
+L0: connect L1, L2;
+L1: reference NAME connect L2;
+L2: reference NAME1 connect L3;
+L3: final;
+endmsc;
+
Added: trunk/tests/z120_test/z120_test49.mpr
===================================================================
--- trunk/tests/z120_test/z120_test49.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test49.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,11 @@
+/*************************************************
+Simple test of HMSC
+**************************************************/
+
+msc Stranka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference NAME connect L2;
+L2: reference NAME1 connect L3;
+endmsc;
+
Added: trunk/tests/z120_test/z120_test49.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test49.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test49.mpr.result 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,17 @@
+Warning 08: There is reference to nonexisted node
+
+Warning 09: There is reference to nonexisted MSC
+
+OK: z120_test49.mpr is correct, should be correct
+
+mscdocument z120_test49;
+msc Stranka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference NAME connect L2;
+L2: reference NAME1;
+endmsc;
+msc NAME;
+endmsc;
+msc NAME1;
+endmsc;
Added: trunk/tests/z120_test/z120_test50.mpr
===================================================================
--- trunk/tests/z120_test/z120_test50.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test50.mpr 2009-09-11 13:44:07 UTC (rev 319)
@@ -0,0 +1,12 @@
+/*************************************************
+Simple test of HMSC
+**************************************************/
+
+msc Stranka1;
+initial connect L0;
+L0: connect L1, L2;
+L1: NAME connect L2;
+L2: reference NAME1 connect L3;
+L3: final;
+endmsc;
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <koc...@us...> - 2009-09-11 14:20:28
|
Revision: 322
http://scstudio.svn.sourceforge.net/scstudio/?rev=322&view=rev
Author: kocianon
Date: 2009-09-11 14:20:18 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
string constructors for visio
Modified Paths:
--------------
trunk/src/data/time.cpp
trunk/src/data/time.h
trunk/tests/interval_string.cpp
Modified: trunk/src/data/time.cpp
===================================================================
--- trunk/src/data/time.cpp 2009-09-11 14:13:41 UTC (rev 321)
+++ trunk/src/data/time.cpp 2009-09-11 14:20:18 UTC (rev 322)
@@ -17,6 +17,7 @@
*/
#include "data/time.h"
+#include <limits>
DecScaled::DecScaled(const std::string &number)
: m_exp(0), m_mant(0)
@@ -56,8 +57,14 @@
m_closed(closed)
,m_value(0)
{
- const char* pos = number.c_str();
- m_value = atof(pos);
+ if(number[0]=='i')
+ m_value = std::numeric_limits<double>::infinity();
+ else
+ {
+ const char* pos = number.c_str();
+ m_value = atof(pos);
+ }
+
}
template <>
@@ -66,8 +73,17 @@
m_closed(closed)
,m_value(0)
{
- DecScaled tmp(number);
- m_value = tmp;
+ if(number[0]=='i')
+ {
+
+ DecScaled tmp(std::numeric_limits<long>::max());
+ m_value = tmp;
+ }
+ else
+ {
+ DecScaled tmp(number);
+ m_value = tmp;
+ }
}
template class SCMSC_EXPORT MscIntervalCouple<double>;
Modified: trunk/src/data/time.h
===================================================================
--- trunk/src/data/time.h 2009-09-11 14:13:41 UTC (rev 321)
+++ trunk/src/data/time.h 2009-09-11 14:20:18 UTC (rev 322)
@@ -28,6 +28,7 @@
#include<cstdlib>
#include<iostream>
#include<cctype>
+#include<cstring>
#include<string>
#if defined(_MSC_VER)
@@ -64,17 +65,6 @@
return t;
}
-// string to number helping functions
-inline bool isNotIn(const char& znak,const std::string& set = "[](),")
-{
- return set.find(znak)==std::string::npos;
-}
-
-inline bool clean(char znak)
-{
- return isdigit(znak)==0&&isNotIn(znak);
-}
-
class MscIntervalCoupleUncomparable:public std::exception
{
public:
@@ -106,6 +96,60 @@
};
+// string to number helping functions
+inline bool isNotIn(const char& znak,const std::string& set = "[](),")
+{
+ return set.find(znak)==std::string::npos;
+}
+
+inline bool clean(char znak)
+{
+ return isdigit(znak)==0&&isNotIn(znak);
+}
+
+inline std::string get_nospace(const std::string& word)
+{
+ std::string tmp;
+ for(unsigned i=0;i<word.length();i++)
+ {
+ if(isspace(word[i]))
+ continue;
+ tmp+=word[i];
+ }
+ return tmp;
+}
+
+/*
+ * Checking string for numbers, comma and string inf, others are not
+ * allowed
+ */
+inline void check_chars(const std::string& word)
+{
+ const std::string inf="inf";
+
+ if(isdigit(word[0]))
+ {
+ for(unsigned i=0;i<word.length();i++)
+ {
+ if(isdigit(word[i]))
+ continue;
+ else
+ throw MscIntervalStringConversionError("Mixing numbers and alphabeth\n");
+ }
+ }
+ else if(isalpha(word[0]))
+ {
+ if(word!=inf)
+ throw MscIntervalStringConversionError("Only allowed string \
+ is \"inf\"\n");
+ }
+}
+
+inline void check_numbers(const std::string& word)
+{
+}
+
+
/**
* Decimal scaling structure, stands for:
* m_mant*10^m_exp;
@@ -494,29 +538,53 @@
MscTimeInterval(const std::string& interval)
throw(MscIntervalStringConversionError)
{
- std::string tmp(interval);
+ // remove spaces
+ std::string tmp = get_nospace(interval);
+
bool b_closed = true;
bool e_closed = true;
// remove all unsuitable characters; letting just numbers,commas,brackets
tmp.erase(remove_if(tmp.begin(),tmp.end(),clean),tmp.end());
- // detect starting bracket
+ // detecting starting bracket
if(isNotIn(tmp[0],std::string("([")))
- throw MscIntervalStringConversionError("No starting bracket [ or (\n");
+ {
+ // check the last one
+ if(isNotIn(tmp[tmp.length()-1],")]"))
+ {
+ check_chars(tmp);
+ MscIntervalCouple<T> begin(tmp,b_closed);
+ MscIntervalCouple<T> end(tmp,e_closed);
+
+ m_begin = begin;
+ m_end = end;
+ if(!is_valid())
+ throw MscIntervalStringConversionError("Interval is not valid");
+ return;
+ }
+ else
+ throw MscIntervalStringConversionError("Missing starting \
+ bracket - allowed form: (/[number,number)/],\
+ [number],number\n");
+ }
+ // detecting ending bracket
+ if(isNotIn(tmp[tmp.length()-1],")]"))
+ throw MscIntervalStringConversionError("Missing ending \
+ bracket - allowed form: (/[number,number)/],\
+ [number],number\n");
+
+ // setting up closed
if(tmp[0]=='(')
b_closed = false;
- // erase it
- tmp.erase(tmp.begin());
-
- //detect ending bracket
- if(isNotIn(tmp[tmp.length()-1],")]"))
- throw MscIntervalStringConversionError("No ending bracket ) or ]\n");
if(tmp[tmp.length()-1]==')')
e_closed = false;
- // erase it
+
+ // erasing both brackets from string
+ tmp.erase(tmp.begin());
tmp.erase(tmp.end()-1);
+ // check for allowed characters
std::string b(tmp);
std::string e(tmp);
@@ -528,12 +596,17 @@
tmp.erase(comma_pos); // erase all from comma including comma
b = std::string(tmp);
}
+
+ check_chars(b);
+ check_chars(e);
MscIntervalCouple<T> begin(b,b_closed);
MscIntervalCouple<T> end(e,e_closed);
m_begin = begin;
m_end = end;
+ if(!is_valid())
+ throw MscIntervalStringConversionError("Interval is not valid");
}
MscIntervalCouple<T> get_begin() const
@@ -827,6 +900,26 @@
public:
MscTimeIntervalSet(){}
+ MscTimeIntervalSet(const std::string s_interval)
+ {
+ std::string tmp;
+ for(size_t i=0;i<s_interval.length();i++)
+ {
+ if(s_interval[i]=='+')
+ {
+ MscTimeInterval<T> interval(tmp);
+ insert(interval);
+ std::cerr << tmp << std::endl;
+ tmp="";
+ }
+ else
+ tmp+=s_interval[i];
+ }
+
+ MscTimeInterval<T> interval(tmp);
+ insert(interval);
+ }
+
MscTimeIntervalSet(const MscTimeInterval<T>& interval)
{
m_set.push_back(interval);
Modified: trunk/tests/interval_string.cpp
===================================================================
--- trunk/tests/interval_string.cpp 2009-09-11 14:13:41 UTC (rev 321)
+++ trunk/tests/interval_string.cpp 2009-09-11 14:20:18 UTC (rev 322)
@@ -14,19 +14,19 @@
MscTimeInterval<double> dou(false,10,18,true);
MscTimeInterval<DecScaled> dec(false,10,18,true);
- MscTimeInterval<double> inter_double(std::string("( 10 , 18] sd "));
- MscTimeInterval<DecScaled> inter_dec(std::string(" ( 1 0 , 1 8] "));
- std::cerr << inter_double << std::endl;
- std::cerr << dou << std::endl;
+// MscTimeInterval<double> inter_double(std::string("( 10 , 18] sd "));
+// MscTimeInterval<DecScaled> inter_dec(std::string(" ( 1 0 , 1 8] "));
+// std::cerr << inter_double << std::endl;
+// std::cerr << dou << std::endl;
- TEST_ASSERT(dou==inter_double);
+// TEST_ASSERT(dou==inter_double);
- std::cerr << inter_dec << std::endl;
- std::cerr << dec << std::endl;
+// std::cerr << inter_dec << std::endl;
+// std::cerr << dec << std::endl;
- TEST_ASSERT(dec==inter_dec);
+// TEST_ASSERT(dec==inter_dec);
-
+/*
try {
MscTimeInterval<double> a(std::string(" 9 9 "));
TEST_ASSERT(false);
@@ -44,10 +44,19 @@
TEST_ASSERT(false);
}
catch(MscIntervalStringConversionError){}
-
- MscTimeInterval<DecScaled> d("[10]");
+*/
+ MscTimeInterval<DecScaled> d("[ 10]");
std::cerr << d << std::endl;
+ MscTimeInterval<DecScaled> a("10");
+ std::cerr << a << std::endl;
+
+ MscTimeInterval<DecScaled> b("(10,12]");
+ std::cerr << b << std::endl;
+
+ MscTimeIntervalSet<double> c("10+[10]+50+[30,40)");
+ std::cerr << c << std::endl;
+
// MscTimeInterval<DecScaled> c(std::string("405"));
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <got...@us...> - 2009-09-12 11:02:16
|
Revision: 324
http://scstudio.svn.sourceforge.net/scstudio/?rev=324&view=rev
Author: gotthardp
Date: 2009-09-12 11:02:05 +0000 (Sat, 12 Sep 2009)
Log Message:
-----------
New tests integrated into the ctest environment.
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/tests/CMakeLists.txt
trunk/tests/z120_test/CMakeLists.txt
Added Paths:
-----------
trunk/doc/CMakeLists.txt
trunk/tests/acyclic/CMakeLists.txt
trunk/tests/fifo/CMakeLists.txt
trunk/tests/local_choice/CMakeLists.txt
Removed Paths:
-------------
trunk/doc/Makefile
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2009-09-12 09:07:28 UTC (rev 323)
+++ trunk/CMakeLists.txt 2009-09-12 11:02:05 UTC (rev 324)
@@ -39,6 +39,7 @@
SET(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
ENDIF(WIN32)
+ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
Added: trunk/doc/CMakeLists.txt
===================================================================
--- trunk/doc/CMakeLists.txt (rev 0)
+++ trunk/doc/CMakeLists.txt 2009-09-12 11:02:05 UTC (rev 324)
@@ -0,0 +1,18 @@
+FIND_PACKAGE(LATEX)
+
+MACRO(ADD_PDFLATEX_DOCUMENT FILE)
+ ADD_CUSTOM_TARGET(${FILE} ALL
+ DEPENDS ${FILE}.pdf
+ )
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${FILE}.pdf
+ COMMAND ${PDFLATEX_COMPILER} ${FILE}.tex
+ DEPENDS ${FILE}.tex
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+ENDMACRO(ADD_PDFLATEX_DOCUMENT)
+
+IF(PDFLATEX_COMPILER)
+ ADD_PDFLATEX_DOCUMENT(beautify)
+ ADD_PDFLATEX_DOCUMENT(memb_alg)
+ENDIF(PDFLATEX_COMPILER)
Property changes on: trunk/doc/CMakeLists.txt
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Deleted: trunk/doc/Makefile
===================================================================
--- trunk/doc/Makefile 2009-09-12 09:07:28 UTC (rev 323)
+++ trunk/doc/Makefile 2009-09-12 11:02:05 UTC (rev 324)
@@ -1,9 +0,0 @@
-# $Id: Makefile,v 1.3 2008/10/09 08:07:40 xrehak Exp $
-all: memb_alg.pdf beautify.pdf
-
-%.pdf: %.tex algorithmic.sty algorithm.sty
- pdflatex $<
- pdflatex $<
-
-clean:
- rm -rf *.dvi *.log *.aux *.out
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2009-09-12 09:07:28 UTC (rev 323)
+++ trunk/tests/CMakeLists.txt 2009-09-12 11:02:05 UTC (rev 324)
@@ -91,6 +91,7 @@
scZ120
${CMAKE_DL_LIBS}
)
+GET_TARGET_PROPERTY(CHECKER_TEST_EXECUTABLE checker_test LOCATION)
SET(CHECKER_SEQUENCE 0)
MACRO(ADD_CHECKER_TEST LIBRARY PROPERTY FILE SATISFIED)
@@ -99,14 +100,14 @@
# depending on the generator being used with the test-time variable.
STRING(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}"
LIBRARY_LOCATION "${LIBRARY_LOCATION}")
- ADD_TEST("checker_test-${CHECKER_SEQUENCE}-${LIBRARY}"
- ${EXECUTABLE_OUTPUT_PATH}/checker_test ${LIBRARY_LOCATION} ${PROPERTY} ${FILE} ${SATISFIED})
+ ADD_TEST("checker_test-${CHECKER_SEQUENCE}-${FILE}"
+ ${CHECKER_TEST_EXECUTABLE} ${LIBRARY_LOCATION} ${PROPERTY} ${FILE} ${SATISFIED})
MATH(EXPR CHECKER_SEQUENCE ${CHECKER_SEQUENCE}+1)
ENDMACRO(ADD_CHECKER_TEST)
-ADD_CHECKER_TEST(scorder "FIFO" z120_test00.mpr 1)
-ADD_CHECKER_TEST(scorder "Acyclic" z120_test00.mpr 1)
-ADD_CHECKER_TEST(scrace "Race Free" z120_test00.mpr 0)
+ADD_SUBDIRECTORY(acyclic)
+ADD_SUBDIRECTORY(fifo)
+ADD_SUBDIRECTORY(local_choice)
ENDIF(ANTLR_FOUND)
Added: trunk/tests/acyclic/CMakeLists.txt
===================================================================
--- trunk/tests/acyclic/CMakeLists.txt (rev 0)
+++ trunk/tests/acyclic/CMakeLists.txt 2009-09-12 11:02:05 UTC (rev 324)
@@ -0,0 +1,12 @@
+# Positive test-cases
+ADD_CHECKER_TEST(scorder "Acyclic" acyclic1.mpr 1)
+ADD_CHECKER_TEST(scorder "Acyclic" acyclic2.mpr 1)
+ADD_CHECKER_TEST(scorder "Acyclic" acyclic3.mpr 1)
+ADD_CHECKER_TEST(scorder "Acyclic" acyclic4.mpr 1)
+ADD_CHECKER_TEST(scorder "Acyclic" acyclic5.mpr 1)
+ADD_CHECKER_TEST(scorder "Acyclic" acyclic6.mpr 1)
+# Negative test-cases
+ADD_CHECKER_TEST(scorder "Acyclic" cyclic1.mpr 0)
+ADD_CHECKER_TEST(scorder "Acyclic" cyclic2.mpr 0)
+ADD_CHECKER_TEST(scorder "Acyclic" cyclic3.mpr 0)
+ADD_CHECKER_TEST(scorder "Acyclic" cyclic4.mpr 0)
Property changes on: trunk/tests/acyclic/CMakeLists.txt
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/tests/fifo/CMakeLists.txt
===================================================================
--- trunk/tests/fifo/CMakeLists.txt (rev 0)
+++ trunk/tests/fifo/CMakeLists.txt 2009-09-12 11:02:05 UTC (rev 324)
@@ -0,0 +1,11 @@
+# Positive test-cases
+ADD_CHECKER_TEST(scorder "FIFO" fifo1.mpr 1)
+ADD_CHECKER_TEST(scorder "FIFO" fifo2.mpr 1)
+ADD_CHECKER_TEST(scorder "FIFO" fifo3.mpr 1)
+ADD_CHECKER_TEST(scorder "FIFO" fifo4.mpr 1)
+ADD_CHECKER_TEST(scorder "FIFO" fifo5.mpr 1)
+ADD_CHECKER_TEST(scorder "FIFO" fifo6.mpr 1)
+ADD_CHECKER_TEST(scorder "FIFO" fifo7.mpr 1)
+# Negative test-cases
+ADD_CHECKER_TEST(scorder "FIFO" nonfifo1.mpr 0)
+ADD_CHECKER_TEST(scorder "FIFO" nonfifo2.mpr 0)
Property changes on: trunk/tests/fifo/CMakeLists.txt
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/tests/local_choice/CMakeLists.txt
===================================================================
--- trunk/tests/local_choice/CMakeLists.txt (rev 0)
+++ trunk/tests/local_choice/CMakeLists.txt 2009-09-12 11:02:05 UTC (rev 324)
@@ -0,0 +1,10 @@
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" hard1_nonlocal.mpr 0)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" hard2_nonlocal.mpr 0)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" hard3_local.mpr 1)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" medium1_nonlocal.mpr 0)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" medium2_nonlocal.mpr 0)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" medium3_local.mpr 1)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" simple2_nonlocal.mpr 0)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" simple3_nonlocal.mpr 0)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" simple_local.mpr 1)
+ADD_CHECKER_TEST(sclocalchoice "Local Choice" simple_nonlocal.mpr 0)
Property changes on: trunk/tests/local_choice/CMakeLists.txt
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: trunk/tests/z120_test/CMakeLists.txt
===================================================================
--- trunk/tests/z120_test/CMakeLists.txt 2009-09-12 09:07:28 UTC (rev 323)
+++ trunk/tests/z120_test/CMakeLists.txt 2009-09-12 11:02:05 UTC (rev 324)
@@ -7,7 +7,7 @@
SET(Z120_SEQUENCE 0)
MACRO(ADD_Z120_TEST FILE SATISFIED)
- ADD_TEST("z120_test-${Z120_SEQUENCE}"
+ ADD_TEST("z120_test-${Z120_SEQUENCE}-${FILE}"
${EXECUTABLE_OUTPUT_PATH}/z120_diff.py ${FILE} ${SATISFIED})
MATH(EXPR Z120_SEQUENCE ${Z120_SEQUENCE}+1)
ENDMACRO(ADD_Z120_TEST)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <got...@us...> - 2009-09-12 13:56:43
|
Revision: 326
http://scstudio.svn.sourceforge.net/scstudio/?rev=326&view=rev
Author: gotthardp
Date: 2009-09-12 13:56:36 +0000 (Sat, 12 Sep 2009)
Log Message:
-----------
Enhanced test scripts to work under Win32.
Fixed file/directory properties.
Modified Paths:
--------------
trunk/tests/CMakeLists.txt
trunk/tests/checker_test.cpp
trunk/tests/z120_test/CMakeLists.txt
trunk/tests/z120_test/z120_diff.py
Property Changed:
----------------
trunk/doc/
trunk/tests/acyclic/
trunk/tests/acyclic/acyclic1.mpr
trunk/tests/acyclic/acyclic1.vsd
trunk/tests/acyclic/acyclic2.mpr
trunk/tests/acyclic/acyclic2.vsd
trunk/tests/acyclic/acyclic3.mpr
trunk/tests/acyclic/acyclic3.vsd
trunk/tests/acyclic/acyclic4.mpr
trunk/tests/acyclic/acyclic4.vsd
trunk/tests/acyclic/acyclic5.mpr
trunk/tests/acyclic/acyclic5.vsd
trunk/tests/acyclic/acyclic6.mpr
trunk/tests/acyclic/acyclic6.vsd
trunk/tests/acyclic/cyclic1.mpr
trunk/tests/acyclic/cyclic1.vsd
trunk/tests/acyclic/cyclic2.mpr
trunk/tests/acyclic/cyclic2.vsd
trunk/tests/acyclic/cyclic3.mpr
trunk/tests/acyclic/cyclic3.vsd
trunk/tests/acyclic/cyclic4.mpr
trunk/tests/acyclic/cyclic4.vsd
trunk/tests/fifo/
trunk/tests/fifo/fifo1.mpr
trunk/tests/fifo/fifo1.vsd
trunk/tests/fifo/fifo2.mpr
trunk/tests/fifo/fifo2.vsd
trunk/tests/fifo/fifo3.mpr
trunk/tests/fifo/fifo3.vsd
trunk/tests/fifo/fifo4.mpr
trunk/tests/fifo/fifo4.vsd
trunk/tests/fifo/fifo5.mpr
trunk/tests/fifo/fifo5.vsd
trunk/tests/fifo/fifo6.mpr
trunk/tests/fifo/fifo6.vsd
trunk/tests/fifo/fifo7.mpr
trunk/tests/fifo/fifo7.vsd
trunk/tests/fifo/nonfifo1.mpr
trunk/tests/fifo/nonfifo1.vsd
trunk/tests/fifo/nonfifo2.mpr
trunk/tests/fifo/nonfifo2.vsd
trunk/tests/local_choice/
trunk/tests/membership/
trunk/tests/z120_test/
Property changes on: trunk/doc
___________________________________________________________________
Added: svn:ignore
+ CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
*.dir
Makefile
*.vcproj
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2009-09-12 13:52:45 UTC (rev 325)
+++ trunk/tests/CMakeLists.txt 2009-09-12 13:56:36 UTC (rev 326)
@@ -92,16 +92,19 @@
${CMAKE_DL_LIBS}
)
GET_TARGET_PROPERTY(CHECKER_TEST_EXECUTABLE checker_test LOCATION)
+# Replace the "$(IntDir)", "$(OutDir)", or "$(CONFIGURATION)"
+# depending on the generator being used with the test-time variable.
+STRING(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}"
+ CHECKER_TEST_EXECUTABLE "${CHECKER_TEST_EXECUTABLE}")
SET(CHECKER_SEQUENCE 0)
MACRO(ADD_CHECKER_TEST LIBRARY PROPERTY FILE SATISFIED)
GET_TARGET_PROPERTY(LIBRARY_LOCATION ${LIBRARY} LOCATION)
# Replace the "$(IntDir)", "$(OutDir)", or "$(CONFIGURATION)"
- # depending on the generator being used with the test-time variable.
STRING(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}"
LIBRARY_LOCATION "${LIBRARY_LOCATION}")
ADD_TEST("checker_test-${CHECKER_SEQUENCE}-${FILE}"
- ${CHECKER_TEST_EXECUTABLE} ${LIBRARY_LOCATION} ${PROPERTY} ${FILE} ${SATISFIED})
+ ${CHECKER_TEST_EXECUTABLE} ${LIBRARY_LOCATION} ${PROPERTY} ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${SATISFIED})
MATH(EXPR CHECKER_SEQUENCE ${CHECKER_SEQUENCE}+1)
ENDMACRO(ADD_CHECKER_TEST)
Property changes on: trunk/tests/acyclic
___________________________________________________________________
Added: svn:ignore
+ CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
*.dir
Makefile
*.vcproj
Property changes on: trunk/tests/acyclic/acyclic1.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic1.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic2.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic2.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic3.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic3.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic4.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic4.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic5.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic5.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic6.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/acyclic6.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/cyclic1.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/cyclic1.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/cyclic2.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/cyclic2.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/cyclic3.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/cyclic3.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/cyclic4.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/acyclic/cyclic4.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Modified: trunk/tests/checker_test.cpp
===================================================================
--- trunk/tests/checker_test.cpp 2009-09-12 13:52:45 UTC (rev 325)
+++ trunk/tests/checker_test.cpp 2009-09-12 13:56:36 UTC (rev 326)
@@ -153,6 +153,11 @@
z120.save_msc(std::cout, L"counter_example", result);
}
}
+ catch(std::exception &exc)
+ {
+ std::cerr << "ERROR: " << argv[3] << " caused an exception: " << exc.what() << std::endl;
+ errors = 1;
+ }
catch(...)
{
std::cerr << "ERROR: " << argv[3] << " caused an exception" << std::endl;
Property changes on: trunk/tests/fifo
___________________________________________________________________
Added: svn:ignore
+ CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
*.dir
Makefile
*.vcproj
Property changes on: trunk/tests/fifo/fifo1.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo1.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo2.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo2.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo3.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo3.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo4.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo4.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo5.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo5.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo6.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo6.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo7.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/fifo7.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/nonfifo1.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/nonfifo1.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/nonfifo2.mpr
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/fifo/nonfifo2.vsd
___________________________________________________________________
Deleted: svn:executable
- *
Property changes on: trunk/tests/local_choice
___________________________________________________________________
Added: svn:ignore
+ CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
*.dir
Makefile
*.vcproj
Property changes on: trunk/tests/membership
___________________________________________________________________
Added: svn:ignore
+ CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
*.dir
Makefile
*.vcproj
Property changes on: trunk/tests/z120_test
___________________________________________________________________
Added: svn:ignore
+ CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
*.dir
Makefile
*.vcproj
Modified: trunk/tests/z120_test/CMakeLists.txt
===================================================================
--- trunk/tests/z120_test/CMakeLists.txt 2009-09-12 13:52:45 UTC (rev 325)
+++ trunk/tests/z120_test/CMakeLists.txt 2009-09-12 13:56:36 UTC (rev 326)
@@ -1,3 +1,5 @@
+FIND_PACKAGE(PythonInterp REQUIRED)
+
ADD_EXECUTABLE(z120_test
z120_test.cpp
)
@@ -5,10 +7,16 @@
scZ120
)
+GET_TARGET_PROPERTY(Z120_TEST_EXECUTABLE z120_test LOCATION)
+# Replace the "$(IntDir)", "$(OutDir)", or "$(CONFIGURATION)"
+# depending on the generator being used with the test-time variable.
+STRING(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}"
+ Z120_TEST_EXECUTABLE "${Z120_TEST_EXECUTABLE}")
+
SET(Z120_SEQUENCE 0)
MACRO(ADD_Z120_TEST FILE SATISFIED)
ADD_TEST("z120_test-${Z120_SEQUENCE}-${FILE}"
- ${EXECUTABLE_OUTPUT_PATH}/z120_diff.py ${FILE} ${SATISFIED})
+ ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/z120_diff.py" "${Z120_TEST_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}" ${SATISFIED})
MATH(EXPR Z120_SEQUENCE ${Z120_SEQUENCE}+1)
ENDMACRO(ADD_Z120_TEST)
Modified: trunk/tests/z120_test/z120_diff.py
===================================================================
--- trunk/tests/z120_test/z120_diff.py 2009-09-12 13:52:45 UTC (rev 325)
+++ trunk/tests/z120_test/z120_diff.py 2009-09-12 13:56:36 UTC (rev 326)
@@ -3,14 +3,14 @@
import difflib
import sys
-p = subprocess.Popen(["./z120_test" , sys.argv[1], sys.argv[2]], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+p = subprocess.Popen([sys.argv[1], sys.argv[2], sys.argv[3]], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-if int(sys.argv[2]) == 0:
+if int(sys.argv[3]) == 0:
exit = p.wait()
sys.exit(exit)
else:
- f = open(sys.argv[1] + ".result", "r+")
+ f = open(sys.argv[2] + ".result", "r+")
result = difflib.unified_diff(f.readlines(), p.stderr.readlines()+ p.stdout.readlines())
@@ -21,3 +21,5 @@
sys.exit(error)
+
+# $Id: z120_test.cpp 298 2009-09-09 20:20:52Z madzin $
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <got...@us...> - 2009-09-14 19:34:17
|
Revision: 330
http://scstudio.svn.sourceforge.net/scstudio/?rev=330&view=rev
Author: gotthardp
Date: 2009-09-14 19:34:07 +0000 (Mon, 14 Sep 2009)
Log Message:
-----------
Enhanced and modified msc.h functions related to time constraints.
The implementation is now similar to event related code and ready for integration with Microsoft Visio.
Modified Paths:
--------------
trunk/src/check/pseudocode/msc_duplicators.cpp
trunk/src/check/time/time_consistency.h
trunk/src/data/msc.cpp
trunk/src/data/msc.h
trunk/src/view/visio/addon/extract.cpp
trunk/src/view/visio/scstudio.nsi
trunk/tests/bmsc_matrix_converter_test.cpp
trunk/tests/bmsc_tightening_test.cpp
trunk/tests/constrain_check_test.cpp
trunk/tests/tighten_msc_test.cpp
Modified: trunk/src/check/pseudocode/msc_duplicators.cpp
===================================================================
--- trunk/src/check/pseudocode/msc_duplicators.cpp 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/src/check/pseudocode/msc_duplicators.cpp 2009-09-14 19:34:07 UTC (rev 330)
@@ -266,7 +266,8 @@
Event* a_copy = m_duplicator->get_event_copy((*it)->get_event_a());
Event* b_copy = m_duplicator->get_event_copy((*it)->get_event_b());
- TimeRelationEventPtr relation=TimeRelationEvent::create(a_copy,b_copy,(*it)->get_interval_set(),(*it).get());
+ TimeRelationEventPtr relation = new TimeRelationEvent((*it).get());
+ relation->glue_events(a_copy, b_copy);
m_duplicator->set_copy((*it).get(),relation.get());
}
@@ -676,21 +677,16 @@
// copy doesnt exist -> create
if(!relation_copy.get())
{
- relation_copy = TimeRelationRefNode::create((*it).get());
+ relation_copy = new TimeRelationRefNode((*it).get());
set_copy(relation.get(),relation_copy.get());
}
- //connecting: ref_node -> relation
- if(bottom)
- new_ref->add_time_relation_bottom(relation_copy);
- else
- new_ref->add_time_relation_top(relation_copy);
- // connecting: relation -> ref_node
+ // connecting: relation <-> ref_node
ReferenceNode* a = (*it)->get_ref_node_a();
if(ref_node==a)
- relation_copy->set_ref_node_a(new_ref);
+ relation_copy->glue_ref_node_a(bottom, new_ref);
else
- relation_copy->set_ref_node_b(new_ref);
+ relation_copy->glue_ref_node_b(bottom, new_ref);
}
}
Modified: trunk/src/check/time/time_consistency.h
===================================================================
--- trunk/src/check/time/time_consistency.h 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/src/check/time/time_consistency.h 2009-09-14 19:34:07 UTC (rev 330)
@@ -274,9 +274,10 @@
for(size_t j = 0; j < matrix.size1(); j++)
{
if((matrix(i,j).get_set().begin())->get_begin_value()<0)
- continue;
- TimeRelationEvent::create(m_events[i],m_events[j],matrix(i,j));
-
+ continue;
+
+ TimeRelationEventPtr relation = new TimeRelationEvent(matrix(i,j));
+ relation->glue_events(m_events[i], m_events[j]);
}
}
Modified: trunk/src/data/msc.cpp
===================================================================
--- trunk/src/data/msc.cpp 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/src/data/msc.cpp 2009-09-14 19:34:07 UTC (rev 330)
@@ -316,21 +316,11 @@
/////////////////////////////////////////////////////////////////////////////
#ifdef _TIME_H_
-TimeRelation::TimeRelation(MscTimeIntervalSetD set,TimeRelation* original=NULL):
- MscElementTmpl<TimeRelation>(original), m_interval_set(set)
+TimeRelation::TimeRelation(const MscTimeIntervalSetD& set):
+ MscElementTmpl<TimeRelation>(NULL), m_interval_set(set)
{
}
-TimeRelation::TimeRelation(const std::wstring& label):
-MscElementTmpl<TimeRelation>(NULL),m_label(label)
-{
-}
-
-TimeRelation::TimeRelation(const std::wstring& label,MscTimeIntervalSetD set):
- MscElementTmpl<TimeRelation>(NULL), m_label(label), m_interval_set(set)
-{
-}
-
TimeRelation::TimeRelation(TimeRelation* original):
MscElementTmpl<TimeRelation>(original)
{
@@ -352,6 +342,17 @@
{
m_interval_set = set;
}
+
+TimeRelationEvent::TimeRelationEvent(TimeRelationEvent *original):
+ TimeRelation(original)
+{
+}
+
+TimeRelationRefNode::TimeRelationRefNode(TimeRelationRefNode *original):
+ TimeRelation(original)
+{
+}
+
#endif
// $Id$
Modified: trunk/src/data/msc.h
===================================================================
--- trunk/src/data/msc.h 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/src/data/msc.h 2009-09-14 19:34:07 UTC (rev 330)
@@ -1465,6 +1465,15 @@
m_time_relations.push_back(relation);
}
+ void remove_time_relation(TimeRelationEventPtr relation)
+ {
+ TimeRelationEventPtrList::iterator pos =
+ std::find(m_time_relations.begin(), m_time_relations.end(), relation);
+
+ if(pos != m_time_relations.end())
+ m_time_relations.erase(pos);
+ }
+
void set_time_relations(const TimeRelationEventPtrList& list)
{
m_time_relations=list;
@@ -2256,23 +2265,17 @@
class SCMSC_EXPORT TimeRelation:public MscElementTmpl<TimeRelation>
{
protected:
- std::wstring m_label;
MscTimeIntervalSet<double> m_interval_set;
public:
- TimeRelation(MscTimeIntervalSetD,TimeRelation*);
- TimeRelation(const std::wstring& label=L"");
+ TimeRelation(const MscTimeIntervalSetD& set);
+ TimeRelation(TimeRelation *original);
- TimeRelation(const std::wstring&,const MscTimeIntervalSetD);
-
- TimeRelation(TimeRelation*);
-
const MscTimeIntervalSetD& get_interval_set();
void set_interval_set(const MscTimeIntervalSetD&);
virtual ~TimeRelation();
-
};
class SCMSC_EXPORT TimeRelationEvent:public TimeRelation
@@ -2283,11 +2286,12 @@
public:
- TimeRelationEvent(Event* a,Event* b,MscTimeIntervalSetD set,TimeRelationEvent* original=NULL):
- TimeRelation(set,original),m_event_origin(a),m_event(b)
+ TimeRelationEvent(const MscTimeIntervalSet<double>& set):
+ TimeRelation(set), m_event_origin(NULL), m_event(NULL)
{
}
+ TimeRelationEvent(TimeRelationEvent *original);
Event* get_event_a()
{
@@ -2299,57 +2303,59 @@
return m_event;
}
-
~TimeRelationEvent()
{
}
- void set_a(Event* a)
+ void glue_event_a(Event* a)
{
+ // unglue, if already glued
+ if(m_event_origin)
+ m_event_origin->remove_time_relation(this);
+
m_event_origin = a;
+ m_event_origin->add_time_relation(this);
}
- void set_b(Event* b)
+ void glue_event_b(Event* b)
{
+ // unglue, if already glued
+ if(m_event)
+ m_event->remove_time_relation(this);
+
m_event = b;
+ m_event->add_time_relation(this);
}
- void set_set(MscTimeIntervalSetD set)
+ void glue_events(Event* a, Event* b)
{
- m_interval_set = set;
+ glue_event_a(a);
+ glue_event_b(a);
}
- static TimeRelationEventPtr create(Event* a,Event* b,MscTimeIntervalSetD set,TimeRelationEvent* original=NULL)
+ void set_set(const MscTimeIntervalSetD& set)
{
- TimeRelationEventPtr new_relation = new TimeRelationEvent(a,b,set,original);
- a->add_time_relation(new_relation);
- b->add_time_relation(new_relation);
- return new_relation;
+ m_interval_set = set;
}
-
};
class SCMSC_EXPORT TimeRelationRefNode:public TimeRelation
{
private:
+ bool m_bottom_origin;
ReferenceNode* m_node_origin;
+ bool m_bottom;
ReferenceNode* m_node;
public:
- TimeRelationRefNode(
- ReferenceNode* a
- ,ReferenceNode* b
- ,MscTimeIntervalSet<double> set
- ,TimeRelationRefNode* original=NULL
- )
- :TimeRelation(set,original)
- ,m_node_origin(a)
- ,m_node(b)
+ TimeRelationRefNode(const MscTimeIntervalSet<double>& set):
+ TimeRelation(set), m_node_origin(NULL), m_node(NULL)
{
-
}
+ TimeRelationRefNode(TimeRelationRefNode *original);
+
ReferenceNode* get_ref_node_a()
{
return m_node_origin;
@@ -2360,50 +2366,55 @@
return m_node;
}
- void set_ref_node_a(ReferenceNode* a)
+ void glue_ref_node_a(bool bottom, ReferenceNode* a)
{
+ // unglue, if already glued
+ if(m_node_origin)
+ {
+ if(m_bottom_origin)
+ m_node_origin->remove_time_relation_bottom(this);
+ else
+ m_node_origin->remove_time_relation_top(this);
+ }
+
m_node_origin = a;
+ m_bottom_origin = bottom;
+
+ if(m_bottom_origin)
+ m_node_origin->add_time_relation_bottom(this);
+ else
+ m_node_origin->add_time_relation_top(this);
}
- void set_ref_node_b(ReferenceNode* b)
+ void glue_ref_node_b(bool bottom, ReferenceNode* b)
{
+ // unglue, if already glued
+ if(m_node)
+ {
+ if(m_bottom)
+ m_node->remove_time_relation_bottom(this);
+ else
+ m_node->remove_time_relation_top(this);
+ }
+
m_node = b;
+ m_bottom = bottom;
+
+ if(m_bottom)
+ m_node->add_time_relation_bottom(this);
+ else
+ m_node->add_time_relation_top(this);
}
- ~TimeRelationRefNode()
+ void glue_ref_nodes(bool bottom_a, ReferenceNode* a, bool bottom_b, ReferenceNode* b)
{
+ glue_ref_node_a(bottom_a, a);
+ glue_ref_node_b(bottom_b, b);
}
- static TimeRelationRefNodePtr create(
- bool bottom_a
- ,ReferenceNode* a
- ,ReferenceNode* b
- ,bool bottom_b
- ,MscTimeIntervalSetD set
- )
+ ~TimeRelationRefNode()
{
- TimeRelationRefNodePtr new_relation = new TimeRelationRefNode(a,b,set);
- if(bottom_a)
- a->add_time_relation_bottom(new_relation);
- else
- a->add_time_relation_top(new_relation);
-
- if(bottom_b)
- b->add_time_relation_bottom(new_relation);
- else
- b->add_time_relation_top(new_relation);
-
- return new_relation;
}
-
- static TimeRelationRefNodePtr create(TimeRelationRefNode* relation)
- {
- TimeRelationRefNodePtr new_relation;
- new_relation = new TimeRelationRefNode(NULL,NULL,relation->get_interval_set(),relation);
-
- return new_relation;
- }
-
};
#endif
Modified: trunk/src/view/visio/addon/extract.cpp
===================================================================
--- trunk/src/view/visio/addon/extract.cpp 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/src/view/visio/addon/extract.cpp 2009-09-14 19:34:07 UTC (rev 330)
@@ -466,74 +466,80 @@
{
Visio::IVShapePtr shape = vsoPage->Shapes->Item[i];
- TShapeType type = get_shape_type(shape);
- switch(type)
+ try
{
- case ST_BMSC_INSTANCE:
- instances[shape->ID] = new_instance_ptr(shape);
- break;
-
- case ST_BMSC_MESSAGE:
- messages[shape->ID] = new CompleteMessage((const wchar_t*)shape->Text);
- break;
- case ST_BMSC_MESSAGE_LOST:
+ TShapeType type = get_shape_type(shape);
+ switch(type)
{
- IncompleteMessage *new_message = new IncompleteMessage(LOST, (const wchar_t*)shape->Text);
- // lost message: glued on begin, dot on end
- new_message->set_dot_position(GetLineEnd(shape));
- messages[shape->ID] = new_message;
- break;
- }
- case ST_BMSC_MESSAGE_FOUND:
- {
- IncompleteMessage *new_message = new IncompleteMessage(FOUND, (const wchar_t*)shape->Text);
- // found message: glued on end, dot on begin
- new_message->set_dot_position(GetLineBegin(shape));
- messages[shape->ID] = new_message;
- break;
- }
+ case ST_BMSC_INSTANCE:
+ instances[shape->ID] = new_instance_ptr(shape);
+ break;
- case ST_TIME_INTERVAL:
- case ST_TIME_DIRECTED:
- // FIXME: implement constructors to simplify this construct
- time_relations[shape->ID] = new TimeRelationEvent(NULL, NULL,
- MscTimeIntervalSetD(MscTimeInterval<double>(std::string(shape->Text))));
- break;
+ case ST_BMSC_MESSAGE:
+ messages[shape->ID] = new CompleteMessage((const wchar_t*)shape->Text);
+ break;
+ case ST_BMSC_MESSAGE_LOST:
+ {
+ IncompleteMessage *new_message = new IncompleteMessage(LOST, (const wchar_t*)shape->Text);
+ // lost message: glued on begin, dot on end
+ new_message->set_dot_position(GetLineEnd(shape));
+ messages[shape->ID] = new_message;
+ break;
+ }
+ case ST_BMSC_MESSAGE_FOUND:
+ {
+ IncompleteMessage *new_message = new IncompleteMessage(FOUND, (const wchar_t*)shape->Text);
+ // found message: glued on end, dot on begin
+ new_message->set_dot_position(GetLineBegin(shape));
+ messages[shape->ID] = new_message;
+ break;
+ }
- case ST_BMSC_ACTION:
- case ST_BMSC_CONDITION:
- case ST_BMSC_COREGION:
- case ST_BMSC_ORDER_LINE:
- case ST_BMSC_ORDER_ARROW:
- case ST_COMMENT:
- case ST_TEXT:
- // ignore other basic MSC symbols
- break;
+ case ST_TIME_INTERVAL:
+ case ST_TIME_DIRECTED:
+ time_relations[shape->ID] = new TimeRelationEvent(MscTimeIntervalSetD(std::string(shape->Text)));
+ break;
- case ST_HMSC_CONNECTION:
- case ST_HMSC_START:
- case ST_HMSC_END:
- case ST_HMSC_REFERENCE:
- case ST_HMSC_LINE:
- case ST_HMSC_ARROW:
- PrintError(stringize() << page_name << ": "
- << "HMSC symbol '" << shape->Name << "' not allowed in basic MSC drawing.",
- shapelist() << shape);
- break;
+ case ST_BMSC_ACTION:
+ case ST_BMSC_CONDITION:
+ case ST_BMSC_COREGION:
+ case ST_BMSC_ORDER_LINE:
+ case ST_BMSC_ORDER_ARROW:
+ case ST_COMMENT:
+ case ST_TEXT:
+ // ignore other basic MSC symbols
+ break;
- case ST_MARKER_EVENT:
- PrintWarning(stringize() << page_name << ": "
- << "Event marker detected. This drawing has already been checked.",
- shapelist() << shape);
- break;
+ case ST_HMSC_CONNECTION:
+ case ST_HMSC_START:
+ case ST_HMSC_END:
+ case ST_HMSC_REFERENCE:
+ case ST_HMSC_LINE:
+ case ST_HMSC_ARROW:
+ PrintError(stringize() << page_name << ": "
+ << "HMSC symbol '" << shape->Name << "' not allowed in basic MSC drawing.",
+ shapelist() << shape);
+ break;
- case ST_UNKNOWN:
- default:
- PrintWarning(stringize() << page_name << ": "
- << "Ignored a strange symbol '" << shape->Name << "'",
- shapelist() << shape);
- break;
+ case ST_MARKER_EVENT:
+ PrintWarning(stringize() << page_name << ": "
+ << "Event marker detected. This drawing has already been checked.",
+ shapelist() << shape);
+ break;
+
+ case ST_UNKNOWN:
+ default:
+ PrintWarning(stringize() << page_name << ": "
+ << "Ignored a strange symbol '" << shape->Name << "'",
+ shapelist() << shape);
+ break;
+ }
}
+ catch(std::exception& exc)
+ {
+ PrintError(stringize() << page_name << ": " << exc.what(),
+ shapelist() << shape);
+ }
}
// walk though all detected instances: create connections
@@ -991,112 +997,118 @@
{
Visio::IVShapePtr shape = vsoPage->Shapes->Item[i];
- TShapeType type = get_shape_type(shape);
- switch(type)
+ try
{
- case ST_BMSC_INSTANCE:
- case ST_BMSC_MESSAGE:
- case ST_BMSC_MESSAGE_LOST:
- case ST_BMSC_MESSAGE_FOUND:
- PrintError(stringize() << page_name << ": "
- << "Basic MSC symbol '" << shape->Name << "' not allowed in HMSC drawing.",
- shapelist() << shape);
- break;
+ TShapeType type = get_shape_type(shape);
+ switch(type)
+ {
+ case ST_BMSC_INSTANCE:
+ case ST_BMSC_MESSAGE:
+ case ST_BMSC_MESSAGE_LOST:
+ case ST_BMSC_MESSAGE_FOUND:
+ PrintError(stringize() << page_name << ": "
+ << "Basic MSC symbol '" << shape->Name << "' not allowed in HMSC drawing.",
+ shapelist() << shape);
+ break;
- case ST_COMMENT:
- case ST_TEXT:
- // ignore text and comments
- break;
+ case ST_COMMENT:
+ case ST_TEXT:
+ // ignore text and comments
+ break;
- case ST_HMSC_CONNECTION:
- {
- ConnectionNode *new_connection = new ConnectionNode();
- new_connection->set_position(GetPinPos(shape));
+ case ST_HMSC_CONNECTION:
+ {
+ ConnectionNode *new_connection = new ConnectionNode();
+ new_connection->set_position(GetPinPos(shape));
- hmsc->add_node(new_connection);
- nodes[shape->ID] = new_connection;
- break;
- }
- case ST_HMSC_START:
- {
- if(hmsc->get_start() != NULL)
+ hmsc->add_node(new_connection);
+ nodes[shape->ID] = new_connection;
+ break;
+ }
+ case ST_HMSC_START:
{
- // FIXME: how to select the other start symbols?
- PrintError(stringize() << page_name << ": "
- << "Multiple HMSC start symbols.",
- shapelist() << shape);
- continue;
+ if(hmsc->get_start() != NULL)
+ {
+ // FIXME: how to select the other start symbols?
+ PrintError(stringize() << page_name << ": "
+ << "Multiple HMSC start symbols.",
+ shapelist() << shape);
+ continue;
+ }
+ StartNode *new_start = new StartNode();
+ new_start->set_position(GetPinPos(shape));
+
+ hmsc->set_start(new_start);
+ nodes[shape->ID] = new_start;
+ break;
}
- StartNode *new_start = new StartNode();
- new_start->set_position(GetPinPos(shape));
+ case ST_HMSC_END:
+ {
+ EndNode *new_end = new EndNode();
+ new_end->set_position(GetPinPos(shape));
- hmsc->set_start(new_start);
- nodes[shape->ID] = new_start;
- break;
- }
- case ST_HMSC_END:
- {
- EndNode *new_end = new EndNode();
- new_end->set_position(GetPinPos(shape));
+ hmsc->add_node(new_end);
+ nodes[shape->ID] = new_end;
+ break;
+ }
+ case ST_HMSC_REFERENCE:
+ {
+ ReferenceNode *new_node = new ReferenceNode();
+ new_node->set_position(GetPinPos(shape));
- hmsc->add_node(new_end);
- nodes[shape->ID] = new_end;
- break;
- }
- case ST_HMSC_REFERENCE:
- {
- ReferenceNode *new_node = new ReferenceNode();
- new_node->set_position(GetPinPos(shape));
+ hmsc->add_node(new_node);
+ nodes[shape->ID] = new_node;
- hmsc->add_node(new_node);
- nodes[shape->ID] = new_node;
+ MscPtr msc = extract_msc(vsoPage->Document, shape->Text);
+ if(msc == NULL)
+ {
+ PrintError(stringize() << page_name << ": "
+ << "Bad reference destination.",
+ shapelist() << shape);
+ }
+ else
+ new_node->set_msc(msc);
+ break;
+ }
+ case ST_HMSC_CONDITION:
+ {
+ ConditionNode *new_condition = new ConditionNode((const wchar_t*)shape->Text);
+ new_condition->set_position(GetPinPos(shape));
- MscPtr msc = extract_msc(vsoPage->Document, shape->Text);
- if(msc == NULL)
- {
- PrintError(stringize() << page_name << ": "
- << "Bad reference destination.",
- shapelist() << shape);
+ hmsc->add_node(new_condition);
+ nodes[shape->ID] = new_condition;
+ break;
}
- else
- new_node->set_msc(msc);
- break;
- }
- case ST_HMSC_CONDITION:
- {
- ConditionNode *new_condition = new ConditionNode((const wchar_t*)shape->Text);
- new_condition->set_position(GetPinPos(shape));
- hmsc->add_node(new_condition);
- nodes[shape->ID] = new_condition;
- break;
- }
+ case ST_HMSC_LINE:
+ case ST_HMSC_ARROW:
+ relations[shape->ID] = new NodeRelation();
+ break;
- case ST_HMSC_LINE:
- case ST_HMSC_ARROW:
- relations[shape->ID] = new NodeRelation();
- break;
+ case ST_TIME_INTERVAL:
+ case ST_TIME_DIRECTED:
+ time_relations[shape->ID] = new TimeRelationRefNode(MscTimeIntervalSetD(std::string(shape->Text)));
+ break;
- case ST_TIME_INTERVAL:
- case ST_TIME_DIRECTED:
- // FIXME: implement constructors to simplify this construct
- time_relations[shape->ID] = new TimeRelationRefNode(NULL, NULL,
- MscTimeIntervalSetD(MscTimeInterval<double>(std::string(shape->Text))));
- break;
+ case ST_MARKER_EVENT:
+ PrintWarning(stringize() << page_name << ": "
+ << "Event marker detected. This drawing has already been checked.",
+ shapelist() << shape);
+ break;
- case ST_MARKER_EVENT:
- PrintWarning(stringize() << page_name << ": "
- << "Event marker detected. This drawing has already been checked.",
- shapelist() << shape);
- break;
-
- case ST_UNKNOWN:
- default:
- PrintWarning(stringize() << page_name << ": "
- << "Ignored a strange symbol '" << shape->Name << "'",
- shapelist() << shape);
- break;
+ case ST_UNKNOWN:
+ default:
+ PrintWarning(stringize() << page_name << ": "
+ << "Ignored a strange symbol '" << shape->Name << "'",
+ shapelist() << shape);
+ break;
+ }
}
+ catch(std::exception& exc)
+ {
+ PrintError(stringize() << page_name << ": " << exc.what(),
+ shapelist() << shape);
+ }
}
if(hmsc->get_start() == NULL)
Modified: trunk/src/view/visio/scstudio.nsi
===================================================================
--- trunk/src/view/visio/scstudio.nsi 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/src/view/visio/scstudio.nsi 2009-09-14 19:34:07 UTC (rev 330)
@@ -21,7 +21,7 @@
; -- General ---------------------------
-!define VERSION "0.3.5"
+!define VERSION "0.3.8"
Name "Sequence Chart Studio"
OutFile "scstudio-setup-${VERSION}.exe"
Modified: trunk/tests/bmsc_matrix_converter_test.cpp
===================================================================
--- trunk/tests/bmsc_matrix_converter_test.cpp 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/tests/bmsc_matrix_converter_test.cpp 2009-09-14 19:34:07 UTC (rev 330)
@@ -83,13 +83,19 @@
ins5.insert(in12);
ins6.insert(in7);
- TimeRelationEvent::create(e0.get(),e1.get(),ins1);
- TimeRelationEvent::create(e1.get(),e5.get(),ins6);
- TimeRelationEvent::create(e5.get(),e2.get(),ins2);
- TimeRelationEvent::create(e3.get(),e2.get(),ins1);
- TimeRelationEvent::create(e3.get(),e4.get(),ins4);
- TimeRelationEvent::create(e0.get(),e4.get(),ins5);
+ TimeRelationEventPtr rel1a = new TimeRelationEvent(ins1);
+ rel1a->glue_events(e0.get(),e1.get());
+ TimeRelationEventPtr rel6 = new TimeRelationEvent(ins6);
+ rel6->glue_events(e1.get(),e5.get());
+ TimeRelationEventPtr rel2 = new TimeRelationEvent(ins2);
+ rel2->glue_events(e5.get(),e2.get());
+ TimeRelationEventPtr rel1b = new TimeRelationEvent(ins1);
+ rel1b->glue_events(e3.get(),e2.get());
+ TimeRelationEventPtr rel4 = new TimeRelationEvent(ins4);
+ rel4->glue_events(e3.get(),e4.get());
+ TimeRelationEventPtr rel5 = new TimeRelationEvent(ins5);
+ rel5->glue_events(e0.get(),e4.get());
BmscMatrixConverter conv;
conv.compute_matrix(bmsc);
Modified: trunk/tests/bmsc_tightening_test.cpp
===================================================================
--- trunk/tests/bmsc_tightening_test.cpp 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/tests/bmsc_tightening_test.cpp 2009-09-14 19:34:07 UTC (rev 330)
@@ -85,12 +85,18 @@
ins6.insert(in7);
- TimeRelationEvent::create(e0.get(),e1.get(),ins1);
- TimeRelationEvent::create(e1.get(),e5.get(),ins6);
- TimeRelationEvent::create(e5.get(),e2.get(),ins2);
- TimeRelationEvent::create(e3.get(),e2.get(),ins1);
- TimeRelationEvent::create(e3.get(),e4.get(),ins4);
- TimeRelationEvent::create(e0.get(),e4.get(),ins5);
+ TimeRelationEventPtr rel1a = new TimeRelationEvent(ins1);
+ rel1a->glue_events(e0.get(),e1.get());
+ TimeRelationEventPtr rel6 = new TimeRelationEvent(ins6);
+ rel6->glue_events(e1.get(),e5.get());
+ TimeRelationEventPtr rel2 = new TimeRelationEvent(ins2);
+ rel2->glue_events(e5.get(),e2.get());
+ TimeRelationEventPtr rel1b = new TimeRelationEvent(ins1);
+ rel1b->glue_events(e3.get(),e2.get());
+ TimeRelationEventPtr rel4 = new TimeRelationEvent(ins4);
+ rel4->glue_events(e3.get(),e4.get());
+ TimeRelationEventPtr rel5 = new TimeRelationEvent(ins5);
+ rel5->glue_events(e0.get(),e4.get());
MscTimeIntervalDSet i;
i.insert(MscTimeIntervalD(0,80));
Modified: trunk/tests/constrain_check_test.cpp
===================================================================
--- trunk/tests/constrain_check_test.cpp 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/tests/constrain_check_test.cpp 2009-09-14 19:34:07 UTC (rev 330)
@@ -51,9 +51,12 @@
r1_3->set_msc(bmsc);
MscTimeIntervalSetD inter;
- TimeRelationRefNodePtr node_relation_1 = TimeRelationRefNode::create(true,r1_1.get(),r1_2.get(),false,inter);
- TimeRelationRefNodePtr node_relation_2 = TimeRelationRefNode::create(true,r1_2.get(),r1_3.get(),false,inter);
- TimeRelationRefNodePtr node_relation_3 = TimeRelationRefNode::create(true,r1_1.get(),r1_3.get(),false,inter);
+ TimeRelationRefNodePtr node_relation_1 = new TimeRelationRefNode(inter);
+ node_relation_1->glue_ref_nodes(true,r1_1.get(),false,r1_2.get());
+ TimeRelationRefNodePtr node_relation_2 = new TimeRelationRefNode(inter);
+ node_relation_2->glue_ref_nodes(true,r1_2.get(),false,r1_3.get());
+ TimeRelationRefNodePtr node_relation_3 = new TimeRelationRefNode(inter);
+ node_relation_3->glue_ref_nodes(true,r1_1.get(),false,r1_3.get());
HMscTimeConstrainChecker constrain_checker;
ChannelMapperPtr chm;
Modified: trunk/tests/tighten_msc_test.cpp
===================================================================
--- trunk/tests/tighten_msc_test.cpp 2009-09-13 23:56:04 UTC (rev 329)
+++ trunk/tests/tighten_msc_test.cpp 2009-09-14 19:34:07 UTC (rev 330)
@@ -84,12 +84,18 @@
ins6.insert(in7);
- TimeRelationEvent::create(e0.get(),e1.get(),ins1);
- TimeRelationEvent::create(e1.get(),e5.get(),ins6);
- TimeRelationEvent::create(e5.get(),e2.get(),ins2);
- TimeRelationEvent::create(e3.get(),e2.get(),ins1);
- TimeRelationEvent::create(e3.get(),e4.get(),ins4);
- TimeRelationEvent::create(e0.get(),e4.get(),ins5);
+ TimeRelationEventPtr rel1a = new TimeRelationEvent(ins1);
+ rel1a->glue_events(e0.get(),e1.get());
+ TimeRelationEventPtr rel6 = new TimeRelationEvent(ins6);
+ rel6->glue_events(e1.get(),e5.get());
+ TimeRelationEventPtr rel2 = new TimeRelationEvent(ins2);
+ rel2->glue_events(e5.get(),e2.get());
+ TimeRelationEventPtr rel1b = new TimeRelationEvent(ins1);
+ rel1b->glue_events(e3.get(),e2.get());
+ TimeRelationEventPtr rel4 = new TimeRelationEvent(ins4);
+ rel4->glue_events(e3.get(),e4.get());
+ TimeRelationEventPtr rel5 = new TimeRelationEvent(ins5);
+ rel5->glue_events(e0.get(),e4.get());
MscTimeIntervalDSet i;
i.insert(MscTimeIntervalD(0,80));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2009-09-15 14:13:34
|
Revision: 332
http://scstudio.svn.sourceforge.net/scstudio/?rev=332&view=rev
Author: madzin
Date: 2009-09-15 14:13:20 +0000 (Tue, 15 Sep 2009)
Log Message:
-----------
Remove backtracking from the grammar. Add tests with missed elements
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/src/data/Z120/Z120.g
trunk/tests/z120_test/CMakeLists.txt
trunk/tests/z120_test/z120_test51.mpr
Added Paths:
-----------
trunk/tests/z120_test/z120_test50.mpr.result
trunk/tests/z120_test/z120_test52.mpr
trunk/tests/z120_test/z120_test52.mpr.result
trunk/tests/z120_test/z120_test53.mpr
trunk/tests/z120_test/z120_test53.mpr.result
trunk/tests/z120_test/z120_test54.mpr
trunk/tests/z120_test/z120_test54.mpr.result
trunk/tests/z120_test/z120_test55.mpr
trunk/tests/z120_test/z120_test55.mpr.result
trunk/tests/z120_test/z120_test56.mpr
trunk/tests/z120_test/z120_test56.mpr.result
trunk/tests/z120_test/z120_test57.mpr
trunk/tests/z120_test/z120_test58.mpr
trunk/tests/z120_test/z120_test58.mpr.result
trunk/tests/z120_test/z120_test59.mpr
trunk/tests/z120_test/z120_test59.mpr.result
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2009-09-14 20:06:35 UTC (rev 331)
+++ trunk/src/data/Z120/Context.cpp 2009-09-15 14:13:20 UTC (rev 332)
@@ -377,8 +377,24 @@
}
}
- InstancePtr instance = context->instances.find(context->element_name)->second;
+ InstancePtr instance;
+ std::map<std::string, InstancePtr>::iterator inst_it = context->instances.find(context->element_name);
+
+ if(inst_it == context->instances.end())
+ {
+ instance = new Instance(TOWSTRING(context->element_name));
+ context->instances.insert(std::make_pair(context->element_name, instance));
+ context->myBmsc->add_instance(instance);
+ context->open_instance++;
+ context->z->print_report(RS_WARNING,
+ stringize() << "Warning 23: Instance (" << TOWSTRING(context->element_name) << ") has not been started (e.g. " << TOWSTRING(context->element_name) << ": instance;)\n");
+ }
+ else
+ {
+ instance = inst_it->second;
+ }
+
if (instance->get_last() == NULL ||
context->coregion_area_finished.find(context->element_name) != context->coregion_area_finished.end())
{
@@ -532,8 +548,24 @@
}
}
- InstancePtr instance = context->instances.find(context->element_name)->second;
+ InstancePtr instance;
+ std::map<std::string, InstancePtr>::iterator inst_it = context->instances.find(context->element_name);
+
+ if(inst_it == context->instances.end())
+ {
+ instance = new Instance(TOWSTRING(context->element_name));
+ context->instances.insert(std::make_pair(context->element_name, instance));
+ context->myBmsc->add_instance(instance);
+ context->open_instance++;
+ context->z->print_report(RS_WARNING,
+ stringize() << "Warning 23: Instance (" << TOWSTRING(context->element_name) << ") has not been started (e.g. " << TOWSTRING(context->element_name) << ": instance;)\n");
+ }
+ else
+ {
+ instance = inst_it->second;
+ }
+
//add new strict area to instance if it is needed
if (instance->get_last() == NULL ||
context->coregion_area_finished.find(context->element_name) != context->coregion_area_finished.end())
Modified: trunk/src/data/Z120/Z120.g
===================================================================
--- trunk/src/data/Z120/Z120.g 2009-09-14 20:06:35 UTC (rev 331)
+++ trunk/src/data/Z120/Z120.g 2009-09-15 14:13:20 UTC (rev 332)
@@ -26,7 +26,8 @@
options
{
language = C;
- backtrack = true;
+// backtrack=true;
+ k=3;
}
//@rulecatch {
@@ -115,15 +116,12 @@
;
non_parenthesis:
- (non_par_non_escape | escapechar (escapechar | Character_String))
+ non_par_non_escape | (escapechar (escapechar | Character_String))
;
non_par_non_escape:
Character_String | NAME {bug_report_fun(context, "Warning: The file is breaking the ITU-T Z120 standard");}
-//('a'..'z' | 'A'..'Z' | '0'..'9'| '?' | '%' | '+' | '-' | '!' | '/' | '*' | '"' | '=' | '@' | '&' | '#' | '.' | '_' | '\'')+ { bug_report(context, "The file is breaking the Z120 standard");}
-
-
;
non_nestable_par:
@@ -171,7 +169,7 @@
add_z_fun(context, $my_z120);
}
}
- ((document_head | 'mscdocument' instance_kind end)? (message_sequence_chart)*)
+ (document_head)? (message_sequence_chart)*
{
check_references_fun(context);
$my_msc = get_total_msc_fun(context);
@@ -187,12 +185,12 @@
document_head:
'mscdocument' instance_kind ('related' 'to' sdl_reference)?
(inheritance)? end
- (parenthesis_declaration)?
+ ((parenthesis_declaration)?
data_definition
using_clause
containing_clause
message_decl_clause
- timer_decl_clause
+ timer_decl_clause)?
;
textual_defining_part:
@@ -389,8 +387,8 @@
{
set_event_name_fun(context, (char*) ($NAME.text->chars));
})?
- (message_event | incomplete_message_event |
- method_call_event | incomplete_method_call_event | create |
+ (message_event |
+// method_call_event | incomplete_method_call_event | create |
timer_statement | action)
('before' order_dest_list
{
@@ -465,17 +463,29 @@
;
message_output:
- 'out' msg_identification 'to' input_address
+ 'out' msg_identification 'to'
+ (input_address
{
message_fun(context, (char *)$msg_identification.text->chars, output);
}
+ | 'lost' (input_address)?
+ {
+ incomplete_message_fun(context, (char *) $msg_identification.text->chars, output);
+ }
+ )
;
message_input:
- 'in' msg_identification 'from' output_address
+ 'in' msg_identification 'from'
+ (output_address
{
message_fun(context, (char *)$msg_identification.text->chars, input);
}
+ | 'found' (output_address)?
+ {
+ incomplete_message_fun(context, (char *)$msg_identification.text->chars, input);
+ }
+ )
;
incomplete_message_event:
@@ -758,16 +768,13 @@
;
condition_text:
- condition_name_list | 'when' (condition_name_list | '(' expression ')') |
- 'otherwise'
+ name = condition_name_list { set_condition_name_fun(context, (char*) $name.text->chars); }
+ | 'when' (name = condition_name_list { set_condition_name_fun(context, (char*) $name.text->chars); } | '(' expression ')')
+ | 'otherwise'
;
condition_name_list:
- name = NAME
- {
- set_condition_name_fun(context, (char*) $name.text->chars);
- }
- (',' NAME)*
+ NAME (',' condition_name_list)?
;
shared:
@@ -791,7 +798,8 @@
starttimer:
'starttimer' NAME (',' NAME)?
- (duration)? ('(' parameter_list ')')?
+ (duration)?
+ ('(' parameter_list ')')?
;
duration:
@@ -885,7 +893,7 @@
;
equal_par:
- (unmatched_string equal_par)*
+ unmatched_string (equal_par)?
;
unmatched_string:
@@ -903,7 +911,7 @@
// ----- Declaring data
message_decl_list:
- message_decl (end message_decl_list)?
+ message_decl // (end message_decl_list)?
;
message_decl:
@@ -919,7 +927,8 @@
;
timer_decl:
- timer_name_list (duration)? (':' '(' type_ref_list ')')?
+ timer_name_list (duration)?
+ (':' '(' type_ref_list ')')?
;
timer_name_list:
@@ -999,12 +1008,13 @@
;
pattern:
- string | wildcard
+ //string | wildcard
+ NAME
;
-wildcard:
- string
-;
+//wildcard:
+// string
+//;
// ----- Data in message and timer paramerers
@@ -1014,7 +1024,7 @@
;
parameter_defn:
- binding | expression | pattern
+ binding | expression // | pattern
;
@@ -1487,7 +1497,7 @@
{
add_connect_name_fun(context, (char*) ($NAME.text->chars));
}
- ('alt' label_name_list)*
+ ('alt' label_name_list)?
;
node:
Modified: trunk/tests/z120_test/CMakeLists.txt
===================================================================
--- trunk/tests/z120_test/CMakeLists.txt 2009-09-14 20:06:35 UTC (rev 331)
+++ trunk/tests/z120_test/CMakeLists.txt 2009-09-15 14:13:20 UTC (rev 332)
@@ -70,8 +70,16 @@
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_test50.mpr 1)
ADD_Z120_TEST(z120_test51.mpr 1)
+ADD_Z120_TEST(z120_test52.mpr 1)
+ADD_Z120_TEST(z120_test53.mpr 1)
+ADD_Z120_TEST(z120_test54.mpr 1)
+ADD_Z120_TEST(z120_test55.mpr 1)
+ADD_Z120_TEST(z120_test56.mpr 1)
+ADD_Z120_TEST(z120_test57.mpr 0)
+ADD_Z120_TEST(z120_test58.mpr 1)
+ADD_Z120_TEST(z120_test59.mpr 1)
# $Id$
Added: trunk/tests/z120_test/z120_test50.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test50.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test50.mpr.result 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,18 @@
+z120_test50.mpr(8) : error 3 : 1377:1: node_definition : ( initial_node | final_node | intermediate_node );, at offset 4
+ near [Index: 28 (Start: 145601215-Stop: 145601218) ='NAME', type<11> Line: 8 LinePos:4]
+ : cannot match to any predicted input...
+Warning 08: There is reference to nonexisted node
+
+Warning 09: There is reference to nonexisted MSC
+
+OK: z120_test50 is correct, should be correct
+
+mscdocument z120_test50;
+msc Stranka1;
+initial connect L0;
+L0: connect L1;
+L1: reference NAME1 connect L2;
+L2: final;
+endmsc;
+msc NAME1;
+endmsc;
Modified: trunk/tests/z120_test/z120_test51.mpr
===================================================================
--- trunk/tests/z120_test/z120_test51.mpr 2009-09-14 20:06:35 UTC (rev 331)
+++ trunk/tests/z120_test/z120_test51.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -1,6 +1,6 @@
/*****************************************************
Simple test of bmsc (event driven notification)
-
+Complete message with one event
******************************************************/
mscdocument bbb;
Added: trunk/tests/z120_test/z120_test52.mpr
===================================================================
--- trunk/tests/z120_test/z120_test52.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test52.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,5 @@
+msc One;
+initial connect L0;
+L0: condition access,a connect L1;
+L1: final;
+endmsc;
Added: trunk/tests/z120_test/z120_test52.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test52.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test52.mpr.result 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,8 @@
+OK: z120_test52 is correct, should be correct
+
+mscdocument z120_test52;
+msc One;
+initial connect L0;
+L0: condition access,a connect L1;
+L1: final;
+endmsc;
Added: trunk/tests/z120_test/z120_test53.mpr
===================================================================
--- trunk/tests/z120_test/z120_test53.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test53.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,19 @@
+/***************************************************
+Example of bMSC with mesages with the same name.
+***************************************************/
+
+msc Stranka1;
+inst W
+inst Q;
+W: instance;
+out a to Q;
+out a to Q;
+out a to Q;
+endinstance;
+Q: instance;
+in a from W;
+in a from W;
+in a from W;
+endinstance;
+endmsc;
+
Added: trunk/tests/z120_test/z120_test53.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test53.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test53.mpr.result 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,20 @@
+z120_test53.mpr(7) : error 3 : , at offset 0
+ near [Index: 11 (Start: 163857081-Stop: 163857084) ='inst', type<39> Line: 7 LinePos:0]
+ : cannot match to any predicted input...
+OK: z120_test53 is correct, should be correct
+
+mscdocument z120_test53;
+msc Stranka1;
+inst W;
+inst Q;
+W: instance;
+out a,0 to Q;
+out a,1 to Q;
+out a,2 to Q;
+endinstance;
+Q: instance;
+in a,0 from W;
+in a,1 from W;
+in a,2 from W;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test54.mpr
===================================================================
--- trunk/tests/z120_test/z120_test54.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test54.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,20 @@
+/*****************************************************
+Simple test of bmsc (event driven notification)
+Instance A does not start
+
+******************************************************/
+
+mscdocument bbb;
+msc pok2;
+B: instance;
+A: in A,1 from found;
+A: out jedna,2 to B;
+B: in jedna,2 from A;
+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_test54.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test54.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test54.mpr.result 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,21 @@
+Warning 23: Instance (A) has not been started (e.g. A: instance;)
+
+OK: z120_test54 is correct, should be correct
+
+mscdocument z120_test54;
+msc pok2;
+inst B;
+inst A;
+B: instance;
+in jedna,0 from A;
+in B1,1 from A;
+endinstance;
+A: instance;
+in A,2 from found;
+out jedna,0 to B;
+concurrent;
+label e0; out B,3 to lost;
+label e1; out B1,1 to B;
+endconcurrent;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test55.mpr
===================================================================
--- trunk/tests/z120_test/z120_test55.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test55.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,21 @@
+/*****************************************************
+Simple test of bmsc (event driven notification)
+Instance A does not start
+
+******************************************************/
+
+mscdocument bbb;
+msc pok2;
+B: instance;
+A: in A,1 from B;
+B: out A,1 to A;
+A: out jedna,2 to B;
+B: in jedna,2 from A;
+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_test55.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test55.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test55.mpr.result 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,22 @@
+Warning 23: Instance (A) has not been started (e.g. A: instance;)
+
+OK: z120_test55 is correct, should be correct
+
+mscdocument z120_test55;
+msc pok2;
+inst B;
+inst A;
+B: instance;
+out A,0 to A;
+in jedna,1 from A;
+in B1,2 from A;
+endinstance;
+A: instance;
+in A,0 from B;
+out jedna,1 to B;
+concurrent;
+label e0; out B1,2 to B;
+label e1; out B,3 to lost;
+endconcurrent;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test56.mpr
===================================================================
--- trunk/tests/z120_test/z120_test56.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test56.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,19 @@
+mscdocument z120_test18;
+msc Strnka1;
+initial connect L0;
+L0: reference bmsc1 connect L1;
+L1: final;
+endmsc;
+
+msc bmsc1;
+inst A;
+inst B;
+in no,0 from B;
+out ok,1 to B;
+endinstance;
+B: instance;
+out no,0 to A;
+in ok,1 from A;
+endinstance;
+endmsc;
+
Added: trunk/tests/z120_test/z120_test56.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test56.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test56.mpr.result 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,26 @@
+z120_test56.mpr(11) : error 3 : ()+ loopback of 217:4: ( 'inst' instance_item )+, at offset 0
+ near [Index: 53 (Start: 159855249-Stop: 159855250) ='in', type<59> Line: 11 LinePos:0]
+ : cannot match to any predicted input...
+z120_test56.mpr(11) : error 3 : ()+ loopback of 217:4: ( 'inst' instance_item )+, at offset 0
+ near [Index: 53 (Start: 159855249-Stop: 159855250) ='in', type<59> Line: 11 LinePos:0]
+ : cannot match to any predicted input...
+z120_test56.mpr(11) : error 3 : 368:1: event_definition : ( NAME ':' instance_event_list | instance_name_list ':' multi_instance_event_list );, at offset 14
+ near [Index: 62 (Start: 159855263-Stop: 159855263) =';', type<26> Line: 11 LinePos:14]
+ : cannot match to any predicted input...
+Warning 05: There is complete message with only one event
+
+OK: z120_test56 is correct, should be correct
+
+mscdocument z120_test56;
+msc Strnka1;
+initial connect L0;
+L0: reference bmsc1 connect L1;
+L1: final;
+endmsc;
+msc bmsc1;
+inst B;
+B: instance;
+out no,0 to lost;
+in ok,1 from found;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test57.mpr
===================================================================
--- trunk/tests/z120_test/z120_test57.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test57.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,34 @@
+/***********************************************
+Example of bMSC
+
+Missing:
+ line 5: colon (client: instance;)
+ line 8: semi-colon (label e1; in know,1 from server;)
+ line 20: semi-colon (endconcurrent;)
+***********************************************/
+
+mscdocument Vkres2;
+msc Strnka1;
+inst client;
+inst server;
+client instance;
+concurrent;
+label e0; out no,0 to server;
+label e1 in know,1 from server;
+endconcurrent;
+out yes,2 to lost;
+concurrent;
+label e2; in tric,3 from server;
+endconcurrent;
+in tric,4 from found;
+endinstance;
+server: instance;
+in no,0 from client;
+concurrent;
+label e3; out know,1 to client;
+endconcurrent
+concurrent;
+label e4; out tric,3 to client;
+endconcurrent;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test58.mpr
===================================================================
--- trunk/tests/z120_test/z120_test58.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test58.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,33 @@
+/***********************************************
+Example of bMSC
+
+Missing:
+ line 8: semi-colon (label e1; in know,1 from server;)
+ line 20: semi-colon (endconcurrent;)
+***********************************************/
+
+mscdocument Vkres2;
+msc Strnka1;
+inst client;
+inst server;
+client: instance;
+concurrent;
+label e0; out no,0 to server;
+label e1 in know,1 from server;
+endconcurrent;
+out yes,2 to lost;
+concurrent;
+label e2; in tric,3 from server;
+endconcurrent;
+in tric,4 from found;
+endinstance;
+server: instance;
+in no,0 from client;
+concurrent;
+label e3; out know,1 to client;
+endconcurrent
+concurrent;
+label e4; out tric,3 to client;
+endconcurrent;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test58.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test58.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test58.mpr.result 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,33 @@
+z120_test58.mpr(16) : error 10 : Missing token, at offset 9
+ near [Index: 0 (Start: 0-Stop: 0) ='<missing ';'>', type<26> Line: 16 LinePos:9]
+ : Missing ';'
+z120_test58.mpr(16) : error 9 : Extraneous token, at offset 9
+ near [Index: 0 (Start: 0-Stop: 0) ='<missing ';'>', type<26> Line: 16 LinePos:9]
+ : Extraneous input - expected ';' ...
+Warning 11: Instance server does not have open any coregion
+
+OK: z120_test58 is correct, should be correct
+
+mscdocument z120_test58;
+msc Strnka1;
+inst client;
+inst server;
+client: instance;
+concurrent;
+label e0; out no,0 to server;
+label e1; in know,1 from server;
+endconcurrent;
+out yes,2 to lost;
+concurrent;
+label e2; in tric,3 from server;
+endconcurrent;
+in tric,4 from found;
+endinstance;
+server: instance;
+in no,0 from client;
+concurrent;
+label e3; out know,1 to client;
+endconcurrent;
+out tric,3 to client;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test59.mpr
===================================================================
--- trunk/tests/z120_test/z120_test59.mpr (rev 0)
+++ trunk/tests/z120_test/z120_test59.mpr 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,32 @@
+/***********************************************
+Example of bMSC
+
+Missing:
+ line 20: semi-colon (endconcurrent;)
+***********************************************/
+
+mscdocument Vkres2;
+msc Strnka1;
+inst client;
+inst server;
+client: instance;
+concurrent;
+label e0; out no,0 to server;
+label e1; in know,1 from server;
+endconcurrent;
+out yes,2 to lost;
+concurrent;
+label e2; in tric,3 from server;
+endconcurrent;
+in tric,4 from found;
+endinstance;
+server: instance;
+in no,0 from client;
+concurrent;
+label e3; out know,1 to client;
+endconcurrent
+concurrent;
+label e4; out tric,3 to client;
+endconcurrent;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_test59.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test59.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_test59.mpr.result 2009-09-15 14:13:20 UTC (rev 332)
@@ -0,0 +1,30 @@
+z120_test59.mpr(28) : error 9 : Extraneous token, at offset 0
+ near [Index: 151 (Start: 140641322-Stop: 140641331) ='concurrent', type<102> Line: 28 LinePos:0]
+ : Extraneous input - expected ';' ...
+Warning 11: Instance server does not have open any coregion
+
+OK: z120_test59 is correct, should be correct
+
+mscdocument z120_test59;
+msc Strnka1;
+inst client;
+inst server;
+client: instance;
+concurrent;
+label e0; out no,0 to server;
+label e1; in know,1 from server;
+endconcurrent;
+out yes,2 to lost;
+concurrent;
+label e2; in tric,3 from server;
+endconcurrent;
+in tric,4 from found;
+endinstance;
+server: instance;
+in no,0 from client;
+concurrent;
+label e3; out know,1 to client;
+endconcurrent;
+out tric,3 to client;
+endinstance;
+endmsc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <got...@us...> - 2009-09-17 11:54:54
|
Revision: 333
http://scstudio.svn.sourceforge.net/scstudio/?rev=333&view=rev
Author: gotthardp
Date: 2009-09-17 11:54:35 +0000 (Thu, 17 Sep 2009)
Log Message:
-----------
CMake enhancements to fix the recent gcc and valgrind error/warnings.
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/FindANTLR.cmake
trunk/FindPCAP.cmake
trunk/doc/CMakeLists.txt
trunk/src/check/race/race_checker.cpp
Added Paths:
-----------
trunk/valgrind-python.supp
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2009-09-15 14:13:20 UTC (rev 332)
+++ trunk/CMakeLists.txt 2009-09-17 11:54:35 UTC (rev 333)
@@ -7,7 +7,11 @@
PROJECT(scstudio C CXX)
#SET(CMAKE_VERBOSE_MAKEFILE ON)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes")
+SET(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/valgrind-python.supp"
+ CACHE FILEPATH "File that contains suppressions for the memory checker")
INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/share/scripts)
@@ -21,7 +25,7 @@
# Enforce strict ANSI C/C++ compliancy checking
IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -ansi -Wall -Woverloaded-virtual -Wno-unused-function")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -ansi -Wall -Wno-long-long")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
FIND_PACKAGE(Boost REQUIRED)
Modified: trunk/FindANTLR.cmake
===================================================================
--- trunk/FindANTLR.cmake 2009-09-15 14:13:20 UTC (rev 332)
+++ trunk/FindANTLR.cmake 2009-09-17 11:54:35 UTC (rev 333)
@@ -7,25 +7,20 @@
NAMES antlr-3.1.1.jar
PATHS
${ANTLR_ROOT}/lib
- DOC "The ANTLR Class File")
+ DOC "The ANTLR class file")
FIND_LIBRARY(ANTLR_LIBRARY
NAMES antlr3c
PATHS
${ANTLR_ROOT}/runtime/C
- DOC "The ANTLR Library")
+ DOC "The ANTLR library")
FIND_PATH(ANTLR_INCLUDE_DIR
NAMES antlr3.h
PATHS
${ANTLR_ROOT}/runtime/C/include
- DOC "The ANTLR Include Files")
+ DOC "The ANTLR include files")
-IF (ANTLR_CLASSPATH AND ANTLR_LIBRARY AND ANTLR_INCLUDE_DIR)
- SET(ANTLR_FOUND TRUE)
-ELSE (ANTLR_CLASSPATH AND ANTLR_LIBRARY AND ANTLR_INCLUDE_DIR)
- SET(ANTLR_FOUND FALSE)
- IF (ANTLR_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "ANTLR not found! Set ANTLR_ROOT to the antlr-3.1.1 directory.")
- ENDIF (ANTLR_FIND_REQUIRED)
-ENDIF (ANTLR_CLASSPATH AND ANTLR_LIBRARY AND ANTLR_INCLUDE_DIR)
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ANTLR DEFAULT_MSG
+ ANTLR_CLASSPATH ANTLR_LIBRARY ANTLR_INCLUDE_DIR)
Modified: trunk/FindPCAP.cmake
===================================================================
--- trunk/FindPCAP.cmake 2009-09-15 14:13:20 UTC (rev 332)
+++ trunk/FindPCAP.cmake 2009-09-17 11:54:35 UTC (rev 333)
@@ -7,19 +7,14 @@
NAMES wpcap
PATHS
${PCAP_ROOT}/Lib
- DOC "The PCAP Library")
+ DOC "The PCAP library")
FIND_PATH(PCAP_INCLUDE_DIR
NAMES pcap.h
PATHS
${PCAP_ROOT}/Include
- DOC "The PCAP Include Files")
+ DOC "The PCAP include files")
-IF (PCAP_LIBRARY AND PCAP_INCLUDE_DIR)
- SET(PCAP_FOUND TRUE)
-ELSE (PCAP_LIBRARY AND PCAP_INCLUDE_DIR)
- SET(PCAP_FOUND FALSE)
- IF (PCAP_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "PCAP not found! Set PCAP_ROOT to the PCAP-3.1.1 directory.")
- ENDIF (PCAP_FIND_REQUIRED)
-ENDIF (PCAP_LIBRARY AND PCAP_INCLUDE_DIR)
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCAP DEFAULT_MSG
+ PCAP_LIBRARY PCAP_INCLUDE_DIR)
Modified: trunk/doc/CMakeLists.txt
===================================================================
--- trunk/doc/CMakeLists.txt 2009-09-15 14:13:20 UTC (rev 332)
+++ trunk/doc/CMakeLists.txt 2009-09-17 11:54:35 UTC (rev 333)
@@ -7,14 +7,14 @@
# latex needs to be executed twice in order to generate references correctly
ADD_CUSTOM_COMMAND(
OUTPUT ${FILE}.aux
- COMMAND ${PDFLATEX_COMPILER} ${FILE}.tex
+ COMMAND ${PDFLATEX_COMPILER} --interaction batchmode ${FILE}.tex
DEPENDS ${FILE}.tex
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating ${FILE}.pdf (first pass)"
)
ADD_CUSTOM_COMMAND(
OUTPUT ${FILE}.pdf
- COMMAND ${PDFLATEX_COMPILER} ${FILE}.tex
+ COMMAND ${PDFLATEX_COMPILER} --interaction batchmode ${FILE}.tex
DEPENDS ${FILE}.tex ${FILE}.aux
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating ${FILE}.pdf (second pass)"
Modified: trunk/src/check/race/race_checker.cpp
===================================================================
--- trunk/src/check/race/race_checker.cpp 2009-09-15 14:13:20 UTC (rev 332)
+++ trunk/src/check/race/race_checker.cpp 2009-09-17 11:54:35 UTC (rev 333)
@@ -72,7 +72,6 @@
{
if(e1!=e2)
{
- Event* e = *e2;
BoolVector& e2_causal = m_caus_initiator->get_causal_closure(*e2);
size_t e1_index = m_vis_initiator->get_topology_index(*e1);
//e2<<e1 => e1 isn't minimal
Added: trunk/valgrind-python.supp
===================================================================
--- trunk/valgrind-python.supp (rev 0)
+++ trunk/valgrind-python.supp 2009-09-17 11:54:35 UTC (rev 333)
@@ -0,0 +1,349 @@
+#
+# This is a valgrind suppression file that should be used when using valgrind.
+#
+# Here's an example of running valgrind:
+#
+# cd python/dist/src
+# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
+# ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network
+#
+# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER
+# to use the preferred suppressions with Py_ADDRESS_IN_RANGE.
+#
+# If you do not want to recompile Python, you can uncomment
+# suppressions for PyObject_Free and PyObject_Realloc.
+#
+# See Misc/README.valgrind for more information.
+
+# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif
+{
+ ADDRESS_IN_RANGE/Invalid read of size 4
+ Memcheck:Addr4
+ fun:Py_ADDRESS_IN_RANGE
+}
+
+{
+ ADDRESS_IN_RANGE/Invalid read of size 4
+ Memcheck:Value4
+ fun:Py_ADDRESS_IN_RANGE
+}
+
+{
+ ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)
+ Memcheck:Value8
+ fun:Py_ADDRESS_IN_RANGE
+}
+
+{
+ ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
+ Memcheck:Cond
+ fun:Py_ADDRESS_IN_RANGE
+}
+
+#
+# Leaks (including possible leaks)
+# Hmmm, I wonder if this masks some real leaks. I think it does.
+# Will need to fix that.
+#
+
+{
+ Handle PyMalloc confusing valgrind (possibly leaked)
+ Memcheck:Leak
+ fun:realloc
+ fun:_PyObject_GC_Resize
+ fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
+}
+
+{
+ Handle PyMalloc confusing valgrind (possibly leaked)
+ Memcheck:Leak
+ fun:malloc
+ fun:_PyObject_GC_New
+ fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
+}
+
+{
+ Handle PyMalloc confusing valgrind (possibly leaked)
+ Memcheck:Leak
+ fun:malloc
+ fun:_PyObject_GC_NewVar
+ fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
+}
+
+#
+# Non-python specific leaks
+#
+
+{
+ Handle pthread issue (possibly leaked)
+ Memcheck:Leak
+ fun:calloc
+ fun:allocate_dtv
+ fun:_dl_allocate_tls_storage
+ fun:_dl_allocate_tls
+}
+
+{
+ Handle pthread issue (possibly leaked)
+ Memcheck:Leak
+ fun:memalign
+ fun:_dl_allocate_tls_storage
+ fun:_dl_allocate_tls
+}
+
+{
+ ADDRESS_IN_RANGE/Invalid read of size 4
+ Memcheck:Addr4
+ fun:PyObject_Free
+}
+
+{
+ ADDRESS_IN_RANGE/Invalid read of size 4
+ Memcheck:Value4
+ fun:PyObject_Free
+}
+
+{
+ ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
+ Memcheck:Cond
+ fun:PyObject_Free
+}
+
+{
+ ADDRESS_IN_RANGE/Invalid read of size 4
+ Memcheck:Addr4
+ fun:PyObject_Realloc
+}
+
+{
+ ADDRESS_IN_RANGE/Invalid read of size 4
+ Memcheck:Value4
+ fun:PyObject_Realloc
+}
+
+{
+ ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
+ Memcheck:Cond
+ fun:PyObject_Realloc
+}
+
+###
+### All the suppressions below are for errors that occur within libraries
+### that Python uses. The problems to not appear to be related to Python's
+### use of the libraries.
+###
+
+{
+ Generic gentoo ld problems
+ Memcheck:Cond
+ obj:/lib/ld-2.3.4.so
+ obj:/lib/ld-2.3.4.so
+ obj:/lib/ld-2.3.4.so
+ obj:/lib/ld-2.3.4.so
+}
+
+{
+ DBM problems, see test_dbm
+ Memcheck:Param
+ write(buf)
+ fun:write
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ fun:dbm_close
+}
+
+{
+ DBM problems, see test_dbm
+ Memcheck:Value8
+ fun:memmove
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ fun:dbm_store
+ fun:dbm_ass_sub
+}
+
+{
+ DBM problems, see test_dbm
+ Memcheck:Cond
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ fun:dbm_store
+ fun:dbm_ass_sub
+}
+
+{
+ DBM problems, see test_dbm
+ Memcheck:Cond
+ fun:memmove
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ obj:/usr/lib/libdb1.so.2
+ fun:dbm_store
+ fun:dbm_ass_sub
+}
+
+{
+ GDBM problems, see test_gdbm
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:gdbm_open
+
+}
+
+{
+ ZLIB problems, see test_gzip
+ Memcheck:Cond
+ obj:/lib/libz.so.1.2.3
+ obj:/lib/libz.so.1.2.3
+ fun:deflate
+}
+
+{
+ Avoid problems w/readline doing a putenv and leaking on exit
+ Memcheck:Leak
+ fun:malloc
+ fun:xmalloc
+ fun:sh_set_lines_and_columns
+ fun:_rl_get_screen_size
+ fun:_rl_init_terminal_io
+ obj:/lib/libreadline.so.4.3
+ fun:rl_initialize
+}
+
+###
+### These occur from somewhere within the SSL, when running
+### test_socket_sll. They are too general to leave on by default.
+###
+###{
+### somewhere in SSL stuff
+### Memcheck:Cond
+### fun:memset
+###}
+###{
+### somewhere in SSL stuff
+### Memcheck:Value4
+### fun:memset
+###}
+###
+###{
+### somewhere in SSL stuff
+### Memcheck:Cond
+### fun:MD5_Update
+###}
+###
+###{
+### somewhere in SSL stuff
+### Memcheck:Value4
+### fun:MD5_Update
+###}
+
+#
+# All of these problems come from using test_socket_ssl
+#
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ fun:BN_bin2bn
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ fun:BN_num_bits_word
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Value4
+ fun:BN_num_bits_word
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ fun:BN_mod_exp_mont_word
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ fun:BN_mod_exp_mont
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Param
+ write(buf)
+ fun:write
+ obj:/usr/lib/libcrypto.so.0.9.7
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ fun:RSA_verify
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Value4
+ fun:RSA_verify
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Value4
+ fun:DES_set_key_unchecked
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Value4
+ fun:DES_encrypt2
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ obj:/usr/lib/libssl.so.0.9.7
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Value4
+ obj:/usr/lib/libssl.so.0.9.7
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ fun:BUF_MEM_grow_clean
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ fun:memcpy
+ fun:ssl3_read_bytes
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Cond
+ fun:SHA1_Update
+}
+
+{
+ from test_socket_ssl
+ Memcheck:Value4
+ fun:SHA1_Update
+}
+
+
Property changes on: trunk/valgrind-python.supp
___________________________________________________________________
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <got...@us...> - 2009-09-17 12:35:32
|
Revision: 334
http://scstudio.svn.sourceforge.net/scstudio/?rev=334&view=rev
Author: gotthardp
Date: 2009-09-17 12:35:23 +0000 (Thu, 17 Sep 2009)
Log Message:
-----------
Fix Python error suppression for x64 platforms.
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/valgrind-python.supp
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2009-09-17 11:54:35 UTC (rev 333)
+++ trunk/CMakeLists.txt 2009-09-17 12:35:23 UTC (rev 334)
@@ -9,7 +9,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes")
+SET(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes" --leak-check=full")
SET(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/valgrind-python.supp"
CACHE FILEPATH "File that contains suppressions for the memory checker")
INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
Modified: trunk/valgrind-python.supp
===================================================================
--- trunk/valgrind-python.supp 2009-09-17 11:54:35 UTC (rev 333)
+++ trunk/valgrind-python.supp 2009-09-17 12:35:23 UTC (rev 334)
@@ -51,15 +51,20 @@
Memcheck:Leak
fun:realloc
fun:_PyObject_GC_Resize
- fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
{
Handle PyMalloc confusing valgrind (possibly leaked)
Memcheck:Leak
fun:malloc
+ fun:_PyObject_GC_Malloc
+}
+
+{
+ Handle PyMalloc confusing valgrind (possibly leaked)
+ Memcheck:Leak
+ fun:malloc
fun:_PyObject_GC_New
- fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
{
@@ -67,7 +72,6 @@
Memcheck:Leak
fun:malloc
fun:_PyObject_GC_NewVar
- fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
#
@@ -104,6 +108,12 @@
}
{
+ ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)
+ Memcheck:Value8
+ fun:PyObject_Free
+}
+
+{
ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
Memcheck:Cond
fun:PyObject_Free
@@ -122,6 +132,12 @@
}
{
+ ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)
+ Memcheck:Value8
+ fun:PyObject_Realloc
+}
+
+{
ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
Memcheck:Cond
fun:PyObject_Realloc
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <got...@us...> - 2009-09-19 12:18:23
|
Revision: 342
http://scstudio.svn.sourceforge.net/scstudio/?rev=342&view=rev
Author: gotthardp
Date: 2009-09-19 12:18:13 +0000 (Sat, 19 Sep 2009)
Log Message:
-----------
Z120 export has been changed: unused MSC labels are no longer printed. Update the Z120 tests accordingly.
Modified Paths:
--------------
trunk/src/data/Z120/z120_save.cpp
trunk/tests/z120_test/z120_test00.mpr.result
trunk/tests/z120_test/z120_test03.mpr.result
trunk/tests/z120_test/z120_test08.mpr
trunk/tests/z120_test/z120_test08.mpr.result
trunk/tests/z120_test/z120_test11.mpr
trunk/tests/z120_test/z120_test11.mpr.result
trunk/tests/z120_test/z120_test12.mpr
trunk/tests/z120_test/z120_test12.mpr.result
trunk/tests/z120_test/z120_test13.mpr.result
trunk/tests/z120_test/z120_test14.mpr.result
trunk/tests/z120_test/z120_test15.mpr.result
trunk/tests/z120_test/z120_test32.mpr.result
trunk/tests/z120_test/z120_test33.mpr.result
trunk/tests/z120_test/z120_test34.mpr.result
trunk/tests/z120_test/z120_test35.mpr.result
trunk/tests/z120_test/z120_test45.mpr.result
trunk/tests/z120_test/z120_test47.mpr.result
trunk/tests/z120_test/z120_test51.mpr.result
trunk/tests/z120_test/z120_test54.mpr.result
trunk/tests/z120_test/z120_test55.mpr.result
trunk/tests/z120_test/z120_test58.mpr.result
trunk/tests/z120_test/z120_test59.mpr.result
Modified: trunk/src/data/Z120/z120_save.cpp
===================================================================
--- trunk/src/data/Z120/z120_save.cpp 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/src/data/Z120/z120_save.cpp 2009-09-19 12:18:13 UTC (rev 342)
@@ -284,7 +284,7 @@
// check if the label needs to be printed
// - label is required for time constrained events
if(!event->get_time_relations().empty())
- stream << "label e" << event_id_map.get_id(event) << "; " << std::endl;
+ stream << "label e" << event_id_map.get_id(event) << ";" << std::endl;
print_event(stream, message_id_map, event);
stream << ";" << std::endl;
@@ -314,7 +314,7 @@
// - label is required for referenced coregion events
// - label is required for time constrained events
if(!(*epos)->get_predecessors().empty() || !(*epos)->get_time_relations().empty())
- stream << "label e" << event_id_map.get_id(*epos) << "; " << std::endl;
+ stream << "label e" << event_id_map.get_id(*epos) << ";" << std::endl;
print_event(stream, message_id_map, *epos);
Modified: trunk/tests/z120_test/z120_test00.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test00.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test00.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -8,8 +8,8 @@
in A,0 from found;
out jedna,1 to B;
concurrent;
-label e0; out B1,2 to B;
-label e1; out B,3 to lost;
+out B1,2 to B;
+out B,3 to lost;
endconcurrent;
in jedna,4 from B;
endinstance;
Modified: trunk/tests/z120_test/z120_test03.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test03.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test03.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -8,8 +8,8 @@
in A,0 from found;
out jedna,1 to B;
concurrent;
-label e0; out B1,2 to B;
-label e1; out B,3 to lost;
+out B1,2 to B;
+out B,3 to lost;
endconcurrent;
endinstance;
B: instance;
Modified: trunk/tests/z120_test/z120_test08.mpr
===================================================================
--- trunk/tests/z120_test/z120_test08.mpr 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test08.mpr 2009-09-19 12:18:13 UTC (rev 342)
@@ -7,8 +7,9 @@
inst NAME2;
NAME1: instance;
concurrent;
-label e1; out b,1 to NAME2 before e0;
-label e0; in a,0 from NAME2;
+out b,1 to NAME2 before e0;
+label e0;
+in a,0 from NAME2;
endconcurrent;
endinstance;
NAME2: instance;
Modified: trunk/tests/z120_test/z120_test08.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test08.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test08.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -6,8 +6,9 @@
inst NAME2;
NAME1: instance;
concurrent;
-label e0; out b,0 to NAME2 before e1;
-label e1; in a,1 from NAME2;
+out b,0 to NAME2 before e0;
+label e0;
+in a,1 from NAME2;
endconcurrent;
endinstance;
NAME2: instance;
Modified: trunk/tests/z120_test/z120_test11.mpr
===================================================================
--- trunk/tests/z120_test/z120_test11.mpr 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test11.mpr 2009-09-19 12:18:13 UTC (rev 342)
@@ -19,9 +19,10 @@
out SYNACK,1 to PC;
in ACK,2 from PC;
concurrent;
-label e0; in request_a,3 from PC before e1;
-label e2; in request_b,4 from PC;
-label e1; out result,5 to PC;
+in request_a,3 from PC before e0;
+in request_b,4 from PC;
+label e0;
+out result,5 to PC;
endconcurrent;
endinstance;
endmsc;
Modified: trunk/tests/z120_test/z120_test11.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test11.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test11.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -17,9 +17,10 @@
out SYNACK,1 to PC;
in ACK,2 from PC;
concurrent;
-label e0; in request_a,3 from PC before e1;
-label e2; in request_b,4 from PC;
-label e1; out result,5 to PC;
+in request_a,3 from PC before e0;
+in request_b,4 from PC;
+label e0;
+out result,5 to PC;
endconcurrent;
endinstance;
endmsc;
Modified: trunk/tests/z120_test/z120_test12.mpr
===================================================================
--- trunk/tests/z120_test/z120_test12.mpr 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test12.mpr 2009-09-19 12:18:13 UTC (rev 342)
@@ -8,26 +8,26 @@
inst B;
A: instance;
concurrent;
-label e0; out ano,0 to B;
-label e1; out ano,1 to B;
-label e2; in nie,2 from B;
+out ano,0 to B;
+out ano,1 to B;
+in nie,2 from B;
endconcurrent;
concurrent;
-label e3; out micron,3 to B;
-label e4; out rad,4 to lost;
+out micron,3 to B;
+out rad,4 to lost;
endconcurrent;
in dan,5 from B;
in track,6 from B;
endinstance;
B: instance;
concurrent;
-label e5; in ano,1 from A;
-label e6; out nie,2 to A;
-label e7; in ano,0 from A;
+in ano,1 from A;
+out nie,2 to A;
+in ano,0 from A;
endconcurrent;
in micron,3 from A;
concurrent;
-label e8; out dan,5 to A;
+out dan,5 to A;
endconcurrent;
out track,6 to A;
in rad,7 from found;
Modified: trunk/tests/z120_test/z120_test12.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test12.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test12.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -6,26 +6,26 @@
inst B;
A: instance;
concurrent;
-label e0; out ano,0 to B;
-label e1; out ano,1 to B;
-label e2; in nie,2 from B;
+out ano,0 to B;
+out ano,1 to B;
+in nie,2 from B;
endconcurrent;
concurrent;
-label e3; out micron,3 to B;
-label e4; out rad,4 to lost;
+out micron,3 to B;
+out rad,4 to lost;
endconcurrent;
in dan,5 from B;
in track,6 from B;
endinstance;
B: instance;
concurrent;
-label e5; in ano,1 from A;
-label e6; out nie,2 to A;
-label e7; in ano,0 from A;
+in ano,1 from A;
+out nie,2 to A;
+in ano,0 from A;
endconcurrent;
in micron,3 from A;
concurrent;
-label e8; out dan,5 to A;
+out dan,5 to A;
endconcurrent;
out track,6 to A;
in rad,7 from found;
Modified: trunk/tests/z120_test/z120_test13.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test13.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test13.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -17,9 +17,10 @@
out SYNACK,1 to PC;
in ACK,2 from PC;
concurrent;
-label e0; out result,5 to PC before e1;
-label e2; in request_b,4 from PC;
-label e1; in request_a,3 from PC;
+out result,5 to PC before e0;
+in request_b,4 from PC;
+label e0;
+in request_a,3 from PC;
endconcurrent;
endinstance;
endmsc;
Modified: trunk/tests/z120_test/z120_test14.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test14.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test14.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -6,23 +6,23 @@
inst B;
A: instance;
concurrent;
-label e0; out ano,0 to B;
-label e1; in nie,1 from B;
+out ano,0 to B;
+in nie,1 from B;
endconcurrent;
concurrent;
-label e2; out micron,2 to B;
+out micron,2 to B;
endconcurrent;
in dan,3 from B;
in track,4 from B;
endinstance;
B: instance;
concurrent;
-label e3; out nie,1 to A;
-label e4; in ano,0 from A;
+out nie,1 to A;
+in ano,0 from A;
endconcurrent;
in micron,2 from A;
concurrent;
-label e5; out dan,3 to A;
+out dan,3 to A;
endconcurrent;
out track,4 to A;
in rad,5 from found;
Modified: trunk/tests/z120_test/z120_test15.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test15.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test15.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -6,22 +6,22 @@
inst server;
client: instance;
concurrent;
-label e0; out no,0 to server;
-label e1; in know,1 from server;
+out no,0 to server;
+in know,1 from server;
endconcurrent;
out yes,2 to lost;
concurrent;
-label e2; in tric,3 from server;
+in tric,3 from server;
endconcurrent;
in tric,4 from found;
endinstance;
server: instance;
in no,0 from client;
concurrent;
-label e3; out know,1 to client;
+out know,1 to client;
endconcurrent;
concurrent;
-label e4; out tric,3 to client;
+out tric,3 to client;
endconcurrent;
endinstance;
endmsc;
Modified: trunk/tests/z120_test/z120_test32.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test32.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test32.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -8,8 +8,9 @@
inst NAME2;
NAME1: instance;
concurrent;
-label e0; out b,0 to NAME2 before e1;
-label e1; in a,1 from NAME2;
+out b,0 to NAME2 before e0;
+label e0;
+in a,1 from NAME2;
endconcurrent;
endinstance;
NAME2: instance;
Modified: trunk/tests/z120_test/z120_test33.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test33.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test33.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -8,8 +8,9 @@
inst NAME2;
NAME1: instance;
concurrent;
-label e0; out b,0 to NAME2 before e1;
-label e1; in a,1 from NAME2;
+out b,0 to NAME2 before e0;
+label e0;
+in a,1 from NAME2;
endconcurrent;
endinstance;
NAME2: instance;
Modified: trunk/tests/z120_test/z120_test34.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test34.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test34.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -8,8 +8,9 @@
inst NAME2;
NAME1: instance;
concurrent;
-label e0; out b,0 to NAME2 before e1;
-label e1; in a,1 from NAME2;
+out b,0 to NAME2 before e0;
+label e0;
+in a,1 from NAME2;
endconcurrent;
endinstance;
NAME2: instance;
Modified: trunk/tests/z120_test/z120_test35.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test35.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test35.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -8,8 +8,9 @@
inst NAME2;
NAME1: instance;
concurrent;
-label e0; out b,0 to NAME2 before e1;
-label e1; in a,1 from NAME2;
+out b,0 to NAME2 before e0;
+label e0;
+in a,1 from NAME2;
endconcurrent;
endinstance;
NAME2: instance;
Modified: trunk/tests/z120_test/z120_test45.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test45.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test45.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -9,8 +9,8 @@
A: instance;
in A,0 from found;
concurrent;
-label e0; out B1,1 to B;
-label e1; out B,2 to lost;
+out B1,1 to B;
+out B,2 to lost;
endconcurrent;
endinstance;
B: instance;
Modified: trunk/tests/z120_test/z120_test47.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test47.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test47.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -8,8 +8,8 @@
in A,0 from found;
out jedna,1 to B;
concurrent;
-label e0; out B1,2 to B;
-label e1; out B,3 to lost;
+out B1,2 to B;
+out B,3 to lost;
endconcurrent;
endinstance;
B: instance;
Modified: trunk/tests/z120_test/z120_test51.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test51.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test51.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -10,8 +10,8 @@
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;
+out B1,2 to B;
+out B,3 to lost;
endconcurrent;
endinstance;
B: instance;
Modified: trunk/tests/z120_test/z120_test54.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test54.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test54.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -14,8 +14,8 @@
in A,2 from found;
out jedna,0 to B;
concurrent;
-label e0; out B,3 to lost;
-label e1; out B1,1 to B;
+out B,3 to lost;
+out B1,1 to B;
endconcurrent;
endinstance;
endmsc;
Modified: trunk/tests/z120_test/z120_test55.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test55.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test55.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -15,8 +15,8 @@
in A,0 from B;
out jedna,1 to B;
concurrent;
-label e0; out B1,2 to B;
-label e1; out B,3 to lost;
+out B1,2 to B;
+out B,3 to lost;
endconcurrent;
endinstance;
endmsc;
Modified: trunk/tests/z120_test/z120_test58.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test58.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test58.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -14,19 +14,19 @@
inst server;
client: instance;
concurrent;
-label e0; out no,0 to server;
-label e1; in know,1 from server;
+out no,0 to server;
+in know,1 from server;
endconcurrent;
out yes,2 to lost;
concurrent;
-label e2; in tric,3 from server;
+in tric,3 from server;
endconcurrent;
in tric,4 from found;
endinstance;
server: instance;
in no,0 from client;
concurrent;
-label e3; out know,1 to client;
+out know,1 to client;
endconcurrent;
out tric,3 to client;
endinstance;
Modified: trunk/tests/z120_test/z120_test59.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test59.mpr.result 2009-09-19 10:29:05 UTC (rev 341)
+++ trunk/tests/z120_test/z120_test59.mpr.result 2009-09-19 12:18:13 UTC (rev 342)
@@ -11,19 +11,19 @@
inst server;
client: instance;
concurrent;
-label e0; out no,0 to server;
-label e1; in know,1 from server;
+out no,0 to server;
+in know,1 from server;
endconcurrent;
out yes,2 to lost;
concurrent;
-label e2; in tric,3 from server;
+in tric,3 from server;
endconcurrent;
in tric,4 from found;
endinstance;
server: instance;
in no,0 from client;
concurrent;
-label e3; out know,1 to client;
+out know,1 to client;
endconcurrent;
out tric,3 to client;
endinstance;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|