Fix: config: timestamp_begin and timestamp_end must be mapped to the same clock
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 16 Mar 2016 00:44:27 +0000 (20:44 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 18 Mar 2016 21:54:59 +0000 (17:54 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
barectf/config.py

index c0883109543f5eb90f5d34f86492267183bc7957..7c173f9ea786de29063dab1151df6c8ef237a4f3 100644 (file)
@@ -401,6 +401,8 @@ class _MetadataSpecialFieldsValidator:
 
         # "timestamp_begin", if exists, is an unsigned integer type,
         # mapped to a clock
+        ts_begin = None
+
         if 'timestamp_begin' in t.fields:
             ts_begin = t.fields['timestamp_begin']
 
@@ -415,6 +417,8 @@ class _MetadataSpecialFieldsValidator:
 
         # "timestamp_end", if exists, is an unsigned integer type,
         # mapped to a clock
+        ts_end = None
+
         if 'timestamp_end' in t.fields:
             ts_end = t.fields['timestamp_end']
 
@@ -431,6 +435,11 @@ class _MetadataSpecialFieldsValidator:
         if (('timestamp_begin' in t.fields) ^ ('timestamp_end' in t.fields)):
             raise ConfigError('"timestamp_begin" and "timestamp_end" fields must be defined together in stream packet context type')
 
+        # "timestamp_begin" and "timestamp_end" are mapped to the same clock
+        if ts_begin is not None and ts_end is not None:
+            if ts_begin.property_mappings[0].object.name != ts_end.property_mappings[0].object.name:
+                raise ConfigError('"timestamp_begin" and "timestamp_end" fields must be mapped to the same clock object in stream packet context type')
+
         # "events_discarded", if exists, is an unsigned integer type
         if 'events_discarded' in t.fields:
             events_discarded = t.fields['events_discarded']
This page took 0.025067 seconds and 4 git commands to generate.