+
+#
+# Copyright (C) 2019 EfficiOS Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; only version 2
+# of the License.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
from bt2 import value
import collections
import unittest
message_iterator_class=MyIter):
def __init__(self, params):
nonlocal the_output_port_from_source
- the_output_port_from_source = self._add_output_port('out')
+ the_output_port_from_source = self._add_output_port('out', 'user data')
initialized = False
graph = self._create_graph(MySource)
graph.run()
self.assertTrue(initialized)
self.assertEqual(the_output_port_from_source.addr, the_output_port_from_iter.addr)
+ self.assertEqual(the_output_port_from_iter.user_data, 'user data')
def test_finalize(self):
class MyIter(bt2._UserMessageIterator):
self.assertIsInstance(msg, bt2.message._StreamEndMessage)
else:
self.assertIsInstance(msg, bt2.message._EventMessage)
- self.assertEqual(msg.event.event_class.name, 'salut')
+ self.assertEqual(msg.event.cls.name, 'salut')
field = msg.event.payload_field['my_int']
self.assertEqual(field, at * 3)