Tests: Multi-trace stream intersection test
[babeltrace.git] / bindings / python / writer.py
index f1525214511127876ab4f54ca7b6d2a21c121327..dc65b2438d7c60976fe54a24cf80fcb5ac12f182 100644 (file)
@@ -158,6 +158,9 @@ class Clock:
     def precision(self, precision):
         ret = nbt._bt_ctf_clock_set_precision(self._c, precision)
 
+        if ret < 0:
+            raise ValueError("Invalid precision value.")
+
     @property
     def offset_seconds(self):
         """
@@ -168,9 +171,9 @@ class Clock:
         :exc:`ValueError` is raised on error.
         """
 
-        offset_s = nbt._bt_ctf_clock_get_offset_s(self._c)
+        ret, offset_s = nbt._bt_ctf_clock_get_offset_s(self._c)
 
-        if offset_s == _MAX_UINT64:
+        if ret < 0:
             raise ValueError("Invalid clock instance")
 
         return offset_s
@@ -193,9 +196,9 @@ class Clock:
         :exc:`ValueError` is raised on error.
         """
 
-        offset = nbt._bt_ctf_clock_get_offset(self._c)
+        ret, offset = nbt._bt_ctf_clock_get_offset(self._c)
 
-        if offset == _MAX_UINT64:
+        if ret < 0:
             raise ValueError("Invalid clock instance")
 
         return offset
@@ -280,9 +283,9 @@ class Clock:
         :exc:`ValueError` is raised on error.
         """
 
-        time = nbt._bt_ctf_clock_get_time(self._c)
+        ret, time = nbt._bt_ctf_clock_get_time(self._c)
 
-        if time == _MAX_UINT64:
+        if ret < 0:
             raise ValueError("Invalid clock instance")
 
         return time
@@ -301,18 +304,25 @@ class IntegerBase:
     """
 
     #: Unknown
-    INTEGER_BASE_UNKNOWN = -1
+    UNKNOWN = -1
 
     #: Binary
-    INTEGER_BASE_BINARY = 2
+    BIN = 2
 
     #: Octal
-    INTEGER_BASE_OCTAL = 8
+    OCT = 8
 
     #: Decimal
-    INTEGER_BASE_DECIMAL = 10
+    DEC = 10
 
     #: Hexadecimal
+    HEX = 16
+
+    # keep this for backward compatibility
+    INTEGER_BASE_UNKNOWN = -1
+    INTEGER_BASE_BINARY = 2
+    INTEGER_BASE_OCTAL = 8
+    INTEGER_BASE_DECIMAL = 10
     INTEGER_BASE_HEXADECIMAL = 16
 
 
This page took 0.023968 seconds and 4 git commands to generate.