certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] applications/PyHLA .cvsignore CMakeLists.txt te...


From: certi-cvs
Subject: [certi-cvs] applications/PyHLA .cvsignore CMakeLists.txt te...
Date: Tue, 28 Oct 2008 21:13:20 +0000

CVSROOT:        /sources/certi
Module name:    applications
Changes by:     Petr Gotthard <gotthardp>       08/10/28 21:13:20

Modified files:
        PyHLA          : .cvsignore CMakeLists.txt 
Added files:
        PyHLA/test     : .cvsignore CMakeLists.txt 
                         transportationtype_conversion.py 

Log message:
        Initial test suite added.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/applications/PyHLA/.cvsignore?cvsroot=certi&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/applications/PyHLA/CMakeLists.txt?cvsroot=certi&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/applications/PyHLA/test/.cvsignore?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/PyHLA/test/CMakeLists.txt?cvsroot=certi&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/applications/PyHLA/test/transportationtype_conversion.py?cvsroot=certi&rev=1.1

Patches:
Index: .cvsignore
===================================================================
RCS file: /sources/certi/applications/PyHLA/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- .cvsignore  9 Oct 2008 16:50:58 -0000       1.2
+++ .cvsignore  28 Oct 2008 21:13:19 -0000      1.3
@@ -6,6 +6,7 @@
 CMakeCache.txt
 CPackConfig.cmake
 CPackSourceConfig.cmake
+.comFedRTI.*
 *.pyc
 *.rpm
 *.zip

Index: CMakeLists.txt
===================================================================
RCS file: /sources/certi/applications/PyHLA/CMakeLists.txt,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- CMakeLists.txt      28 Oct 2008 17:00:11 -0000      1.5
+++ CMakeLists.txt      28 Oct 2008 21:13:19 -0000      1.6
@@ -26,6 +26,7 @@
 MESSAGE(STATUS "Python modules will be installed in: ${CMAKE_INSTALL_PREFIX}")
 
 ADD_SUBDIRECTORY(hla)
+ADD_SUBDIRECTORY(test)
 
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Python bindings for the Modeling and 
Simulation (M&S) High Level Architecture (HLA)")
 SET(CPACK_PACKAGE_VENDOR "Petr Gotthard")
@@ -48,4 +49,4 @@
 
 INCLUDE(CPack)
 
-# $Id: CMakeLists.txt,v 1.5 2008/10/28 17:00:11 gotthardp Exp $
+# $Id: CMakeLists.txt,v 1.6 2008/10/28 21:13:19 gotthardp Exp $

Index: test/.cvsignore
===================================================================
RCS file: test/.cvsignore
diff -N test/.cvsignore
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/.cvsignore     28 Oct 2008 21:13:19 -0000      1.1
@@ -0,0 +1,7 @@
+Makefile
+CMakeFiles
+cmake_install.cmake
+Testing
+CTestTestfile.cmake
+.comFedRTI.*
+*.pyc

Index: test/CMakeLists.txt
===================================================================
RCS file: test/CMakeLists.txt
diff -N test/CMakeLists.txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/CMakeLists.txt 28 Oct 2008 21:13:20 -0000      1.1
@@ -0,0 +1,5 @@
+ENABLE_TESTING()
+
+ADD_TEST(transportationtype_conversion ${PYTHON_EXECUTABLE} 
transportationtype_conversion.py)
+
+# $Id: CMakeLists.txt,v 1.1 2008/10/28 21:13:20 gotthardp Exp $

Index: test/transportationtype_conversion.py
===================================================================
RCS file: test/transportationtype_conversion.py
diff -N test/transportationtype_conversion.py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/transportationtype_conversion.py       28 Oct 2008 21:13:20 -0000      
1.1
@@ -0,0 +1,45 @@
+import hla.rti as rti
+import hla.omt as fom
+
+def ASSERT(condition):
+    if(not condition):
+        raise Exception("unexpected result")
+
+def RAISE_NAMENOTFOUND(function):
+    try:
+        function()
+        raise Exception("unexpected result")
+    except rti.NameNotFound:
+        pass
+
+rtia = rti.RTIAmbassador()
+
+# --- transportationHandle
+reliable = rtia.getTransportationHandle("HLAreliable")
+reliable2 = rtia.getTransportationName(reliable)
+print reliable, reliable2
+ASSERT(reliable2 == "HLAreliable")
+
+bestEffort = rtia.getTransportationHandle("HLAbestEffort")
+print bestEffort
+ASSERT(bestEffort == rtia.getTransportationHandle("HLAbestEffort"))
+ASSERT(bestEffort != reliable)
+
+RAISE_NAMENOTFOUND(lambda: rtia.getTransportationHandle("Receive")) # ordering
+RAISE_NAMENOTFOUND(lambda: rtia.getTransportationHandle("UNKNOWN"))
+
+# --- orderingHandle
+receive = rtia.getOrderingHandle("Receive")
+receive2 = rtia.getOrderingName(receive)
+print receive, receive2
+ASSERT(receive2 == "Receive")
+
+timestamp = rtia.getOrderingHandle("Timestamp")
+print timestamp
+ASSERT(timestamp == rtia.getOrderingHandle("Timestamp"))
+ASSERT(timestamp != receive)
+
+RAISE_NAMENOTFOUND(lambda: rtia.getOrderingHandle("HLAreliable")) # 
transportation
+RAISE_NAMENOTFOUND(lambda: rtia.getOrderingHandle("UNKNOWN"))
+
+# $Id: transportationtype_conversion.py,v 1.1 2008/10/28 21:13:20 gotthardp 
Exp $




reply via email to

[Prev in Thread] Current Thread [Next in Thread]