Commits

nejucomo committed 77a484d

Add a test that exposes a bug with empty TaggedFields.

Comments (0)

Files changed (2)

src/python/task/tests/ctest_messagedata.pyx

 
 
 
-    def test_tagedField ( self ):
+    def test_taggedField ( self ):
 
         subLength = len( 'Pi' ) + MessageDataType(()).pointerWidth() + 4
 
         self._readWriteCycle( fields, expectedLength, data, typeMap=typeMap )
 
 
+    def test_emptyTaggedField ( self ):
+
+        subLength = len( 'Pi' ) + MessageDataType(()).pointerWidth() + 4
+
+        fields = (
+            Field( 'value'  , Int32   ),
+            Field( 'tagged' , TaggedField ),
+            )
+
+        expectedLength = 4 + MessageDataType(()).pointerWidth() + TaggedField().TAG_WIDTH + subLength 
+
+        data = dict(
+            value   = 1,
+            )
+
+        typeMap = { Constant().getMessageTag(): Constant ( ) }
+
+        self._readWriteCycle( fields, expectedLength, data, typeMap=typeMap )
+
+
     def _readWriteCycle ( self, fields, expectedLength, data, missing=[], typeMap={} ):
 
         MessageTags.addTags(  typeMap )

src/python/task/tests/test_messagedata.py

         self.tester.test_subRecord2()
         
 
-    def test_tagedField ( self ):
-        self.tester.test_tagedField()
+    def test_taggedField ( self ):
+        self.tester.test_taggedField()
+        
+
+    def test_emptyTaggedField ( self ):
+        self.tester.test_emptyTaggedField()