if (clockCls->origin().isUnixEpoch()) {
_mExpectation = PropsExpectation::OriginUnix;
} else if (const auto uuid = clockCls->uuid()) {
- _mExpectation = PropsExpectation::OriginOtherUuid;
+ _mExpectation = PropsExpectation::OriginUnknownWithUuid;
} else {
- _mExpectation = PropsExpectation::OriginOtherNoUuid;
+ _mExpectation = PropsExpectation::OriginUnknownWithoutUuid;
}
} else {
_mExpectation = PropsExpectation::None;
case PropsExpectation::OriginUnix:
if (!clockCls) {
- throw ClockCorrelationError {ClockCorrelationError::Type::ExpectingOriginUnixGotNone,
- {},
- *_mRefClockClass,
- streamCls};
+ throw ClockCorrelationError {
+ ClockCorrelationError::Type::ExpectingOriginUnixGotNoClockClass,
+ {},
+ *_mRefClockClass,
+ streamCls};
}
if (!clockCls->origin().isUnixEpoch()) {
- throw ClockCorrelationError {ClockCorrelationError::Type::ExpectingOriginUnixGotOther,
- *clockCls, *_mRefClockClass, streamCls};
+ throw ClockCorrelationError {
+ ClockCorrelationError::Type::ExpectingOriginUnixGotUnknownOrigin, *clockCls,
+ *_mRefClockClass, streamCls};
}
break;
- case PropsExpectation::OriginOtherUuid:
+ case PropsExpectation::OriginUnknownWithUuid:
{
if (!clockCls) {
- throw ClockCorrelationError {ClockCorrelationError::Type::ExpectingOriginUuidGotNone,
- {},
- *_mRefClockClass,
- streamCls};
+ throw ClockCorrelationError {
+ ClockCorrelationError::Type::ExpectingOriginUnknownWithUuidGotNoClockClass,
+ {},
+ *_mRefClockClass,
+ streamCls};
}
if (clockCls->origin().isUnixEpoch()) {
- throw ClockCorrelationError {ClockCorrelationError::Type::ExpectingOriginUuidGotUnix,
- *clockCls, *_mRefClockClass, streamCls};
+ throw ClockCorrelationError {
+ ClockCorrelationError::Type::ExpectingOriginUnknownWithUuidGotUnixOrigin, *clockCls,
+ *_mRefClockClass, streamCls};
}
const auto uuid = clockCls->uuid();
if (!uuid) {
- throw ClockCorrelationError {ClockCorrelationError::Type::ExpectingOriginUuidGotNoUuid,
- *clockCls, *_mRefClockClass, streamCls};
+ throw ClockCorrelationError {
+ ClockCorrelationError::Type::ExpectingOriginUnknownWithUuidGotWithoutUuid,
+ *clockCls, *_mRefClockClass, streamCls};
}
if (*uuid != *_mRefClockClass->uuid()) {
throw ClockCorrelationError {
- ClockCorrelationError::Type::ExpectingOriginUuidGotOtherUuid, *clockCls,
+ ClockCorrelationError::Type::ExpectingOriginUnknownWithUuidGotOtherUuid, *clockCls,
*_mRefClockClass, streamCls};
}
break;
}
- case PropsExpectation::OriginOtherNoUuid:
+ case PropsExpectation::OriginUnknownWithoutUuid:
if (!clockCls) {
- throw ClockCorrelationError {ClockCorrelationError::Type::ExpectingOriginNoUuidGotNone,
- {},
- *_mRefClockClass,
- streamCls};
+ throw ClockCorrelationError {
+ ClockCorrelationError::Type::ExpectingOriginUnknownWithoutUuidGotNoClockClass,
+ {},
+ *_mRefClockClass,
+ streamCls};
}
if (clockCls->libObjPtr() != _mRefClockClass->libObjPtr()) {
- throw ClockCorrelationError {ClockCorrelationError::Type::ExpectingOriginNoUuidGotOther,
- *clockCls, *_mRefClockClass, streamCls};
+ throw ClockCorrelationError {
+ ClockCorrelationError::Type::ExpectingOriginUnknownWithoutUuidGotOtherClockClass,
+ *clockCls, *_mRefClockClass, streamCls};
}
break;
enum bt_clock_correlation_validator_error_type
{
BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_NO_CLOCK_CLASS_GOT_ONE,
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_NONE,
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_OTHER,
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_NONE,
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_UNIX,
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_NO_UUID,
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_OTHER_UUID,
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_NO_UUID_GOT_NONE,
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_NO_UUID_GOT_OTHER,
+
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_NO_CLOCK_CLASS,
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_UNKNOWN_ORIGIN,
+
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_NO_CLOCK_CLASS,
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_UNIX_ORIGIN,
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_WITHOUT_UUID,
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_OTHER_UUID,
+
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITHOUT_UUID_GOT_NO_CLOCK_CLASS,
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITHOUT_UUID_GOT_OTHER_CLOCK_CLASS,
};
struct bt_clock_correlation_validator *bt_clock_correlation_validator_create(
{
ExpectingNoClockClassGotOne =
BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_NO_CLOCK_CLASS_GOT_ONE,
- ExpectingOriginUnixGotNone =
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_NONE,
- ExpectingOriginUnixGotOther =
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_OTHER,
- ExpectingOriginUuidGotNone =
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_NONE,
- ExpectingOriginUuidGotUnix =
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_UNIX,
- ExpectingOriginUuidGotNoUuid =
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_NO_UUID,
- ExpectingOriginUuidGotOtherUuid =
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_OTHER_UUID,
- ExpectingOriginNoUuidGotNone =
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_NO_UUID_GOT_NONE,
- ExpectingOriginNoUuidGotOther =
- BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_NO_UUID_GOT_OTHER,
+
+ ExpectingOriginUnixGotNoClockClass =
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_NO_CLOCK_CLASS,
+ ExpectingOriginUnixGotUnknownOrigin =
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_UNKNOWN_ORIGIN,
+
+ ExpectingOriginUnknownWithUuidGotNoClockClass =
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_NO_CLOCK_CLASS,
+ ExpectingOriginUnknownWithUuidGotUnixOrigin =
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_UNIX_ORIGIN,
+ ExpectingOriginUnknownWithUuidGotWithoutUuid =
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_WITHOUT_UUID,
+ ExpectingOriginUnknownWithUuidGotOtherUuid =
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_OTHER_UUID,
+
+ ExpectingOriginUnknownWithoutUuidGotNoClockClass =
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITHOUT_UUID_GOT_NO_CLOCK_CLASS,
+ ExpectingOriginUnknownWithoutUuidGotOtherClockClass =
+ BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITHOUT_UUID_GOT_OTHER_CLOCK_CLASS,
};
explicit ClockCorrelationError(
/* Expect a clock with a Unix epoch origin. */
OriginUnix,
- /* Expect a clock without a Unix epoch origin, but with a UUID. */
- OriginOtherUuid,
+ /* Expect a clock with an unknown origin, but with a UUID. */
+ OriginUnknownWithUuid,
- /* Expect a clock without a Unix epoch origin and without a UUID. */
- OriginOtherNoUuid,
+ /* Expect a clock with an unknown origin and without a UUID. */
+ OriginUnknownWithoutUuid,
};
public:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"stream-class-has-no-clock-class", false,
"Expecting no clock class, got one.");
- case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_NONE:
+ case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_NO_CLOCK_CLASS:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"stream-class-has-clock-class-with-unix-epoch-origin", false,
"Expecting a clock class, got none.");
- case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_OTHER:
+ case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNIX_GOT_UNKNOWN_ORIGIN:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"clock-class-has-unix-epoch-origin", false,
"Expecting a clock class with Unix epoch origin: %![cc-]+K",
actual_clock_cls);
- case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_NONE:
+ case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_NO_CLOCK_CLASS:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"stream-class-has-clock-class-with-uuid", false,
"Expecting a clock class, got none.");
- case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_UNIX:
+ case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_UNIX_ORIGIN:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"clock-class-has-non-unix-epoch-origin", false,
"Expecting a clock class without Unix epoch origin: %![cc-]+K",
actual_clock_cls);
- case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_NO_UUID:
+ case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_WITHOUT_UUID:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"clock-class-has-uuid", false,
"Expecting a clock class with UUID: %![cc-]+K",
actual_clock_cls);
- case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UUID_GOT_OTHER_UUID:
+ case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITH_UUID_GOT_OTHER_UUID:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"clock-class-has-expected-uuid", false,
"Expecting a clock class with UUID, got one with a different UUID: "
"%![cc-]+K, expected-uuid=%!u",
actual_clock_cls, bt_clock_class_get_uuid(ref_clock_cls));
- case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_NO_UUID_GOT_NONE:
+ case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITHOUT_UUID_GOT_NO_CLOCK_CLASS:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"stream-class-has-clock-class", false,
"Expecting a clock class, got none.");
- case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_NO_UUID_GOT_OTHER:
+ case BT_CLOCK_CORRELATION_VALIDATOR_ERROR_TYPE_EXPECTING_ORIGIN_UNKNOWN_WITHOUT_UUID_GOT_OTHER_CLOCK_CLASS:
BT_ASSERT_POST_DEV(NEXT_METHOD_NAME,
"clock-class-is-expected", false,
"Unexpected clock class: %![expected-cc-]+K, %![actual-cc-]+K",
"Expecting no clock class, but got one: clock-class-addr={}, clock-class-name={}",
fmt::ptr(actualClkCls->libObjPtr()), actualClkCls->name());
- case Type::ExpectingOriginUnixGotNone:
- case Type::ExpectingOriginUuidGotNone:
- case Type::ExpectingOriginNoUuidGotNone:
+ case Type::ExpectingOriginUnixGotNoClockClass:
+ case Type::ExpectingOriginUnknownWithUuidGotNoClockClass:
+ case Type::ExpectingOriginUnknownWithoutUuidGotNoClockClass:
BT_CPPLOGE_APPEND_CAUSE_AND_THROW(
bt2::Error,
"Expecting a clock class, but got none: stream-class-addr={}, "
fmt::ptr(error.streamCls()->libObjPtr()), error.streamCls()->name(),
error.streamCls()->id());
- case Type::ExpectingOriginUnixGotOther:
+ case Type::ExpectingOriginUnixGotUnknownOrigin:
BT_CPPLOGE_APPEND_CAUSE_AND_THROW(
bt2::Error,
"Expecting a clock class having a Unix epoch origin, but got one not having a Unix "
"epoch origin: clock-class-addr={}, clock-class-name={}",
fmt::ptr(actualClkCls->libObjPtr()), actualClkCls->name());
- case Type::ExpectingOriginUuidGotUnix:
+ case Type::ExpectingOriginUnknownWithUuidGotUnixOrigin:
BT_CPPLOGE_APPEND_CAUSE_AND_THROW(
bt2::Error,
"Expecting a clock class not having a Unix epoch origin, "
"clock-class-addr={}, clock-class-name={}",
fmt::ptr(actualClkCls->libObjPtr()), actualClkCls->name());
- case Type::ExpectingOriginUuidGotNoUuid:
+ case Type::ExpectingOriginUnknownWithUuidGotWithoutUuid:
BT_CPPLOGE_APPEND_CAUSE_AND_THROW(
bt2::Error,
"Expecting a clock class with a UUID, but got one without a UUID: "
"clock-class-addr={}, clock-class-name={}",
fmt::ptr(actualClkCls->libObjPtr()), actualClkCls->name());
- case Type::ExpectingOriginUuidGotOtherUuid:
+ case Type::ExpectingOriginUnknownWithUuidGotOtherUuid:
BT_CPPLOGE_APPEND_CAUSE_AND_THROW(
bt2::Error,
"Expecting a clock class with a specific UUID, but got one with a different UUID: "
fmt::ptr(actualClkCls->libObjPtr()), actualClkCls->name(), *refClkCls->uuid(),
*actualClkCls->uuid());
- case Type::ExpectingOriginNoUuidGotOther:
+ case Type::ExpectingOriginUnknownWithoutUuidGotOtherClockClass:
BT_CPPLOGE_APPEND_CAUSE_AND_THROW(
bt2::Error,
"Unexpected clock class: "