+class ExampleAddRecordStage:
+ """ example use of a Record
+ """
+
+ record_spec = [('src1', 16), ('src2', 16)]
+ def ispec(self):
+ """ returns a tuple of input signals which will be the incoming data
+ """
+ return Record(self.record_spec)
+
+ def ospec(self):
+ return Record(self.record_spec)
+
+ def process(self, i):
+ """ process the input data (sums the values in the tuple) and returns it
+ """
+ return {'src1': i.src1 + 1,
+ 'src2': i.src2 + 1}
+
+
+class ExampleAddRecordPipe(CombPipe):
+ """ an example of how to use the combinatorial pipeline.
+ """
+
+ def __init__(self):
+ stage = ExampleAddRecordStage()
+ CombPipe.__init__(self, stage)
+
+
+def test7_resultfn(o_data, expected, i, o):
+ res = (expected['src1'] + 1, expected['src2'] + 1)
+ assert o_data['src1'] == res[0] and o_data['src2'] == res[1], \
+ "%d-%d data %s not match %s\n" \
+ % (i, o, repr(o_data), repr(expected))
+
+
+num_tests = 100