1 // Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef _RUNTIMETEST_HXX_
20 #define _RUNTIMETEST_HXX_
22 #include "RuntimeSALOME.hxx"
23 #include "TypeCode.hxx"
26 #include <cppunit/extensions/HelperMacros.h>
28 #define CPPUNIT_TEST_SUITE(x)
29 #define CPPUNIT_TEST(x)
30 #define CPPUNIT_TEST_SUITE_END(x)
31 #define CPPUNIT_ASSERT(x) std::cerr << #x << " : " << (x) << std::endl
32 #define CPPUNIT_ASSERT_EQUAL(x,y) std::cerr << "Test " << #x << " == " << #y << " : " << ((x) == (y)) << std::endl;
33 #define CPPUNIT_ASSERT_DOUBLES_EQUAL(x,y,z)
34 #define CPPUNIT_ASSERT_THROW(x,y) \
36 catch (y &e) { cerr << e.what() << endl; }
46 : public CppUnit::TestFixture
49 CPPUNIT_TEST_SUITE( RuntimeTest );
50 CPPUNIT_TEST(initRuntimeTypeCode );
51 CPPUNIT_TEST(createPythonNodes );
52 CPPUNIT_TEST(createCORBANodes );
53 CPPUNIT_TEST(createBloc );
54 CPPUNIT_TEST(createRecursiveBlocs );
55 CPPUNIT_TEST(createDataLinks );
56 CPPUNIT_TEST(createPythonNodesWithScript );
57 CPPUNIT_TEST(createCORBANodesWithMethod );
58 CPPUNIT_TEST(createXMLNodes );
59 CPPUNIT_TEST(createBloc2 );
60 CPPUNIT_TEST(createDataLinksPythonPython );
61 CPPUNIT_TEST(createDataLinksPythonCORBA );
62 CPPUNIT_TEST(createDataLinksCORBACORBA );
63 CPPUNIT_TEST(createDataLinksCORBAPython );
64 CPPUNIT_TEST(createDataLinksXML );
65 CPPUNIT_TEST(manualInitInputPort );
66 CPPUNIT_TEST(manualExecuteNoThread );
67 CPPUNIT_TEST(manualGetOutputs );
68 CPPUNIT_TEST(createCppNodes );
69 CPPUNIT_TEST(convertPorts );
70 CPPUNIT_TEST(executeCppNode );
71 CPPUNIT_TEST(createGraphWithCppNodes );
72 CPPUNIT_TEST_SUITE_END();
79 void initRuntimeTypeCode();
80 void createPythonNodes();
81 void createCORBANodes();
83 void createRecursiveBlocs();
84 void createDataLinks();
85 void createPythonNodesWithScript();
86 void createCORBANodesWithMethod();
87 void createXMLNodes();
89 void createDataLinksPythonPython();
90 void createDataLinksPythonCORBA();
91 void createDataLinksCORBACORBA();
92 void createDataLinksCORBAPython();
93 void createDataLinksXML();
94 void manualInitInputPort();
95 void manualExecuteNoThread();
96 void manualGetOutputs();
97 void createCppNodes();
98 void executeCppNode();
99 void createGraphWithCppNodes();
102 void classTeardown();
105 static std::map<std::string, YACS::ENGINE::Node*> _nodeMap;
106 static std::map<std::string, YACS::ENGINE::Bloc*> _blocMap;
107 static std::list<YACS::ENGINE::TypeCodeObjref *> _ltc;
110 static YACS::ENGINE::Runtime *_myRuntime;
112 static YACS::ENGINE::TypeCode *_tc_double;
113 static YACS::ENGINE::TypeCode *_tc_int;
114 static YACS::ENGINE::TypeCode *_tc_string;
115 static YACS::ENGINE::TypeCode *_tc;
116 static YACS::ENGINE::TypeCode *_tc_obj;
117 static YACS::ENGINE::TypeCode *_tc_seqdble;
118 static YACS::ENGINE::TypeCode *_tc_seqstr;
119 static YACS::ENGINE::TypeCode *_tc_seqlong;
120 static YACS::ENGINE::TypeCode *_tc_seqobj;
121 static YACS::ENGINE::TypeCode *_tc_seqseqdble;
122 static YACS::ENGINE::TypeCode *_tc_seqseqobj;
123 static YACS::ENGINE::TypeCode *_tc_C;
124 static YACS::ENGINE::TypeCode *_tc_seqC;
126 static bool endTests;